mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-12 20:50:56 +00:00
146be8e16b
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk ........ r33490 | thebluegr | 2008-08-01 16:03:20 +0200 (Fri, 01 Aug 2008) | 2 lines Added load confirmation dialog for IHNM, like in the original. Fixes bug #1971699 - "IHNM: No Load Game Confirmation" ........ r33492 | thebluegr | 2008-08-01 16:27:40 +0200 (Fri, 01 Aug 2008) | 1 line Fixed crash on exit from commit #32742 - the memory leak was only in IHNM, not ITE (in ITE, the 4 sprite lists are actually one) ........ r33495 | fingolfin | 2008-08-01 18:31:40 +0200 (Fri, 01 Aug 2008) | 1 line Print a warning if unsupported XMIDI controllers are used ........ r33496 | fingolfin | 2008-08-01 18:33:22 +0200 (Fri, 01 Aug 2008) | 1 line Moved Ludde & yaz0r to a new credits section, retired project leaders ........ r33509 | peres001 | 2008-08-02 04:24:36 +0200 (Sat, 02 Aug 2008) | 2 lines * Added a preprocessor to deal with the crappy location scripts in BRA. * Added some comments on how the parser and related code should be changed to make things smoother. ........ r33510 | peres001 | 2008-08-02 04:26:09 +0200 (Sat, 02 Aug 2008) | 1 line Removed debug code I forgot a long time ago ;) ........ r33511 | peres001 | 2008-08-02 04:43:05 +0200 (Sat, 02 Aug 2008) | 1 line Fixed issues detected by DrMcCoy's obnoxious compiler. ;) ........ r33512 | peres001 | 2008-08-02 05:19:45 +0200 (Sat, 02 Aug 2008) | 2 lines * Increasing max number of allowed token on one line. * Increasing buffer size to match old parser. ........ r33518 | lordhoto | 2008-08-02 13:40:09 +0200 (Sat, 02 Aug 2008) | 2 lines Fix for bug #2035459 "KYRA1: long savegame names cause garbage". ........ r33519 | lordhoto | 2008-08-02 13:57:06 +0200 (Sat, 02 Aug 2008) | 2 lines Proper fix for bug #2035459 "KYRA1: long savegame names cause garbage". ........ r33522 | lordhoto | 2008-08-02 16:32:05 +0200 (Sat, 02 Aug 2008) | 2 lines Fixed regressions in kyra1 amiga. ........ r33523 | athrxx | 2008-08-02 16:35:38 +0200 (Sat, 02 Aug 2008) | 1 line HOF: bug fix for FM-Towns music when using output rates other than 22050 khz ........ r33524 | lordhoto | 2008-08-02 16:35:43 +0200 (Sat, 02 Aug 2008) | 2 lines Add warning when a voc file is not found. ........ r33525 | Kirben | 2008-08-02 16:37:10 +0200 (Sat, 02 Aug 2008) | 1 line Detect both HOF non-interactive demos. ........ r33526 | lordhoto | 2008-08-02 16:42:44 +0200 (Sat, 02 Aug 2008) | 2 lines Fixed yet another crash in kyra1 amiga. ........ r33527 | lordhoto | 2008-08-02 17:05:19 +0200 (Sat, 02 Aug 2008) | 2 lines Added a member function loadSoundFile to Sound which accepts a filename string instead of a filename list id. ........ r33529 | buddha_ | 2008-08-02 17:47:25 +0200 (Sat, 02 Aug 2008) | 7 lines - Combined loadAbs and loadResource into one function. - Made resource loading functions (loadSpl, loadMsk etc) return the number of the animDataTable entry right after the loaded data. - Made resource loading functions always load multiframe data into directly sequential animDataTable entries (Hopefully this won't break anything). ........ r33530 | buddha_ | 2008-08-02 17:59:38 +0200 (Sat, 02 Aug 2008) | 3 lines Made loadResourcesFromSave internally use the loadResource-function. Fixes Operation Stealth savegame loading! HURRAH! FINALLY! ........ r33537 | sev | 2008-08-02 23:05:46 +0200 (Sat, 02 Aug 2008) | 2 lines Fix crash when drascula.dat file is missing ........ r33541 | sev | 2008-08-02 23:22:05 +0200 (Sat, 02 Aug 2008) | 2 lines Fix bug #2007170: "DRASCULA: No Spaces in SaveGames Names" ........ r33544 | sev | 2008-08-02 23:36:08 +0200 (Sat, 02 Aug 2008) | 2 lines Fix bug #2023727: "MONKEY2: Misplaced Text" ........ r33546 | sev | 2008-08-02 23:57:35 +0200 (Sat, 02 Aug 2008) | 2 lines Fix bug #1879606: "MANIACNES: Crash when game ends" ........ r33550 | fingolfin | 2008-08-03 00:32:32 +0200 (Sun, 03 Aug 2008) | 1 line Fix for bug #1972625 'ALL: On-the-fly targets are written to the config file' ........ r33552 | sev | 2008-08-03 00:51:53 +0200 (Sun, 03 Aug 2008) | 3 lines Fix for bug #1945335: "SCUMM: Invalid charset id can be stored". Regressions possible. ........ r33553 | fingolfin | 2008-08-03 01:01:14 +0200 (Sun, 03 Aug 2008) | 1 line Renamed Tinsel v1->v0 (used in the demo only), and v2->v1, to avoid confusion with DW2 ........ r33554 | sev | 2008-08-03 01:05:38 +0200 (Sun, 03 Aug 2008) | 2 lines Fix bug #2035390: "GUI: setting game id to "scummvm" messes up list" ........ r33556 | athrxx | 2008-08-03 01:11:31 +0200 (Sun, 03 Aug 2008) | 1 line add non-interactive lol demo ........ r33558 | eriktorbjorn | 2008-08-03 09:40:04 +0200 (Sun, 03 Aug 2008) | 3 lines Fixed #2021902 ("DRASCULA: Can't adjust the volume inside the game"). I can't verify that this matches the original behaviour, but at least it's better now. ........ r33561 | buddha_ | 2008-08-03 10:01:11 +0200 (Sun, 03 Aug 2008) | 1 line Shut up MSVC warning about mgY being an unreferenced local variable. ........ r33562 | fingolfin | 2008-08-03 10:05:19 +0200 (Sun, 03 Aug 2008) | 1 line Proper fix for bug #2035390: Check for ConfigManager::kApplicationDomain, and also forbid targets starting with an underscore ........ r33565 | eriktorbjorn | 2008-08-03 11:41:10 +0200 (Sun, 03 Aug 2008) | 4 lines Fixed bug that prevented upper-case letters from being used in savegame names. Apparently, strchr(..., 0) will find the string terminator - at least for me - and when that's added to the name, it will terminate the string. ........ r33568 | eriktorbjorn | 2008-08-03 11:51:13 +0200 (Sun, 03 Aug 2008) | 2 lines Fixed bug #1995022 ("BASS: wrong displayed 2 line text"). ........ r33570 | eriktorbjorn | 2008-08-03 12:16:17 +0200 (Sun, 03 Aug 2008) | 5 lines Fixed bug #1995033 ("BASS: BG Sound stopped on opening item list"). Apparently the sound is supposed to be paused and then unpaused, but the pause function is called many more times than the unpause function. In the original, this presumably didn't matter. In ScummVM's mixer, it does. ........ r33574 | sev | 2008-08-03 13:42:05 +0200 (Sun, 03 Aug 2008) | 2 lines Fix bug #2017432: "DRASCULA: Typing is slow when you save a game" ........ r33576 | sev | 2008-08-03 14:02:09 +0200 (Sun, 03 Aug 2008) | 2 lines Fix bug #2011470: "DRASCULA: slowdown when you hold mouse buttons" ........ r33578 | athrxx | 2008-08-03 14:09:48 +0200 (Sun, 03 Aug 2008) | 1 line add support for HOF Italian fan translation to kyra.dat ........ r33579 | lordhoto | 2008-08-03 14:16:53 +0200 (Sun, 03 Aug 2008) | 2 lines Added detection entries for kyra2 cd italian fan translation (see fr#2003504 "KYRA: add support for Italian version of Kyrandia 2&3"). (totally untested!) ........ r33580 | athrxx | 2008-08-03 14:50:56 +0200 (Sun, 03 Aug 2008) | 1 line fix last commit (invalid kyra.dat game features for HOFCD) ........ r33581 | lordhoto | 2008-08-03 14:53:12 +0200 (Sun, 03 Aug 2008) | 2 lines Removed comment. ........ r33584 | fingolfin | 2008-08-03 18:54:18 +0200 (Sun, 03 Aug 2008) | 1 line New OSystem API for loading/storing default config file ........ r33585 | fingolfin | 2008-08-03 19:05:01 +0200 (Sun, 03 Aug 2008) | 1 line OSYSTEM: Pushed some SDL/Symbian specific code to the respective backends; made openConfigFileForReading/openConfigFileForWriting return 0 if they failed to open a file ........ r33586 | fingolfin | 2008-08-03 20:11:27 +0200 (Sun, 03 Aug 2008) | 1 line Implemented DumpFile::open(FSNode) ........ r33587 | fingolfin | 2008-08-03 20:29:37 +0200 (Sun, 03 Aug 2008) | 1 line cleanup ........ r33590 | fingolfin | 2008-08-03 20:35:51 +0200 (Sun, 03 Aug 2008) | 1 line FilesystemNode code: some comment cleanup; added FilesystemNode::openForReading() and openForWriting() methods (for now these are simple wrappers around Common::File) ........ r33596 | Kirben | 2008-08-04 03:57:50 +0200 (Mon, 04 Aug 2008) | 1 line Remove debug left over. ........ r33604 | fingolfin | 2008-08-04 13:30:47 +0200 (Mon, 04 Aug 2008) | 1 line Moved the OutSaveFile::finalize method to WriteStream; implemented DumpFile::flush() ........ r33605 | fingolfin | 2008-08-04 13:32:42 +0200 (Mon, 04 Aug 2008) | 1 line Removed join_paths from default save manager, and use FSNode API instead (may lead to regressions, watch out) ........ r33606 | fingolfin | 2008-08-04 13:38:25 +0200 (Mon, 04 Aug 2008) | 1 line Turned InSaveFile & OutSaveFile into simple typedefs ........ r33607 | fingolfin | 2008-08-04 13:46:52 +0200 (Mon, 04 Aug 2008) | 1 line SCUMM: Only try to load savefile metadata from slots >= 0 ........ r33608 | fingolfin | 2008-08-04 13:48:33 +0200 (Mon, 04 Aug 2008) | 1 line DefaultSaveFileManager: Killed class StdioSaveFile, used FilesystemNode::openForReading()/openForWriting() instead (may cause regressions, watch out) ........ r33609 | fingolfin | 2008-08-04 15:25:30 +0200 (Mon, 04 Aug 2008) | 1 line Modified DumpFile::open to accept non-existing nodes, and to actually open files in write mode -- d'oh ........ r33610 | thebluegr | 2008-08-04 17:01:41 +0200 (Mon, 04 Aug 2008) | 1 line Fixing compilation under MSVC ........ r33611 | thebluegr | 2008-08-04 17:23:08 +0200 (Mon, 04 Aug 2008) | 1 line Added Italian translation for the load confirmation window in IHNM ........ r33614 | fingolfin | 2008-08-04 19:17:37 +0200 (Mon, 04 Aug 2008) | 1 line Moved ConfMan.registerDefault calls for savepath to DefaultSaveFileManager (eventually, should be pushed into backends/platform/ code) ........ r33615 | fingolfin | 2008-08-04 19:41:07 +0200 (Mon, 04 Aug 2008) | 1 line Modified DefaultSaveFileManager::checkPath to perform at least basic checks on non-UNIX, non-Symbian systems ........ r33617 | fingolfin | 2008-08-04 19:46:22 +0200 (Mon, 04 Aug 2008) | 1 line Remove some code which was rendered obsolete by md5's commit r33610 ........ r33618 | anotherguest | 2008-08-04 20:14:17 +0200 (Mon, 04 Aug 2008) | 3 lines List the correct engines in about, updated actions with Lure (from WinCE). Increased min heap size to 5MB ........ r33620 | buddha_ | 2008-08-04 21:32:52 +0200 (Mon, 04 Aug 2008) | 7 lines Fix for misplaced objects in mouse object selection (Operation Stealth specific). - Implemented Operation Stealth specific part of getObjectUnderCursor which handles negative frame values. - Fixed a test case (Should test for ydif <= 0 although tested for ydif < 0). - Made part-value be anded with 0x0F in a test case to comply with disassembly. - Added comment about a test case which isn't present in the disassembly. Removing it makes things crash sometimes so letting it be. ........ r33621 | fingolfin | 2008-08-04 21:38:28 +0200 (Mon, 04 Aug 2008) | 1 line Pushed some port specific code from DefaultSaveFileManager out to port specific code in backends/platform/ ........ r33623 | anotherguest | 2008-08-04 22:00:56 +0200 (Mon, 04 Aug 2008) | 1 line Symbian build package should now contain drascula.dat also ........ r33626 | Kirben | 2008-08-05 02:21:46 +0200 (Tue, 05 Aug 2008) | 1 line Fix win32 compile. ........ r33627 | Kirben | 2008-08-05 02:27:25 +0200 (Tue, 05 Aug 2008) | 1 line Removed unneeded #includes. ........ r33632 | lordhoto | 2008-08-05 13:32:16 +0200 (Tue, 05 Aug 2008) | 2 lines Changed implementation parameters/return values to match definition. ........ r33633 | Kirben | 2008-08-05 13:42:04 +0200 (Tue, 05 Aug 2008) | 1 line Remove file attribute check, since getChild() can be called on file path that doesn'r exist. ........ r33635 | lordhoto | 2008-08-05 14:13:01 +0200 (Tue, 05 Aug 2008) | 2 lines Output errors on (some) missing files. ........ r33637 | buddha_ | 2008-08-05 14:58:23 +0200 (Tue, 05 Aug 2008) | 7 lines Fix prompt updating regression introduced in r32257: Previously prompt didn't get updated all the time, like e.g. when selecting EXAMINE and moving the cursor over to DOOR and then moving the cursor to a place where there was no selectable object. The prompt would've still shown "EXAMINE DOOR", now it shows just "EXAMINE" which is correct AFAIK. ........ r33639 | fingolfin | 2008-08-05 15:08:07 +0200 (Tue, 05 Aug 2008) | 1 line SCUMM: Don't try to load metadata for slot -1 (i.e. don't try to load metadata if nothing is selected) ........ r33640 | fingolfin | 2008-08-05 15:11:22 +0200 (Tue, 05 Aug 2008) | 1 line SCUMM: cleanup SaveLoadChooser::updateInfos code ........ r33642 | buddha_ | 2008-08-05 20:17:55 +0200 (Tue, 05 Aug 2008) | 1 line Add detection entry for a previously unrecognized 16 color PC version of Operation Stealth (The John Glames variant). ........ r33643 | buddha_ | 2008-08-05 21:30:16 +0200 (Tue, 05 Aug 2008) | 5 lines Made rest of resource loading functions used in loadResource return -1 on error. This fixed a crash in Operation Stealth when walking out of the airport (Some file couldn't be opened and the game crashed because of that. Now it doesn't crash but handles the missing file gracefully). ........ r33644 | buddha_ | 2008-08-05 23:20:11 +0200 (Tue, 05 Aug 2008) | 1 line Workaround for missing player character animation when exiting the airport in Santa Paragua in at least the 256 color PC version of Operation Stealth. ........ r33645 | fingolfin | 2008-08-05 23:26:04 +0200 (Tue, 05 Aug 2008) | 1 line Patch #2014663: Do not mark stack as executable in HQx scaler ........ r33648 | eriktorbjorn | 2008-08-05 23:43:10 +0200 (Tue, 05 Aug 2008) | 4 lines Committed my patch #2026097 ("ALSA: Try both 65:0 and 17:0 by default"), with a slight modification to the README changes. (I don't know how to interpret all the output from aconnect, so I'm only documenting "the most important bit".) ........ r33654 | fingolfin | 2008-08-06 11:13:57 +0200 (Wed, 06 Aug 2008) | 1 line SCUMM: Renamed inventoryScript -> inventoryScriptIndy3Mac ........ r33655 | fingolfin | 2008-08-06 12:32:20 +0200 (Wed, 06 Aug 2008) | 1 line Workaround for bug #2016521 (DOTT: Bernard impersonating LaVerne) ........ r33664 | fingolfin | 2008-08-06 18:03:06 +0200 (Wed, 06 Aug 2008) | 1 line Do not query savestates which obviously do not exist (to shut up bogus console warnings) ........ r33667 | buddha_ | 2008-08-06 22:41:53 +0200 (Wed, 06 Aug 2008) | 5 lines HACK: Force oxygen to maximum during Operation Stealth's first arcade sequence. This way the arcade sequence is completable now. This hack should be removed later and the first arcade sequence be made properly playable! ........ r33668 | buddha_ | 2008-08-06 22:47:59 +0200 (Wed, 06 Aug 2008) | 5 lines Add 320x200 screen bounds checking to Operation Stealth's checkCollision function. Fixes teleporting bug when getting out of the water after first arcade sequence. The player previously got teleported to the beach near the hotel. Now it doesn't happen. The player is still caught motionless and can't move after this fix though... ........ r33669 | buddha_ | 2008-08-06 22:54:38 +0200 (Wed, 06 Aug 2008) | 1 line Renamed page3Raw to collisionPage so it's more apparent what it does. ........ r33670 | buddha_ | 2008-08-06 22:58:02 +0200 (Wed, 06 Aug 2008) | 1 line Tiny comment update to loadCt-opcodes: Load collision table data. ........ r33673 | buddha_ | 2008-08-07 01:12:25 +0200 (Thu, 07 Aug 2008) | 4 lines HACK: In Operation Stealth after the first arcade sequence jump player's position to avoid getting stuck. The player's position is changed only by *one* pixel but it helps and makes it possible to carry on with the game (Previously the player was totally stuck). ........ r33674 | knakos | 2008-08-07 11:10:42 +0200 (Thu, 07 Aug 2008) | 1 line smartphone-specific code not needed anymore ........ r33678 | eriktorbjorn | 2008-08-07 15:36:02 +0200 (Thu, 07 Aug 2008) | 3 lines Initialise the _sound object. Otherwise, ScummVM crashes for me if I use a native MIDI driver instead of Adlib. ........ r33682 | knakos | 2008-08-07 20:36:12 +0200 (Thu, 07 Aug 2008) | 1 line setup interface for later kyra games ........ r33686 | buddha_ | 2008-08-07 21:04:19 +0200 (Thu, 07 Aug 2008) | 7 lines Fix for popup boxes sometimes blocking animation when they shouldn't in Operation Stealth: - Made waitForPlayerClick updating more like in the original. - Moved removeMessages to after the frame drawing in main loop hoping to be more like the original. - Added an additional test to Operation Stealth's implementation of overlay type 2 drawing. - Added an additional parameter incrementing and testing to Operation Stealth's removeMessages. Hopefully this won't cause any regressions in Future Wars! ........ r33687 | buddha_ | 2008-08-07 21:31:12 +0200 (Thu, 07 Aug 2008) | 1 line Made drawPlainBox handle border cases so it won't corrupt memory so easily. This may help with some memory corruption issues when for an example trying to draw the player's command string out of screen. ........ r33688 | buddha_ | 2008-08-07 21:46:06 +0200 (Thu, 07 Aug 2008) | 1 line Added precautionary tests to background scrolling function in Operation Stealth to avoid possible memory corruptions. ........ r33689 | buddha_ | 2008-08-07 23:46:56 +0200 (Thu, 07 Aug 2008) | 1 line Implemented game speed changing by pressing - or + to e.g. ease testing. ........ r33690 | cyx | 2008-08-07 23:49:55 +0200 (Thu, 07 Aug 2008) | 1 line fix for bug #2040311: TOUCHE: Missing characters in the spanish version ........ r33691 | cyx | 2008-08-07 23:50:12 +0200 (Thu, 07 Aug 2008) | 1 line fix for bug #2040484: TOUCHE: Graphic glitch with long answer options ........ r33693 | Kirben | 2008-08-08 04:18:17 +0200 (Fri, 08 Aug 2008) | 1 line Hopefully allow quiting at any stage AGOS engines games again. ........ r33696 | Kirben | 2008-08-08 04:49:51 +0200 (Fri, 08 Aug 2008) | 1 line Remove debug leftover. ........ r33698 | buddha_ | 2008-08-08 15:30:01 +0200 (Fri, 08 Aug 2008) | 9 lines Added basic moving using keyboard (Only works in Operation Stealth at the moment): - Should make it possible to complete the first arcade sequence legitimately Renamed input variables (Their names were mixed up between Future Wars and Operation Stealth): - Future Wars's inputVar1 -> egoMovedWithKeyboard - Future Wars's inputVar2 -> xMoveKeyb - Future Wars's inputVar3 -> yMoveKeyb - Operation Stealth's inputVar0 -> xMoveKeyb - Operation Stealth's inputVar1 -> yMoveKeyb ........ r33700 | buddha_ | 2008-08-08 16:46:19 +0200 (Fri, 08 Aug 2008) | 1 line Partially fix Adlib volume setting in Cine (Now uses music volume for Adlib volume, previously always played with full volume. Doesn't differentiate between playing sound effects and music!). ........ r33703 | buddha_ | 2008-08-08 20:28:13 +0200 (Fri, 08 Aug 2008) | 4 lines Added detection entry for the Sony published CD version of Future Wars. Also added decrypting of the crypted AUTO00.PRC for this particular version. Now this version should work but no CD audio support for it yet though. ........ r33708 | buddha_ | 2008-08-09 12:44:12 +0200 (Sat, 09 Aug 2008) | 1 line Small cleanup: Renamed rol to rolByte and made it handle all cases. ........ r33710 | buddha_ | 2008-08-09 12:52:48 +0200 (Sat, 09 Aug 2008) | 1 line Removing moving with keys qweasdzxc for now because they messed with savegame name typing. One can move with the cursor keys anyway. ........ r33712 | buddha_ | 2008-08-09 17:17:32 +0200 (Sat, 09 Aug 2008) | 1 line Added updating of global variable var5 to Operation Stealth's renderOverlay function's type 20 overlay case (Previously var5 wasn't updated anywhere!). Also added a lower bound for var5's value into a comparison (Previously only the upper bound was tested for). ........ r33713 | buddha_ | 2008-08-09 18:07:08 +0200 (Sat, 09 Aug 2008) | 1 line Added preliminary version of drawing type 22 overlays (Such overlays are added with opcode 0xA4 (o2_loadMask22) and removed with opcode 0xA5 (o2_unloadMask22)). Things might be wrong so needs testing! WIP! ........ r33714 | knakos | 2008-08-09 20:09:24 +0200 (Sat, 09 Aug 2008) | 1 line fix MR on ce: allocate large buffer on the heap instead and of the stack, and improve the workaround ........ r33716 | knakos | 2008-08-09 20:12:43 +0200 (Sat, 09 Aug 2008) | 1 line hotfix around drascula mem leak problems. see also bug report ........ r33719 | dhewg | 2008-08-09 20:37:18 +0200 (Sat, 09 Aug 2008) | 1 line Updates to the recent OSystem API changes ........ r33721 | buddha_ | 2008-08-09 21:47:05 +0200 (Sat, 09 Aug 2008) | 7 lines Made drawPlainBox's effective width and height always at least one. - Makes oxygen gauge during first arcade sequence visible as it gave drawPlainBox a height of zero. Made type 21 overlays be drawn as type 22 (Filled rectangle). - For an example the oxygen gauge during the first arcade sequence is a type 21 overlay. Flipped type 21 & 22 overlays as it looks correct for the oxygen gauge. These features are quite WIP, they need testing to see if they're correct. ........ r33722 | buddha_ | 2008-08-09 21:57:46 +0200 (Sat, 09 Aug 2008) | 1 line Made type 21 & 22 overlays not be flipped (The oxygen gauge looks actually better when it reaches zero this way although in its fully charged state it still does look a bit off. Disassembly seems to agree with not flipping the overlays so I'm going with this one for now). ........ r33723 | dhewg | 2008-08-09 22:02:56 +0200 (Sat, 09 Aug 2008) | 3 lines Updated the Makefile to the new build system. Introduced a Makefile variable to build a gamecube version. ........ r33725 | buddha_ | 2008-08-09 22:50:10 +0200 (Sat, 09 Aug 2008) | 1 line Converted objectTable from a plain array to a Common::Array. Should help to catch out of bounds access errors that may cause memory corruption. ........ r33726 | buddha_ | 2008-08-09 22:55:01 +0200 (Sat, 09 Aug 2008) | 1 line Converted animDataTable from a plain array to a Common::Array. Should help to catch out of bounds access errors which may cause memory corruption. ........ r33727 | buddha_ | 2008-08-10 00:38:03 +0200 (Sun, 10 Aug 2008) | 1 line Converted zoneData and zoneQuery tables from plain array types to Common::Array. Should help catch out of bounds access errors that may cause memory corruption. ........ r33729 | fingolfin | 2008-08-10 00:42:03 +0200 (Sun, 10 Aug 2008) | 1 line If no default config file is present, just don't load it, instead of crashing ........ r33730 | fingolfin | 2008-08-10 01:07:32 +0200 (Sun, 10 Aug 2008) | 1 line Use FSNode API in default OSystem::openConfigFileForReading & OSystem::openConfigFileForWriting method implementations ........ r33733 | lordhoto | 2008-08-10 02:17:56 +0200 (Sun, 10 Aug 2008) | 2 lines Fixed crash in KyraEngine_HoF::pauseEngineIntern. ........ r33736 | lordhoto | 2008-08-10 02:36:46 +0200 (Sun, 10 Aug 2008) | 2 lines Fixed kyra to support properly support restarting of engine (for GSoC RTL, based on a patch from Chris Page). ........ r33742 | lordhoto | 2008-08-10 03:28:00 +0200 (Sun, 10 Aug 2008) | 2 lines Added fallback to text only mode when voice files are not found. ........ r33754 | knakos | 2008-08-10 19:10:09 +0200 (Sun, 10 Aug 2008) | 1 line add support for drascula engine ........ r33756 | knakos | 2008-08-10 19:13:24 +0200 (Sun, 10 Aug 2008) | 1 line hint the backend to show the VK ........ r33758 | knakos | 2008-08-10 19:15:30 +0200 (Sun, 10 Aug 2008) | 1 line address the ignored events and bad inventory screen handling 'features' ........ r33761 | sev | 2008-08-10 19:35:42 +0200 (Sun, 10 Aug 2008) | 2 lines Add checksums for ScummVM repacked Italian and Spanish versions. ........ r33763 | eriktorbjorn | 2008-08-10 19:59:42 +0200 (Sun, 10 Aug 2008) | 5 lines Committed my patch #2040074 ("XMIDI callback control events"). At the moment, I'm not aware of any game that actually uses this XMIDI feature, so its primary function right now is to silence lots of warnings while running the DOS version of Simon the Sorcerer 2. ........ r33766 | eriktorbjorn | 2008-08-10 20:44:00 +0200 (Sun, 10 Aug 2008) | 5 lines Fixed a bunch of Valgrind warnings (mostly uninitialised variables, but also an invalid free()), so that I can start and quit the game without any unexpected warnings. (The obvious next step, of course, would be to actually *play* the game for a bit...) ........ r33777 | athrxx | 2008-08-11 16:47:50 +0200 (Mon, 11 Aug 2008) | 2 lines LOL: add support for floppy installer files (startup will fail nonethelesse since we have different pak file names) ........ r33781 | buddha_ | 2008-08-11 22:09:03 +0200 (Mon, 11 Aug 2008) | 1 line Changed readBundleFile to unpack data in-place and added debugging messages to the function. ........ r33782 | buddha_ | 2008-08-11 22:18:33 +0200 (Mon, 11 Aug 2008) | 1 line Added a safeguard to readBundleFile so it shouldn't corrupt memory even if the input says the data's unpacked size is less than its packed size (This shouldn't ever happen with non-corrupted data). ........ r33783 | buddha_ | 2008-08-11 22:41:13 +0200 (Mon, 11 Aug 2008) | 1 line Changed partBuffer from a pointer to a Common::Array. Removed numElementInPart variable as it's now equivalent with partBuffer.size(). ........ r33784 | buddha_ | 2008-08-11 23:26:41 +0200 (Mon, 11 Aug 2008) | 1 line Removed textDataPtr pointer as it's not used beyond the loadTextData function. Reworked loadTextData a bit so there are no two loops for the same thing (Also renamed some of the local variables). ........ r33785 | buddha_ | 2008-08-11 23:45:47 +0200 (Mon, 11 Aug 2008) | 1 line Changed palPtr from a pointer to a Common::Array named palArray. Removed palEntriesCount variable as it's now equivalent to palArray.size(). ........ r33786 | buddha_ | 2008-08-12 00:26:25 +0200 (Tue, 12 Aug 2008) | 1 line Moved fontParamTable inside TextHandler struct and made it a constant size as that's what it is (No need for using malloc & free anymore). Previously we would've tried to free an array that wasn't heap-allocated in freePoldatDat (Freeing fontParamTable_standard or fontParamTable_alt), that's fixed. ........ r33787 | dhewg | 2008-08-12 00:43:00 +0200 (Tue, 12 Aug 2008) | 7 lines video mode polishing: * proper fullscreen video mode * multiple graphic modes with different overscan values * "fullscreen mode" stretches the picture on 16:9 displays * fixed broken sword 1/2 gfx garbage * support for setShakePos() ........ r33788 | dhewg | 2008-08-12 00:44:29 +0200 (Tue, 12 Aug 2008) | 1 line build a wii binary per default ........ r33790 | buddha_ | 2008-08-12 01:01:32 +0200 (Tue, 12 Aug 2008) | 1 line Implemented drawMessage changes for Operation Stealth's timed cutscenes (Negative colors are used for timed text boxes that are totally transparent, only the text is drawn). ........ r33792 | buddha_ | 2008-08-12 01:20:10 +0200 (Tue, 12 Aug 2008) | 1 line Made Operation Stealth's action failure messages use a background color set by the opcode 0x49 'o1_setDefaultMenuBgColor'. Should fix the 'text hard to read' problems. ........ r33793 | buddha_ | 2008-08-12 02:13:27 +0200 (Tue, 12 Aug 2008) | 1 line Changed commandBuffer from a char[80] to Common::String and made FWRenderer::setCommand use a Common::String. Hopefully this might help with the command buffer overflow stuff, although this isn't a fix for the problem behind it, just a bandaid. ........ r33795 | buddha_ | 2008-08-12 16:44:44 +0200 (Tue, 12 Aug 2008) | 1 line Implemented Operation Stealth specific parts of processInventory and added another mouse button waiting loop into the function's end (It's in both Future Wars and Operation Stealth). Fixes inventory showing in Operation Stealth. ........ r33797 | aquadran | 2008-08-12 16:52:44 +0200 (Tue, 12 Aug 2008) | 1 line added few ignores for build dirs ........ r33805 | buddha_ | 2008-08-12 21:33:17 +0200 (Tue, 12 Aug 2008) | 1 line Implemented Operation Stealth's makeCommandLine. ........ r33807 | buddha_ | 2008-08-12 22:27:49 +0200 (Tue, 12 Aug 2008) | 1 line Tiny comment fix. ........ r33808 | buddha_ | 2008-08-12 22:58:26 +0200 (Tue, 12 Aug 2008) | 1 line Fix for GCC warning in OSRenderer::renderOverlay: declaration of 'len' shadows a previous local. ........ r33809 | joostp | 2008-08-12 23:23:40 +0200 (Tue, 12 Aug 2008) | 2 lines fix typo 'baclup' -> 'backup' ........ r33810 | buddha_ | 2008-08-13 00:45:38 +0200 (Wed, 13 Aug 2008) | 1 line Added possibility to get the read resource's size from readBundleFile. Made loadMsg handle input data that has empty strings residing just beyond the input buffer (Thanks Valgrind :-)). ........ r33811 | buddha_ | 2008-08-13 01:44:39 +0200 (Wed, 13 Aug 2008) | 1 line Fixed drawPlainBox's boundary checking (It wrote outside the screen occasionally). Now using the Common::Rect for clipping, yay! It's good. ........ r33812 | buddha_ | 2008-08-13 01:56:13 +0200 (Wed, 13 Aug 2008) | 1 line Hopefully fixes 'Conditional jump or move depends on uninitialised value(s)' Valgrind warning at sound.cpp:611. ........ r33815 | buddha_ | 2008-08-13 03:02:00 +0200 (Wed, 13 Aug 2008) | 1 line Changed Agi::SoundMgr's sound buffer to a member array of size BUFFER_SIZE. Also added initialization of _playing to false in SoundMgr's constructor. Hopefully helps with the occasional crashes in the sound code when starting the first sound in an AGI game. ........ r33816 | buddha_ | 2008-08-13 03:10:03 +0200 (Wed, 13 Aug 2008) | 1 line Shutting up Valgrind about using uninitialised values from array _chn in function stopNote. ........ r33817 | fingolfin | 2008-08-13 12:13:22 +0200 (Wed, 13 Aug 2008) | 1 line Clarify SCUMM MD5 message: We do not want reports on fanmade translations ........ r33819 | buddha_ | 2008-08-13 13:36:45 +0200 (Wed, 13 Aug 2008) | 1 line Reverted r33815 (But not r33816). ........ r33822 | buddha_ | 2008-08-13 13:57:48 +0200 (Wed, 13 Aug 2008) | 1 line Fixed initialization of some SoundMgr-class's member variables. Moved _sndBuffer's allocation to SoundMgr's constructor and its deallocation to the destructor. Made fillAudio SoundMgr's method and removed a superfluous global static variable 'int16 *buffer'. Should help with the occasional crashes when starting the first sound in an AGI game. ........ r33826 | buddha_ | 2008-08-13 15:40:28 +0200 (Wed, 13 Aug 2008) | 1 line Type 21 overlay comment update (Found the drawing routine in the disassembly and checked the original for how the oxygen gauge during the first arcade sequence looks like. They're some kind of sprites most likely and not just simply filled rectangles). ........ r33829 | knakos | 2008-08-13 17:16:38 +0200 (Wed, 13 Aug 2008) | 1 line fix bug #2038992 by saving and restoring channel volumes ........ r33837 | lordhoto | 2008-08-13 21:10:31 +0200 (Wed, 13 Aug 2008) | 2 lines Added detection entries for kyra3 Mac. ........ r33839 | knakos | 2008-08-13 21:13:53 +0200 (Wed, 13 Aug 2008) | 1 line fix bug #1910057: FT multifunction ........ r33844 | knakos | 2008-08-13 21:32:25 +0200 (Wed, 13 Aug 2008) | 1 line fix a small bug in the quit dialog ........ r33847 | fingolfin | 2008-08-13 22:37:54 +0200 (Wed, 13 Aug 2008) | 1 line cleanup ........ r33858 | peres001 | 2008-08-14 09:10:42 +0200 (Thu, 14 Aug 2008) | 1 line Removed cross-references between the general parser and the text formatter. To achieve this, I have rewritten the latter for both NS and BRA. ........ r33859 | peres001 | 2008-08-14 09:14:34 +0200 (Thu, 14 Aug 2008) | 1 line Finally moved parseNextToken to Script, where it belongs! ........ r33860 | peres001 | 2008-08-14 12:04:43 +0200 (Thu, 14 Aug 2008) | 1 line Cleanup. ........ r33861 | peres001 | 2008-08-14 12:24:39 +0200 (Thu, 14 Aug 2008) | 1 line More cleanup. ........ r33864 | peres001 | 2008-08-14 15:45:32 +0200 (Thu, 14 Aug 2008) | 1 line Some variable renamed to make more sense. ........ r33871 | buddha_ | 2008-08-14 22:18:13 +0200 (Thu, 14 Aug 2008) | 1 line Added debug showing of the collision page when pressing the Alt key. Alt isn't used for anything else so one might as well use it for this. ........ r33872 | buddha_ | 2008-08-14 22:49:34 +0200 (Thu, 14 Aug 2008) | 1 line Fix for bugging moving at the bottom of the ocean when trying to free the girl from the ropes and swimming to the surface. Some global variables related to mouse position weren't being updated in executePlayerInput, now they are and things seem to work. Also enables moving in the labyrinth arcade sequence at the palace. ........ r33873 | athrxx | 2008-08-14 23:21:04 +0200 (Thu, 14 Aug 2008) | 1 line - HOF: another Italian fan translation ........ r33875 | athrxx | 2008-08-14 23:34:29 +0200 (Thu, 14 Aug 2008) | 1 line - HOF: forgot french and german entries in last commit ........ r33877 | buddha_ | 2008-08-15 00:01:56 +0200 (Fri, 15 Aug 2008) | 1 line Moved showing of the collision page from Alt-key to F11-key because Alt conflicted with taking screenshots using Alt-s. Great. Hopefully F11 doesn't conflict with anything useful. ........ r33878 | lordhoto | 2008-08-15 00:09:36 +0200 (Fri, 15 Aug 2008) | 2 lines Improved version of my resource loading patch from -devel (check also r33876). ........ r33879 | lordhoto | 2008-08-15 00:11:56 +0200 (Fri, 15 Aug 2008) | 2 lines Formatting. ........ r33886 | athrxx | 2008-08-15 01:46:37 +0200 (Fri, 15 Aug 2008) | 1 line lol: new detection entry (german floppy extracted) ........ r33889 | peres001 | 2008-08-15 04:52:42 +0200 (Fri, 15 Aug 2008) | 2 lines Simplified handling of script variables (especially locals). ........ r33890 | peres001 | 2008-08-15 05:36:01 +0200 (Fri, 15 Aug 2008) | 1 line Disabled lip syncing code in BRA, since I couldn't find any scripts actually using it. Some warnings have been added as a sentinel. ........ r33891 | peres001 | 2008-08-15 05:59:45 +0200 (Fri, 15 Aug 2008) | 1 line Made scripts access Animation fields via accessors and mutators, instead of using raw pointers. ........ r33892 | peres001 | 2008-08-15 06:30:45 +0200 (Fri, 15 Aug 2008) | 1 line Made coordinates and frame number protected into Zone and Animation, and changed client code to use get/set. This will allow various simplifications (e.g. when calculating Z), and is a step towards correct handling of interactive zones of Zone/Animation in BRA. ........ r33894 | peres001 | 2008-08-15 10:44:41 +0200 (Fri, 15 Aug 2008) | 1 line Updated layer calculation: animations are now hidden properly by background elements (but not items yet). ........ r33896 | drmccoy | 2008-08-15 12:47:42 +0200 (Fri, 15 Aug 2008) | 2 lines Fixing a segfault in the Bargon Attack menu ........ r33900 | peres001 | 2008-08-15 16:25:43 +0200 (Fri, 15 Aug 2008) | 1 line Added routines to load and handle item masks: animation are now correctly hidden when they are behind any object. The masks of items that are not explicitly activated (even if visible) still are handled (e.g. the crown in the museum is not visible in the foreground). ........ r33902 | anotherguest | 2008-08-15 16:38:25 +0200 (Fri, 15 Aug 2008) | 2 lines UpdUpdated actions and Readme for Symbian OS port! ........ r33903 | peres001 | 2008-08-15 17:08:08 +0200 (Fri, 15 Aug 2008) | 1 line Implemented raster operation for masks and postponed blitting of zones after everything in the location has been loaded. This fixes the remaining problems with animations not being masked by items. ........ r33919 | fingolfin | 2008-08-16 00:06:15 +0200 (Sat, 16 Aug 2008) | 1 line SCUMM: Made some potentially ambiguous (to the reader, at least) checks slightly less ambiguous ........ svn-id: r33920
918 lines
27 KiB
C++
918 lines
27 KiB
C++
/* ScummVM - Graphic Adventure Engine
|
|
*
|
|
* ScummVM is the legal property of its developers, whose names
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
* file distributed with this source distribution.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*
|
|
* $URL$
|
|
* $Id$
|
|
*/
|
|
|
|
#include "engines/metaengine.h"
|
|
#include "base/version.h"
|
|
|
|
#include "common/config-manager.h"
|
|
#include "common/events.h"
|
|
#include "common/fs.h"
|
|
#include "common/util.h"
|
|
#include "common/system.h"
|
|
|
|
#include "gui/about.h"
|
|
#include "gui/browser.h"
|
|
#include "gui/chooser.h"
|
|
#include "gui/launcher.h"
|
|
#include "gui/massadd.h"
|
|
#include "gui/message.h"
|
|
#include "gui/newgui.h"
|
|
#include "gui/options.h"
|
|
#include "gui/EditTextWidget.h"
|
|
#include "gui/ListWidget.h"
|
|
#include "gui/TabWidget.h"
|
|
#include "gui/PopUpWidget.h"
|
|
#include "graphics/cursorman.h"
|
|
|
|
#include "sound/mididrv.h"
|
|
|
|
#include "gui/ThemeEval.h"
|
|
|
|
|
|
using Common::ConfigManager;
|
|
|
|
namespace GUI {
|
|
|
|
enum {
|
|
kStartCmd = 'STRT',
|
|
kAboutCmd = 'ABOU',
|
|
kOptionsCmd = 'OPTN',
|
|
kAddGameCmd = 'ADDG',
|
|
kEditGameCmd = 'EDTG',
|
|
kRemoveGameCmd = 'REMG',
|
|
kQuitCmd = 'QUIT',
|
|
|
|
|
|
kCmdGlobalGraphicsOverride = 'OGFX',
|
|
kCmdGlobalAudioOverride = 'OSFX',
|
|
kCmdGlobalMIDIOverride = 'OMID',
|
|
kCmdGlobalVolumeOverride = 'OVOL',
|
|
|
|
kCmdChooseSoundFontCmd = 'chsf',
|
|
|
|
kCmdExtraBrowser = 'PEXT',
|
|
kCmdGameBrowser = 'PGME',
|
|
kCmdSaveBrowser = 'PSAV'
|
|
};
|
|
|
|
/*
|
|
* TODO: Clean up this ugly design: we subclass EditTextWidget to perform
|
|
* input validation. It would be much more elegant to use a decorator pattern,
|
|
* or a validation callback, or something like that.
|
|
*/
|
|
class DomainEditTextWidget : public EditTextWidget {
|
|
public:
|
|
DomainEditTextWidget(GuiObject *boss, const String &name, const String &text)
|
|
: EditTextWidget(boss, name, text) {
|
|
}
|
|
|
|
protected:
|
|
bool tryInsertChar(byte c, int pos) {
|
|
if (isalnum(c) || c == '-' || c == '_') {
|
|
_editString.insertChar(c, pos);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
};
|
|
|
|
/*
|
|
* A dialog that allows the user to edit a config game entry.
|
|
* TODO: add widgets for some/all of the following
|
|
* - Maybe scaler/graphics mode. But there are two problems:
|
|
* 1) Different backends can have different scalers with different names,
|
|
* so we first have to add a way to query those... no Ender, I don't
|
|
* think a bitmasked property() value is nice for this, because we would
|
|
* have to add to the bitmask values whenever a backends adds a new scaler).
|
|
* 2) At the time the launcher is running, the GFX backend is already setup.
|
|
* So when a game is run via the launcher, the custom scaler setting for it won't be
|
|
* used. So we'd also have to add an API to change the scaler during runtime
|
|
* (the SDL backend can already do that based on user input, but there is no API
|
|
* to achieve it)
|
|
* If the APIs for 1&2 are in place, we can think about adding this to the Edit&Option dialogs
|
|
*/
|
|
|
|
class EditGameDialog : public OptionsDialog {
|
|
typedef Common::String String;
|
|
typedef Common::StringList StringList;
|
|
public:
|
|
EditGameDialog(const String &domain, const String &desc);
|
|
|
|
virtual void reflowLayout();
|
|
|
|
void open();
|
|
void close();
|
|
virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
|
|
|
|
protected:
|
|
EditTextWidget *_descriptionWidget;
|
|
DomainEditTextWidget *_domainWidget;
|
|
|
|
StaticTextWidget *_gamePathWidget;
|
|
StaticTextWidget *_extraPathWidget;
|
|
StaticTextWidget *_savePathWidget;
|
|
|
|
PopUpWidget *_langPopUp;
|
|
PopUpWidget *_platformPopUp;
|
|
|
|
CheckboxWidget *_globalGraphicsOverride;
|
|
CheckboxWidget *_globalAudioOverride;
|
|
CheckboxWidget *_globalMIDIOverride;
|
|
CheckboxWidget *_globalVolumeOverride;
|
|
};
|
|
|
|
EditGameDialog::EditGameDialog(const String &domain, const String &desc)
|
|
: OptionsDialog(domain, "GameOptions") {
|
|
|
|
int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
|
|
|
|
// GAME: Path to game data (r/o), extra data (r/o), and save data (r/w)
|
|
String gamePath(ConfMan.get("path", _domain));
|
|
String extraPath(ConfMan.get("extrapath", _domain));
|
|
String savePath(ConfMan.get("savepath", _domain));
|
|
|
|
// GAME: Determine the description string
|
|
String description(ConfMan.get("description", domain));
|
|
if (description.empty() && !desc.empty()) {
|
|
description = desc;
|
|
}
|
|
|
|
// GUI: Add tab widget
|
|
TabWidget *tab = new TabWidget(this, "GameOptions.TabWidget");
|
|
|
|
//
|
|
// 1) The game tab
|
|
//
|
|
tab->addTab("Game");
|
|
|
|
// GUI: Label & edit widget for the game ID
|
|
new StaticTextWidget(tab, "GameOptions_Game.Id", "ID:");
|
|
_domainWidget = new DomainEditTextWidget(tab, "GameOptions_Game.Domain", _domain);
|
|
|
|
// GUI: Label & edit widget for the description
|
|
new StaticTextWidget(tab, "GameOptions_Game.Name", "Name:");
|
|
_descriptionWidget = new EditTextWidget(tab, "GameOptions_Game.Desc", description);
|
|
|
|
// Language popup
|
|
_langPopUp = new PopUpWidget(tab, "GameOptions_Game.Lang", "Language:", labelWidth);
|
|
_langPopUp->appendEntry("<default>");
|
|
_langPopUp->appendEntry("");
|
|
const Common::LanguageDescription *l = Common::g_languages;
|
|
for (; l->code; ++l) {
|
|
_langPopUp->appendEntry(l->description, l->id);
|
|
}
|
|
|
|
// Platform popup
|
|
_platformPopUp = new PopUpWidget(tab, "GameOptions_Game.Platform", "Platform:", labelWidth);
|
|
_platformPopUp->appendEntry("<default>");
|
|
_platformPopUp->appendEntry("");
|
|
const Common::PlatformDescription *p = Common::g_platforms;
|
|
for (; p->code; ++p) {
|
|
_platformPopUp->appendEntry(p->description, p->id);
|
|
}
|
|
|
|
//
|
|
// 3) The graphics tab
|
|
//
|
|
_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? "Graphics" : "GFX");
|
|
|
|
_globalGraphicsOverride = new CheckboxWidget(tab, "GameOptions_Graphics.EnableTabCheckbox", "Override global graphic settings", kCmdGlobalGraphicsOverride, 0);
|
|
|
|
addGraphicControls(tab, "GameOptions_Graphics.");
|
|
|
|
//
|
|
// 4) The audio tab
|
|
//
|
|
tab->addTab("Audio");
|
|
|
|
_globalAudioOverride = new CheckboxWidget(tab, "GameOptions_Audio.EnableTabCheckbox", "Override global audio settings", kCmdGlobalAudioOverride, 0);
|
|
|
|
addAudioControls(tab, "GameOptions_Audio.");
|
|
addSubtitleControls(tab, "GameOptions_Audio.");
|
|
|
|
//
|
|
// 5) The volume tab
|
|
//
|
|
tab->addTab("Volume");
|
|
|
|
_globalVolumeOverride = new CheckboxWidget(tab, "GameOptions_Volume.EnableTabCheckbox", "Override global volume settings", kCmdGlobalVolumeOverride, 0);
|
|
|
|
addVolumeControls(tab, "GameOptions_Volume.");
|
|
|
|
//
|
|
// 6) The MIDI tab
|
|
//
|
|
tab->addTab("MIDI");
|
|
|
|
_globalMIDIOverride = new CheckboxWidget(tab, "GameOptions_MIDI.EnableTabCheckbox", "Override global MIDI settings", kCmdGlobalMIDIOverride, 0);
|
|
|
|
addMIDIControls(tab, "GameOptions_MIDI.");
|
|
|
|
//
|
|
// 2) The 'Path' tab
|
|
//
|
|
tab->addTab("Paths");
|
|
|
|
// These buttons have to be extra wide, or the text will be truncated
|
|
// in the small version of the GUI.
|
|
|
|
// GUI: Button + Label for the game path
|
|
new ButtonWidget(tab, "GameOptions_Paths.Gamepath", "Game Path:", kCmdGameBrowser, 0);
|
|
_gamePathWidget = new StaticTextWidget(tab, "GameOptions_Paths.GamepathText", gamePath);
|
|
|
|
// GUI: Button + Label for the additional path
|
|
new ButtonWidget(tab, "GameOptions_Paths.Extrapath", "Extra Path:", kCmdExtraBrowser, 0);
|
|
_extraPathWidget = new StaticTextWidget(tab, "GameOptions_Paths.ExtrapathText", extraPath);
|
|
if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) {
|
|
_extraPathWidget->setLabel("None");
|
|
}
|
|
|
|
// GUI: Button + Label for the save path
|
|
new ButtonWidget(tab, "GameOptions_Paths.Savepath", "Save Path:", kCmdSaveBrowser, 0);
|
|
_savePathWidget = new StaticTextWidget(tab, "GameOptions_Paths.SavepathText", savePath);
|
|
if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) {
|
|
_savePathWidget->setLabel("Default");
|
|
}
|
|
|
|
// Activate the first tab
|
|
tab->setActiveTab(0);
|
|
_tabWidget = tab;
|
|
|
|
// Add OK & Cancel buttons
|
|
new ButtonWidget(this, "GameOptions.Cancel", "Cancel", kCloseCmd, 0);
|
|
new ButtonWidget(this, "GameOptions.Ok", "OK", kOKCmd, 0);
|
|
}
|
|
|
|
void EditGameDialog::reflowLayout() {
|
|
OptionsDialog::reflowLayout();
|
|
|
|
int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
|
|
|
|
if (_langPopUp)
|
|
_langPopUp->changeLabelWidth(labelWidth);
|
|
if (_platformPopUp)
|
|
_platformPopUp->changeLabelWidth(labelWidth);
|
|
}
|
|
|
|
void EditGameDialog::open() {
|
|
OptionsDialog::open();
|
|
|
|
int sel, i;
|
|
bool e;
|
|
|
|
// En-/disable dialog items depending on whether overrides are active or not.
|
|
|
|
e = ConfMan.hasKey("gfx_mode", _domain) ||
|
|
ConfMan.hasKey("render_mode", _domain) ||
|
|
ConfMan.hasKey("fullscreen", _domain) ||
|
|
ConfMan.hasKey("aspect_ratio", _domain);
|
|
_globalGraphicsOverride->setState(e);
|
|
|
|
e = ConfMan.hasKey("music_driver", _domain) ||
|
|
ConfMan.hasKey("output_rate", _domain) ||
|
|
ConfMan.hasKey("subtitles", _domain) ||
|
|
ConfMan.hasKey("talkspeed", _domain);
|
|
_globalAudioOverride->setState(e);
|
|
|
|
e = ConfMan.hasKey("music_volume", _domain) ||
|
|
ConfMan.hasKey("sfx_volume", _domain) ||
|
|
ConfMan.hasKey("speech_volume", _domain);
|
|
_globalVolumeOverride->setState(e);
|
|
|
|
e = ConfMan.hasKey("soundfont", _domain) ||
|
|
ConfMan.hasKey("multi_midi", _domain) ||
|
|
ConfMan.hasKey("native_mt32", _domain) ||
|
|
ConfMan.hasKey("enable_gs", _domain) ||
|
|
ConfMan.hasKey("midi_gain", _domain);
|
|
_globalMIDIOverride->setState(e);
|
|
|
|
// TODO: game path
|
|
|
|
const Common::LanguageDescription *l = Common::g_languages;
|
|
const Common::Language lang = Common::parseLanguage(ConfMan.get("language", _domain));
|
|
|
|
sel = 0;
|
|
if (ConfMan.hasKey("language", _domain)) {
|
|
for (i = 0; l->code; ++l, ++i) {
|
|
if (lang == l->id)
|
|
sel = i + 2;
|
|
}
|
|
}
|
|
_langPopUp->setSelected(sel);
|
|
|
|
|
|
const Common::PlatformDescription *p = Common::g_platforms;
|
|
const Common::Platform platform = Common::parsePlatform(ConfMan.get("platform", _domain));
|
|
sel = 0;
|
|
for (i = 0; p->code; ++p, ++i) {
|
|
if (platform == p->id)
|
|
sel = i + 2;
|
|
}
|
|
_platformPopUp->setSelected(sel);
|
|
}
|
|
|
|
|
|
void EditGameDialog::close() {
|
|
if (getResult()) {
|
|
ConfMan.set("description", _descriptionWidget->getEditString(), _domain);
|
|
|
|
Common::Language lang = (Common::Language)_langPopUp->getSelectedTag();
|
|
if (lang < 0)
|
|
ConfMan.removeKey("language", _domain);
|
|
else
|
|
ConfMan.set("language", Common::getLanguageCode(lang), _domain);
|
|
|
|
String gamePath(_gamePathWidget->getLabel());
|
|
if (!gamePath.empty())
|
|
ConfMan.set("path", gamePath, _domain);
|
|
|
|
String extraPath(_extraPathWidget->getLabel());
|
|
if (!extraPath.empty() && (extraPath != "None"))
|
|
ConfMan.set("extrapath", extraPath, _domain);
|
|
|
|
String savePath(_savePathWidget->getLabel());
|
|
if (!savePath.empty() && (savePath != "Default"))
|
|
ConfMan.set("savepath", savePath, _domain);
|
|
|
|
Common::Platform platform = (Common::Platform)_platformPopUp->getSelectedTag();
|
|
if (platform < 0)
|
|
ConfMan.removeKey("platform", _domain);
|
|
else
|
|
ConfMan.set("platform", Common::getPlatformCode(platform), _domain);
|
|
}
|
|
OptionsDialog::close();
|
|
}
|
|
|
|
void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
|
|
switch (cmd) {
|
|
case kCmdGlobalGraphicsOverride:
|
|
setGraphicSettingsState(data != 0);
|
|
draw();
|
|
break;
|
|
case kCmdGlobalAudioOverride:
|
|
setAudioSettingsState(data != 0);
|
|
setSubtitleSettingsState(data != 0);
|
|
if (_globalVolumeOverride == NULL)
|
|
setVolumeSettingsState(data != 0);
|
|
draw();
|
|
break;
|
|
case kCmdGlobalMIDIOverride:
|
|
setMIDISettingsState(data != 0);
|
|
draw();
|
|
break;
|
|
case kCmdGlobalVolumeOverride:
|
|
setVolumeSettingsState(data != 0);
|
|
draw();
|
|
break;
|
|
case kCmdChooseSoundFontCmd: {
|
|
BrowserDialog browser("Select SoundFont", false);
|
|
|
|
if (browser.runModal() > 0) {
|
|
// User made this choice...
|
|
FilesystemNode file(browser.getResult());
|
|
_soundFont->setLabel(file.getPath());
|
|
|
|
if (!file.getPath().empty() && (file.getPath() != "None"))
|
|
_soundFontClearButton->setEnabled(true);
|
|
else
|
|
_soundFontClearButton->setEnabled(false);
|
|
|
|
draw();
|
|
}
|
|
break;
|
|
}
|
|
|
|
// Change path for the game
|
|
case kCmdGameBrowser: {
|
|
BrowserDialog browser("Select directory with game data", true);
|
|
if (browser.runModal() > 0) {
|
|
// User made his choice...
|
|
FilesystemNode dir(browser.getResult());
|
|
|
|
// TODO: Verify the game can be found in the new directory... Best
|
|
// done with optional specific gameid to pluginmgr detectgames?
|
|
// FSList files = dir.listDir(FilesystemNode::kListFilesOnly);
|
|
|
|
_gamePathWidget->setLabel(dir.getPath());
|
|
draw();
|
|
}
|
|
draw();
|
|
break;
|
|
}
|
|
|
|
// Change path for extra game data (eg, using sword cutscenes when playing via CD)
|
|
case kCmdExtraBrowser: {
|
|
BrowserDialog browser("Select additional game directory", true);
|
|
if (browser.runModal() > 0) {
|
|
// User made his choice...
|
|
FilesystemNode dir(browser.getResult());
|
|
_extraPathWidget->setLabel(dir.getPath());
|
|
draw();
|
|
}
|
|
draw();
|
|
break;
|
|
}
|
|
// Change path for stored save game (perm and temp) data
|
|
case kCmdSaveBrowser: {
|
|
BrowserDialog browser("Select directory for saved games", true);
|
|
if (browser.runModal() > 0) {
|
|
// User made his choice...
|
|
FilesystemNode dir(browser.getResult());
|
|
_savePathWidget->setLabel(dir.getPath());
|
|
draw();
|
|
}
|
|
draw();
|
|
break;
|
|
}
|
|
|
|
case kOKCmd: {
|
|
// Write back changes made to config object
|
|
String newDomain(_domainWidget->getEditString());
|
|
if (newDomain != _domain) {
|
|
if (newDomain.empty()
|
|
|| newDomain.hasPrefix("_")
|
|
|| newDomain == ConfigManager::kApplicationDomain
|
|
|| ConfMan.hasGameDomain(newDomain)) {
|
|
MessageDialog alert("This game ID is already taken. Please choose another one.");
|
|
alert.runModal();
|
|
return;
|
|
}
|
|
ConfMan.renameGameDomain(_domain, newDomain);
|
|
_domain = newDomain;
|
|
}
|
|
}
|
|
// FALL THROUGH to default case
|
|
default:
|
|
OptionsDialog::handleCommand(sender, cmd, data);
|
|
}
|
|
}
|
|
|
|
|
|
#pragma mark -
|
|
|
|
LauncherDialog::LauncherDialog()
|
|
: Dialog(0, 0, 320, 200) {
|
|
_backgroundType = GUI::Theme::kDialogBackgroundMain;
|
|
|
|
const int screenW = g_system->getOverlayWidth();
|
|
const int screenH = g_system->getOverlayHeight();
|
|
|
|
_w = screenW;
|
|
_h = screenH;
|
|
|
|
#ifndef DISABLE_FANCY_THEMES
|
|
_logo = 0;
|
|
if (g_gui.xmlEval()->getVar("Globals.ShowLauncherLogo") == 1 && g_gui.theme()->supportsImages()) {
|
|
_logo = new GraphicsWidget(this, "Launcher.Logo");
|
|
_logo->useThemeTransparency(true);
|
|
_logo->setGfx(g_gui.theme()->getImageSurface(Theme::kImageLogo));
|
|
|
|
new StaticTextWidget(this, "Launcher.Version", gScummVMVersionDate);
|
|
} else
|
|
new StaticTextWidget(this, "Launcher.Version", gScummVMFullVersion);
|
|
#else
|
|
// Show ScummVM version
|
|
new StaticTextWidget(this, "Launcher.Version", gScummVMFullVersion);
|
|
#endif
|
|
|
|
new ButtonWidget(this, "Launcher.QuitButton", "Quit", kQuitCmd, 'Q');
|
|
new ButtonWidget(this, "Launcher.AboutButton", "About", kAboutCmd, 'B');
|
|
new ButtonWidget(this, "Launcher.OptionsButton", "Options", kOptionsCmd, 'O');
|
|
_startButton =
|
|
new ButtonWidget(this, "Launcher.StartButton", "Start", kStartCmd, 'S');
|
|
|
|
// Above the lowest button rows: two more buttons (directly below the list box)
|
|
_addButton =
|
|
new ButtonWidget(this, "Launcher.AddGameButton", "Add Game...", kAddGameCmd, 'A');
|
|
_editButton =
|
|
new ButtonWidget(this, "Launcher.EditGameButton", "Edit Game...", kEditGameCmd, 'E');
|
|
_removeButton =
|
|
new ButtonWidget(this, "Launcher.RemoveGameButton", "Remove Game", kRemoveGameCmd, 'R');
|
|
|
|
|
|
// Add list with game titles
|
|
_list = new ListWidget(this, "Launcher.GameList");
|
|
_list->setEditable(false);
|
|
_list->setNumberingMode(kListNumberingOff);
|
|
|
|
|
|
// Populate the list
|
|
updateListing();
|
|
|
|
// Restore last selection
|
|
String last(ConfMan.get("lastselectedgame", ConfigManager::kApplicationDomain));
|
|
selectGame(last);
|
|
|
|
// En-/disable the buttons depending on the list selection
|
|
updateButtons();
|
|
|
|
// Create file browser dialog
|
|
_browser = new BrowserDialog("Select directory with game data", true);
|
|
}
|
|
|
|
void LauncherDialog::selectGame(const String &name) {
|
|
if (!name.empty()) {
|
|
int itemToSelect = 0;
|
|
StringList::const_iterator iter;
|
|
for (iter = _domains.begin(); iter != _domains.end(); ++iter, ++itemToSelect) {
|
|
if (name == *iter) {
|
|
_list->setSelected(itemToSelect);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
LauncherDialog::~LauncherDialog() {
|
|
delete _browser;
|
|
}
|
|
|
|
void LauncherDialog::open() {
|
|
// Clear the active domain, in case we return to the dialog from a
|
|
// failure to launch a game. Otherwise, pressing ESC will attempt to
|
|
// re-launch the same game again.
|
|
ConfMan.setActiveDomain("");
|
|
|
|
CursorMan.popAllCursors();
|
|
Dialog::open();
|
|
|
|
updateButtons();
|
|
}
|
|
|
|
void LauncherDialog::close() {
|
|
// Save last selection
|
|
const int sel = _list->getSelected();
|
|
if (sel >= 0)
|
|
ConfMan.set("lastselectedgame", _domains[sel], ConfigManager::kApplicationDomain);
|
|
else
|
|
ConfMan.removeKey("lastselectedgame", ConfigManager::kApplicationDomain);
|
|
|
|
ConfMan.flushToDisk();
|
|
Dialog::close();
|
|
}
|
|
|
|
void LauncherDialog::updateListing() {
|
|
Common::StringList l;
|
|
|
|
// Retrieve a list of all games defined in the config file
|
|
_domains.clear();
|
|
const ConfigManager::DomainMap &domains = ConfMan.getGameDomains();
|
|
ConfigManager::DomainMap::const_iterator iter;
|
|
for (iter = domains.begin(); iter != domains.end(); ++iter) {
|
|
#ifdef __DS__
|
|
// DS port uses an extra section called 'ds'. This prevents the section from being
|
|
// detected as a game.
|
|
if (iter->_key == "ds") {
|
|
continue;
|
|
}
|
|
#endif
|
|
|
|
String gameid(iter->_value.get("gameid"));
|
|
String description(iter->_value.get("description"));
|
|
|
|
if (gameid.empty())
|
|
gameid = iter->_key;
|
|
if (description.empty()) {
|
|
GameDescriptor g = EngineMan.findGame(gameid);
|
|
if (g.contains("description"))
|
|
description = g.description();
|
|
}
|
|
|
|
if (description.empty())
|
|
description = "Unknown (target " + iter->_key + ", gameid " + gameid + ")";
|
|
|
|
if (!gameid.empty() && !description.empty()) {
|
|
// Insert the game into the launcher list
|
|
int pos = 0, size = l.size();
|
|
|
|
while (pos < size && (scumm_stricmp(description.c_str(), l[pos].c_str()) > 0))
|
|
pos++;
|
|
l.insert_at(pos, description);
|
|
_domains.insert_at(pos, iter->_key);
|
|
}
|
|
}
|
|
|
|
const int oldSel = _list->getSelected();
|
|
_list->setList(l);
|
|
if (oldSel < (int)l.size())
|
|
_list->setSelected(oldSel); // Restore the old selection
|
|
else if (oldSel != -1)
|
|
// Select the last entry if the list has been reduced
|
|
_list->setSelected(_list->getList().size() - 1);
|
|
updateButtons();
|
|
}
|
|
|
|
void LauncherDialog::addGame() {
|
|
int modifiers = g_system->getEventManager()->getModifierState();
|
|
bool massAdd = (modifiers & Common::KBD_SHIFT) != 0;
|
|
|
|
if (massAdd) {
|
|
MessageDialog alert("Do you really want to run the mass game detector? "
|
|
"This could potentially add a huge number of games.", "Yes", "No");
|
|
if (alert.runModal() == GUI::kMessageOK && _browser->runModal() > 0) {
|
|
MassAddDialog massAddDlg(_browser->getResult());
|
|
massAddDlg.runModal();
|
|
|
|
// Update the ListWidget and force a redraw
|
|
updateListing();
|
|
draw();
|
|
}
|
|
return;
|
|
}
|
|
|
|
// Allow user to add a new game to the list.
|
|
// 1) show a dir selection dialog which lets the user pick the directory
|
|
// the game data resides in.
|
|
// 2) try to auto detect which game is in the directory, if we cannot
|
|
// determine it uniquely preent a list of candidates to the user
|
|
// to pick from
|
|
// 3) Display the 'Edit' dialog for that item, letting the user specify
|
|
// an alternate description (to distinguish multiple versions of the
|
|
// game, e.g. 'Monkey German' and 'Monkey English') and set default
|
|
// options for that game.
|
|
|
|
if (_browser->runModal() > 0) {
|
|
// User made his choice...
|
|
FilesystemNode dir(_browser->getResult());
|
|
FSList files;
|
|
if (!dir.getChildren(files, FilesystemNode::kListAll)) {
|
|
error("browser returned a node that is not a directory: '%s'",
|
|
dir.getPath().c_str());
|
|
}
|
|
|
|
// ...so let's determine a list of candidates, games that
|
|
// could be contained in the specified directory.
|
|
GameList candidates(EngineMan.detectGames(files));
|
|
|
|
int idx;
|
|
if (candidates.empty()) {
|
|
// No game was found in the specified directory
|
|
MessageDialog alert("ScummVM could not find any game in the specified directory!");
|
|
alert.runModal();
|
|
idx = -1;
|
|
} else if (candidates.size() == 1) {
|
|
// Exact match
|
|
idx = 0;
|
|
} else {
|
|
// Display the candidates to the user and let her/him pick one
|
|
StringList list;
|
|
for (idx = 0; idx < (int)candidates.size(); idx++)
|
|
list.push_back(candidates[idx].description());
|
|
|
|
ChooserDialog dialog("Pick the game:");
|
|
dialog.setList(list);
|
|
idx = dialog.runModal();
|
|
}
|
|
if (0 <= idx && idx < (int)candidates.size()) {
|
|
GameDescriptor result = candidates[idx];
|
|
|
|
// TODO: Change the detectors to set "path" !
|
|
result["path"] = dir.getPath();
|
|
|
|
Common::String domain = addGameToConf(result);
|
|
|
|
// Display edit dialog for the new entry
|
|
EditGameDialog editDialog(domain, result.description());
|
|
if (editDialog.runModal() > 0) {
|
|
// User pressed OK, so make changes permanent
|
|
|
|
// Write config to disk
|
|
ConfMan.flushToDisk();
|
|
|
|
// Update the ListWidget, select the new item, and force a redraw
|
|
updateListing();
|
|
selectGame(domain);
|
|
draw();
|
|
} else {
|
|
// User aborted, remove the the new domain again
|
|
ConfMan.removeGameDomain(domain);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
Common::String addGameToConf(const GameDescriptor &result) {
|
|
// The auto detector or the user made a choice.
|
|
// Pick a domain name which does not yet exist (after all, we
|
|
// are *adding* a game to the config, not replacing).
|
|
String domain = result.preferredtarget();
|
|
|
|
assert(!domain.empty());
|
|
if (ConfMan.hasGameDomain(domain)) {
|
|
int suffixN = 1;
|
|
char suffix[16];
|
|
String gameid(domain);
|
|
|
|
while (ConfMan.hasGameDomain(domain)) {
|
|
snprintf(suffix, 16, "-%d", suffixN);
|
|
domain = gameid + suffix;
|
|
suffixN++;
|
|
}
|
|
}
|
|
|
|
// Add the name domain
|
|
ConfMan.addGameDomain(domain);
|
|
|
|
// Copy all non-empty key/value pairs into the new domain
|
|
for (GameDescriptor::const_iterator iter = result.begin(); iter != result.end(); ++iter) {
|
|
if (!iter->_value.empty() && iter->_key != "preferredtarget")
|
|
ConfMan.set(iter->_key, iter->_value, domain);
|
|
}
|
|
|
|
// TODO: Setting the description field here has the drawback
|
|
// that the user does never notice when we upgrade our descriptions.
|
|
// It might be nice ot leave this field empty, and only set it to
|
|
// a value when the user edits the description string.
|
|
// However, at this point, that's impractical. Once we have a method
|
|
// to query all backends for the proper & full description of a given
|
|
// game target, we can change this (currently, you can only query
|
|
// for the generic gameid description; it's not possible to obtain
|
|
// a description which contains extended information like language, etc.).
|
|
|
|
return domain;
|
|
}
|
|
|
|
void LauncherDialog::removeGame(int item) {
|
|
MessageDialog alert("Do you really want to remove this game configuration?", "Yes", "No");
|
|
|
|
if (alert.runModal() == GUI::kMessageOK) {
|
|
// Remove the currently selected game from the list
|
|
assert(item >= 0);
|
|
ConfMan.removeGameDomain(_domains[item]);
|
|
|
|
// Write config to disk
|
|
ConfMan.flushToDisk();
|
|
|
|
// Update the ListWidget and force a redraw
|
|
updateListing();
|
|
draw();
|
|
}
|
|
}
|
|
|
|
void LauncherDialog::editGame(int item) {
|
|
// Set game specifc options. Most of these should be "optional", i.e. by
|
|
// default set nothing and use the global ScummVM settings. E.g. the user
|
|
// can set here an optional alternate music volume, or for specific games
|
|
// a different music driver etc.
|
|
// This is useful because e.g. MonkeyVGA needs Adlib music to have decent
|
|
// music support etc.
|
|
assert(item >= 0);
|
|
String gameId(ConfMan.get("gameid", _domains[item]));
|
|
if (gameId.empty())
|
|
gameId = _domains[item];
|
|
EditGameDialog editDialog(_domains[item], EngineMan.findGame(gameId).description());
|
|
if (editDialog.runModal() > 0) {
|
|
// User pressed OK, so make changes permanent
|
|
|
|
// Write config to disk
|
|
ConfMan.flushToDisk();
|
|
|
|
// Update the ListWidget and force a redraw
|
|
updateListing();
|
|
draw();
|
|
}
|
|
}
|
|
|
|
void LauncherDialog::handleKeyDown(Common::KeyState state) {
|
|
Dialog::handleKeyDown(state);
|
|
updateButtons();
|
|
}
|
|
|
|
void LauncherDialog::handleKeyUp(Common::KeyState state) {
|
|
Dialog::handleKeyUp(state);
|
|
updateButtons();
|
|
}
|
|
|
|
void LauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
|
|
int item = _list->getSelected();
|
|
|
|
switch (cmd) {
|
|
case kAddGameCmd:
|
|
addGame();
|
|
break;
|
|
case kRemoveGameCmd:
|
|
removeGame(item);
|
|
break;
|
|
case kEditGameCmd:
|
|
editGame(item);
|
|
break;
|
|
case kOptionsCmd: {
|
|
GlobalOptionsDialog options;
|
|
options.runModal();
|
|
}
|
|
break;
|
|
case kAboutCmd: {
|
|
AboutDialog about;
|
|
about.runModal();
|
|
}
|
|
break;
|
|
case kStartCmd:
|
|
case kListItemActivatedCmd:
|
|
case kListItemDoubleClickedCmd:
|
|
// Print out what was selected
|
|
assert(item >= 0);
|
|
ConfMan.setActiveDomain(_domains[item]);
|
|
close();
|
|
break;
|
|
case kListItemRemovalRequestCmd:
|
|
removeGame(item);
|
|
break;
|
|
case kListSelectionChangedCmd:
|
|
updateButtons();
|
|
break;
|
|
case kQuitCmd:
|
|
ConfMan.setActiveDomain("");
|
|
setResult(-1);
|
|
close();
|
|
break;
|
|
default:
|
|
Dialog::handleCommand(sender, cmd, data);
|
|
}
|
|
}
|
|
|
|
void LauncherDialog::updateButtons() {
|
|
bool enable = (_list->getSelected() >= 0);
|
|
if (enable != _startButton->isEnabled()) {
|
|
_startButton->setEnabled(enable);
|
|
_startButton->draw();
|
|
}
|
|
if (enable != _editButton->isEnabled()) {
|
|
_editButton->setEnabled(enable);
|
|
_editButton->draw();
|
|
}
|
|
if (enable != _removeButton->isEnabled()) {
|
|
_removeButton->setEnabled(enable);
|
|
_removeButton->draw();
|
|
}
|
|
|
|
// Update the label of the "Add" button depending on whether shift is pressed or not
|
|
int modifiers = g_system->getEventManager()->getModifierState();
|
|
const char *newAddButtonLabel = ((modifiers & Common::KBD_SHIFT) != 0)
|
|
? "Mass Add..."
|
|
: "Add Game...";
|
|
|
|
if (_addButton->getLabel() != newAddButtonLabel) {
|
|
_addButton->setLabel(newAddButtonLabel);
|
|
_addButton->draw();
|
|
}
|
|
}
|
|
|
|
void LauncherDialog::reflowLayout() {
|
|
#ifndef DISABLE_FANCY_THEMES
|
|
if (g_gui.xmlEval()->getVar("Globals.ShowLauncherLogo") == 1 && g_gui.theme()->supportsImages()) {
|
|
StaticTextWidget *ver = (StaticTextWidget*)findWidget("Launcher.Version");
|
|
if (ver) {
|
|
ver->setAlign((Graphics::TextAlignment)g_gui.xmlEval()->getVar("Launcher.Version.Align", Graphics::kTextAlignCenter));
|
|
ver->setLabel(gScummVMVersionDate);
|
|
}
|
|
|
|
if (!_logo)
|
|
_logo = new GraphicsWidget(this, "Launcher.Logo");
|
|
_logo->useThemeTransparency(true);
|
|
_logo->setGfx(g_gui.theme()->getImageSurface(Theme::kImageLogo));
|
|
} else {
|
|
StaticTextWidget *ver = (StaticTextWidget*)findWidget("Launcher.Version");
|
|
if (ver) {
|
|
ver->setAlign((Graphics::TextAlignment)g_gui.xmlEval()->getVar("Launcher.Version.Align", Graphics::kTextAlignCenter));
|
|
ver->setLabel(gScummVMFullVersion);
|
|
}
|
|
|
|
if (_logo) {
|
|
removeWidget(_logo);
|
|
_logo->setNext(0);
|
|
delete _logo;
|
|
_logo = 0;
|
|
}
|
|
}
|
|
#endif
|
|
|
|
_w = g_system->getOverlayWidth();
|
|
_h = g_system->getOverlayHeight();
|
|
|
|
Dialog::reflowLayout();
|
|
}
|
|
|
|
} // End of namespace GUI
|