From cf08dc29cdf6a4696315e1221020b129af34ca09 Mon Sep 17 00:00:00 2001 From: stephena Date: Fri, 6 May 2005 22:50:15 +0000 Subject: [PATCH] Cleaned up the LauncherDialog a little. Removed the saving of TIAbit on/off into the state files. These are debugging tools, and aren't really part of a state file (and hence shouldn't be saved with a state file). Now, whenever a state is (re)loaded, the TIABits are all turned back on. That means the state files are still compatible with Stella 1.4.2. Added "Enter/exit menu mode" and "Enter launcher mode" to the remappable events. They default to 'Tab' and 'Escape', respectively. While you can add new mappings for these events, those defaults can't be removed (otherwise, it would be possible for a user to disable menu mode, and never be able to get back into the menu to fix the problem). Fixed some problems with the overall state machine. Sometimes the cursor was hidden when it shouldn't have been, and vice versa. Fixed crash when toggling between software and OpenGL while in ROM launcher mode. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@413 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/common/FrameBufferGL.cxx | 11 ++-- stella/src/emucore/Console.cxx | 5 +- stella/src/emucore/Event.hxx | 8 +-- stella/src/emucore/EventHandler.cxx | 78 +++++++++++++++------------ stella/src/emucore/EventHandler.hxx | 6 +-- stella/src/emucore/FrameBuffer.cxx | 26 ++++----- stella/src/emucore/FrameBuffer.hxx | 17 +++--- stella/src/emucore/OSystem.cxx | 8 +-- stella/src/emucore/TIA.cxx | 17 +++--- stella/src/gui/EventMappingDialog.cxx | 4 +- stella/src/gui/Launcher.cxx | 11 +++- stella/src/gui/Launcher.hxx | 9 +++- stella/src/gui/LauncherDialog.cxx | 8 +-- 13 files changed, 117 insertions(+), 91 deletions(-) diff --git a/stella/src/common/FrameBufferGL.cxx b/stella/src/common/FrameBufferGL.cxx index 8e46ee317..59142f8f7 100644 --- a/stella/src/common/FrameBufferGL.cxx +++ b/stella/src/common/FrameBufferGL.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBufferGL.cxx,v 1.21 2005-05-05 00:10:43 stephena Exp $ +// $Id: FrameBufferGL.cxx,v 1.22 2005-05-06 22:50:14 stephena Exp $ //============================================================================ #include @@ -58,8 +58,13 @@ bool FrameBufferGL::initSubsystem() // Get the aspect ratio for the display // Since the display is already doubled horizontally, we half the // ratio that is provided - theAspectRatio = myOSystem->settings().getFloat("gl_aspect") / 2; - if(theAspectRatio <= 0.0) + if(theUseAspectRatioFlag) + { + theAspectRatio = myOSystem->settings().getFloat("gl_aspect") / 2; + if(theAspectRatio <= 0.0) + theAspectRatio = 1.0; + } + else theAspectRatio = 1.0; // Set up the OpenGL attributes diff --git a/stella/src/emucore/Console.cxx b/stella/src/emucore/Console.cxx index 1dbe7bf43..bda6704f8 100644 --- a/stella/src/emucore/Console.cxx +++ b/stella/src/emucore/Console.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Console.cxx,v 1.50 2005-05-05 00:10:46 stephena Exp $ +// $Id: Console.cxx,v 1.51 2005-05-06 22:50:14 stephena Exp $ //============================================================================ #include @@ -62,9 +62,6 @@ Console::Console(const uInt8* image, uInt32 size, OSystem* osystem) mySystem = 0; myEvent = 0; - // Indicate that emulation should start now - myOSystem->eventHandler().reset(EventHandler::S_EMULATE); - // Attach the event subsystem to the current console myEvent = myOSystem->eventHandler().event(); diff --git a/stella/src/emucore/Event.hxx b/stella/src/emucore/Event.hxx index 50129de34..4117426cf 100644 --- a/stella/src/emucore/Event.hxx +++ b/stella/src/emucore/Event.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Event.hxx,v 1.7 2005-05-05 00:10:47 stephena Exp $ +// $Id: Event.hxx,v 1.8 2005-05-06 22:50:14 stephena Exp $ //============================================================================ #ifndef EVENT_HXX @@ -25,7 +25,7 @@ class Event; /** @author Bradford W. Mott - @version $Id: Event.hxx,v 1.7 2005-05-05 00:10:47 stephena Exp $ + @version $Id: Event.hxx,v 1.8 2005-05-06 22:50:14 stephena Exp $ */ class Event { @@ -71,8 +71,8 @@ class Event DrivingOneClockwise, DrivingOneCounterClockwise, DrivingOneValue, DrivingOneFire, - ChangeState, LoadState, SaveState, TakeSnapshot, Pause, Quit, ExitGame, - ReloadRom, + ChangeState, LoadState, SaveState, TakeSnapshot, Pause, Quit, + MenuMode, LauncherMode, LastType }; diff --git a/stella/src/emucore/EventHandler.cxx b/stella/src/emucore/EventHandler.cxx index 5197a0996..c3f2ca0a6 100644 --- a/stella/src/emucore/EventHandler.cxx +++ b/stella/src/emucore/EventHandler.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventHandler.cxx,v 1.52 2005-05-06 18:38:59 stephena Exp $ +// $Id: EventHandler.cxx,v 1.53 2005-05-06 22:50:15 stephena Exp $ //============================================================================ #include @@ -111,6 +111,9 @@ void EventHandler::reset(State state) myQuitFlag = false; myPaddleMode = 0; + myOSystem->frameBuffer().pause(myPauseFlag); + myOSystem->sound().mute(myPauseFlag); + switch(myState) { case S_EMULATE: @@ -236,30 +239,6 @@ void EventHandler::poll() // FIXME - add modifiers for OSX // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void EventHandler::handleKeyEvent(SDLKey key, SDLMod mod, uInt8 state) { - // Handle keys here that are accessible no matter which mode we're in - - // Toggle menu mode - if(key == SDLK_TAB && state == 1 && !myPauseFlag) // FIXME - add remappable 'enter menu mode key here' - { - if(myState == S_EMULATE) - { - myState = S_MENU; - myOSystem->menu().reStack(); - myOSystem->frameBuffer().refresh(); - myOSystem->frameBuffer().setCursorState(); - myOSystem->sound().mute(true); - return; - } - else if(myState == S_MENU) - { - myState = S_EMULATE; - myOSystem->frameBuffer().refresh(); - myOSystem->frameBuffer().setCursorState(); - myOSystem->sound().mute(false); - return; - } - } - // Determine which mode we're in, then send the event to the appropriate place switch(myState) { @@ -393,12 +372,29 @@ void EventHandler::handleKeyEvent(SDLKey key, SDLMod mod, uInt8 state) break; } } + else if(myKeyTable[key] == Event::MenuMode && state == 1 && !myPauseFlag) + { + myState = S_MENU; + myOSystem->menu().reStack(); + myOSystem->frameBuffer().refresh(); + myOSystem->frameBuffer().setCursorState(); + myOSystem->sound().mute(true); + return; + } else handleEvent(myKeyTable[key], state); break; // S_EMULATE case S_MENU: + if(myKeyTable[key] == Event::MenuMode && state == 1 && !myPauseFlag) + { + myState = S_EMULATE; + myOSystem->frameBuffer().refresh(); + myOSystem->frameBuffer().setCursorState(); + myOSystem->sound().mute(false); + return; + } myOSystem->menu().handleKeyEvent((uInt16) key, (Int32) mod, state); break; @@ -595,7 +591,18 @@ void EventHandler::handleEvent(Event::Type event, Int32 state) myOSystem->sound().mute(myPauseFlag); return; } - else if(event == Event::ExitGame) + else if(event == Event::MenuMode) + { + // ExitGame will only work when we've launched stella using the ROM + // launcher. Otherwise, the only way to exit the main loop is to Quit. + if(myState == S_EMULATE && myUseLauncherFlag) + { + myOSystem->settings().saveConfig(); + myOSystem->createLauncher(); + return; + } + } + else if(event == Event::LauncherMode) { // ExitGame will only work when we've launched stella using the ROM // launcher. Otherwise, the only way to exit the main loop is to Quit. @@ -625,7 +632,7 @@ void EventHandler::handleEvent(Event::Type event, Int32 state) void EventHandler::setActionMappings() { // Fill the ActionList with the current key and joystick mappings - for(Int32 i = 0; i < 58; ++i) + for(Int32 i = 0; i < 60; ++i) { Event::Type event = ourActionList[i].event; ourActionList[i].key = "None"; @@ -748,6 +755,10 @@ void EventHandler::setJoymap() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void EventHandler::addKeyMapping(Event::Type event, uInt16 key) { + // These keys cannot be remapped. + if(key == SDLK_TAB || key == SDLK_ESCAPE) + return; + myKeyTable[key] = event; setActionMappings(); @@ -771,12 +782,12 @@ void EventHandler::eraseMapping(Event::Type event) { // Erase the KeyEvent arrays for(Int32 i = 0; i < SDLK_LAST; ++i) - if(myKeyTable[i] == event) + if(myKeyTable[i] == event && i != SDLK_TAB && i != SDLK_ESCAPE) myKeyTable[i] = Event::NoType; // Erase the JoyEvent array for(Int32 i = 0; i < StellaEvent::LastJSTICK*StellaEvent::LastJCODE; ++i) - if(myJoyTable[i] == event) + if(myJoyTable[i] == event && i != SDLK_TAB && i != SDLK_ESCAPE) myJoyTable[i] = Event::NoType; setActionMappings(); @@ -863,9 +874,8 @@ void EventHandler::setDefaultKeymap() myKeyTable[ SDLK_F11 ] = Event::LoadState; myKeyTable[ SDLK_F12 ] = Event::TakeSnapshot; myKeyTable[ SDLK_PAUSE ] = Event::Pause; -#ifndef MAC_OSX - myKeyTable[ SDLK_ESCAPE ] = Event::ExitGame; -#endif + myKeyTable[ SDLK_TAB ] = Event::MenuMode; + myKeyTable[ SDLK_ESCAPE ] = Event::LauncherMode; saveMappings(); } @@ -1281,7 +1291,7 @@ void EventHandler::setSDLMappings() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -ActionList EventHandler::ourActionList[58] = { +ActionList EventHandler::ourActionList[60] = { { Event::ConsoleSelect, "Select", "" }, { Event::ConsoleReset, "Reset", "" }, { Event::ConsoleColor, "Color TV", "" }, @@ -1295,6 +1305,8 @@ ActionList EventHandler::ourActionList[58] = { { Event::LoadState, "Load State", "" }, { Event::TakeSnapshot, "Snapshot", "" }, { Event::Pause, "Pause", "" }, + { Event::MenuMode, "Enter/exit menu mode", "" }, + { Event::LauncherMode, "Enter ROM launcher", "" }, { Event::Quit, "Quit", "" }, { Event::JoystickZeroUp, "Left Joystick Up Direction", "" }, diff --git a/stella/src/emucore/EventHandler.hxx b/stella/src/emucore/EventHandler.hxx index 798368fcc..188d72cba 100644 --- a/stella/src/emucore/EventHandler.hxx +++ b/stella/src/emucore/EventHandler.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventHandler.hxx,v 1.26 2005-05-06 18:38:59 stephena Exp $ +// $Id: EventHandler.hxx,v 1.27 2005-05-06 22:50:15 stephena Exp $ //============================================================================ #ifndef EVENTHANDLER_HXX @@ -57,7 +57,7 @@ struct ActionList { mapping can take place. @author Stephen Anthony - @version $Id: EventHandler.hxx,v 1.26 2005-05-06 18:38:59 stephena Exp $ + @version $Id: EventHandler.hxx,v 1.27 2005-05-06 22:50:15 stephena Exp $ */ class EventHandler { @@ -143,7 +143,7 @@ class EventHandler inline void quit() { handleEvent(Event::Quit, 1); } // Holds static strings for the remap menu - static ActionList ourActionList[58]; + static ActionList ourActionList[60]; private: /** diff --git a/stella/src/emucore/FrameBuffer.cxx b/stella/src/emucore/FrameBuffer.cxx index f4bfa615c..1e9bb08db 100644 --- a/stella/src/emucore/FrameBuffer.cxx +++ b/stella/src/emucore/FrameBuffer.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBuffer.cxx,v 1.32 2005-05-06 18:38:59 stephena Exp $ +// $Id: FrameBuffer.cxx,v 1.33 2005-05-06 22:50:15 stephena Exp $ //============================================================================ #include @@ -41,6 +41,7 @@ FrameBuffer::FrameBuffer(OSystem* osystem) theZoomLevel(1), theMaxZoomLevel(1), theAspectRatio(1.0), + theUseAspectRatioFlag(true), myFrameRate(0), myPauseStatus(false), theMenuChangedIndicator(false), @@ -78,7 +79,8 @@ FrameBuffer::~FrameBuffer(void) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height) +void FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height, + bool aspect) { bool isAlreadyInitialized = (SDL_WasInit(SDL_INIT_VIDEO) & SDL_INIT_VIDEO) > 0; @@ -129,6 +131,9 @@ void FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height) // Set window title setWindowTitle(title); + // Indicate whether we want to use aspect ratio correction + theUseAspectRatioFlag = aspect; + // Get the maximum size of a window for the current desktop theMaxZoomLevel = maxWindowSizeForScreen(); @@ -140,9 +145,6 @@ void FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height) // Initialize video subsystem initSubsystem(); - - // Show or hide the cursor based on the current state - setCursorState(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -350,22 +352,16 @@ void FrameBuffer::resize(Size size, Int8 zoom) void FrameBuffer::setCursorState() { bool isFullscreen = myOSystem->settings().getBool("fullscreen"); + if(isFullscreen) grabMouse(true); + else + grabMouse(myOSystem->settings().getBool("grabmouse")); switch(myOSystem->eventHandler().state()) { case EventHandler::S_EMULATE: - if(isFullscreen) - showCursor(false); - else - { - // Keep mouse in game window if grabmouse is selected - grabMouse(myOSystem->settings().getBool("grabmouse")); - - // Never show cursor in normal emulation mode - showCursor(false); - } + showCursor(false); break; default: diff --git a/stella/src/emucore/FrameBuffer.hxx b/stella/src/emucore/FrameBuffer.hxx index b943d82cb..09a10a9fd 100644 --- a/stella/src/emucore/FrameBuffer.hxx +++ b/stella/src/emucore/FrameBuffer.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: FrameBuffer.hxx,v 1.28 2005-05-05 00:10:48 stephena Exp $ +// $Id: FrameBuffer.hxx,v 1.29 2005-05-06 22:50:15 stephena Exp $ //============================================================================ #ifndef FRAMEBUFFER_HXX @@ -41,7 +41,7 @@ class OSystem; All GUI elements (ala ScummVM) are drawn here as well. @author Stephen Anthony - @version $Id: FrameBuffer.hxx,v 1.28 2005-05-05 00:10:48 stephena Exp $ + @version $Id: FrameBuffer.hxx,v 1.29 2005-05-06 22:50:15 stephena Exp $ */ class FrameBuffer { @@ -67,11 +67,13 @@ class FrameBuffer (Re)initializes the framebuffer display. This must be called before any calls are made to derived methods. - @param title The title of the window - @param width The width of the framebuffer - @param height The height of the framebuffer + @param title The title of the window + @param width The width of the framebuffer + @param height The height of the framebuffer + @param aspect Whether to use the aspect ratio setting */ - void initialize(const string& title, uInt32 width, uInt32 height); + void initialize(const string& title, uInt32 width, uInt32 height, + bool aspect = true); /** Updates the display, which depending on the current mode could mean @@ -431,6 +433,9 @@ FIXME // The aspect ratio of the window float theAspectRatio; + // Indicates whether to use aspect ratio correction + bool theUseAspectRatioFlag; + // The font object to use StellaFont* myFont; diff --git a/stella/src/emucore/OSystem.cxx b/stella/src/emucore/OSystem.cxx index 6cd139ebe..638371bdc 100644 --- a/stella/src/emucore/OSystem.cxx +++ b/stella/src/emucore/OSystem.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: OSystem.cxx,v 1.11 2005-05-06 18:38:59 stephena Exp $ +// $Id: OSystem.cxx,v 1.12 2005-05-06 22:50:15 stephena Exp $ //============================================================================ #include @@ -160,6 +160,7 @@ bool OSystem::createFrameBuffer(bool showmessage) break; // S_EMULATE, S_MENU case EventHandler::S_LAUNCHER: + myLauncher->initializeVideo(); break; // S_LAUNCHER case EventHandler::S_DEBUGGER: @@ -270,6 +271,8 @@ bool OSystem::createConsole(const string& romfile) cout << "Game console created: " << myRomFile << endl; retval = true; + myEventHandler->reset(EventHandler::S_EMULATE); + myFrameBuffer->setCursorState(); } return retval; @@ -281,8 +284,7 @@ void OSystem::createLauncher() myEventHandler->reset(EventHandler::S_LAUNCHER); // Create the window - string title = "Stella: ROM Launcher"; // FIXME - include version of Stella - myFrameBuffer->initialize(title, kLauncherWidth, kLauncherHeight); + myLauncher->initializeVideo(); // And start the base dialog myLauncher->initialize(); diff --git a/stella/src/emucore/TIA.cxx b/stella/src/emucore/TIA.cxx index 916f1a84f..a5a55ff28 100644 --- a/stella/src/emucore/TIA.cxx +++ b/stella/src/emucore/TIA.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: TIA.cxx,v 1.40 2005-05-01 18:57:21 stephena Exp $ +// $Id: TIA.cxx,v 1.41 2005-05-06 22:50:15 stephena Exp $ //============================================================================ #include @@ -236,6 +236,8 @@ void TIA::reset() myColorLossEnabled = false; myMaximumNumberOfScanlines = 290; } + + enableBits(true); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -363,11 +365,6 @@ bool TIA::save(Serializer& out) out.putBool(myM0CosmicArkMotionEnabled); out.putLong(myM0CosmicArkCounter); - // There are currently six bits defined in TIABit - out.putLong(6); - for(uInt32 i = 0; i < 6; ++i) - out.putBool(myBitEnabled[i]); - out.putBool(myDumpEnabled); out.putLong(myDumpDisabledCycle); @@ -464,16 +461,14 @@ bool TIA::load(Deserializer& in) myM0CosmicArkMotionEnabled = in.getBool(); myM0CosmicArkCounter = (uInt32) in.getLong(); - // We abuse the concept of 'enum' here - uInt32 limit = (uInt32) in.getLong(); - for(uInt32 i = 0; i < limit; ++i) - myBitEnabled[i] = in.getBool(); - myDumpEnabled = in.getBool(); myDumpDisabledCycle = (Int32) in.getLong(); // Load the sound sample stuff ... mySound->load(in); + + // Reset TIA bits to be on + enableBits(true); } catch(char *msg) { diff --git a/stella/src/gui/EventMappingDialog.cxx b/stella/src/gui/EventMappingDialog.cxx index 14dbae356..a2d6eb9eb 100644 --- a/stella/src/gui/EventMappingDialog.cxx +++ b/stella/src/gui/EventMappingDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: EventMappingDialog.cxx,v 1.6 2005-04-24 20:36:36 stephena Exp $ +// $Id: EventMappingDialog.cxx,v 1.7 2005-05-06 22:50:15 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -58,7 +58,7 @@ EventMappingDialog::EventMappingDialog(OSystem* osystem, uInt16 x, uInt16 y, // Get actions names StringList l; - for(int i = 0; i < 58; ++i) // FIXME - create a size() method + for(int i = 0; i < 60; ++i) // FIXME - create a size() method l.push_back(EventHandler::ourActionList[i].action); myActionsList->setList(l); diff --git a/stella/src/gui/Launcher.cxx b/stella/src/gui/Launcher.cxx index 278d8ab62..b1c240102 100644 --- a/stella/src/gui/Launcher.cxx +++ b/stella/src/gui/Launcher.cxx @@ -13,9 +13,11 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Launcher.cxx,v 1.1 2005-05-06 18:39:00 stephena Exp $ +// $Id: Launcher.cxx,v 1.2 2005-05-06 22:50:15 stephena Exp $ //============================================================================ +#include "OSystem.hxx" +#include "FrameBuffer.hxx" #include "LauncherDialog.hxx" #include "bspf.hxx" #include "Launcher.hxx" @@ -37,3 +39,10 @@ void Launcher::initialize() delete myBaseDialog; myBaseDialog = new LauncherDialog(myOSystem, 0, 0, kLauncherWidth, kLauncherHeight); } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void Launcher::initializeVideo() +{ + string title = "Stella: ROM Launcher"; // FIXME - include version of Stella + myOSystem->frameBuffer().initialize(title, kLauncherWidth, kLauncherHeight, false); +} diff --git a/stella/src/gui/Launcher.hxx b/stella/src/gui/Launcher.hxx index df7924c78..b801072f6 100644 --- a/stella/src/gui/Launcher.hxx +++ b/stella/src/gui/Launcher.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Launcher.hxx,v 1.1 2005-05-06 18:39:00 stephena Exp $ +// $Id: Launcher.hxx,v 1.2 2005-05-06 22:50:15 stephena Exp $ //============================================================================ #ifndef LAUNCHER_HXX @@ -32,7 +32,7 @@ enum { The base dialog for the ROM launcher in Stella. @author Stephen Anthony - @version $Id: Launcher.hxx,v 1.1 2005-05-06 18:39:00 stephena Exp $ + @version $Id: Launcher.hxx,v 1.2 2005-05-06 22:50:15 stephena Exp $ */ class Launcher : public DialogContainer { @@ -52,6 +52,11 @@ class Launcher : public DialogContainer Updates the basedialog to be of the type defined for this derived class. */ void initialize(); + + /** + Initialize the video subsystem wrt this class. + */ + void initializeVideo(); }; #endif diff --git a/stella/src/gui/LauncherDialog.cxx b/stella/src/gui/LauncherDialog.cxx index 225db5112..48fe32fca 100644 --- a/stella/src/gui/LauncherDialog.cxx +++ b/stella/src/gui/LauncherDialog.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: LauncherDialog.cxx,v 1.1 2005-05-06 18:39:00 stephena Exp $ +// $Id: LauncherDialog.cxx,v 1.2 2005-05-06 22:50:15 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -52,8 +52,8 @@ LauncherDialog::LauncherDialog(OSystem* osystem, uInt16 x, uInt16 y, : Dialog(osystem, x, y, w, h) { // Show game name - new StaticTextWidget(this, 10, 8, 300, kLineHeight, "Select a game from the list ...", - kTextAlignCenter); + new StaticTextWidget(this, 10, 8, _w - 20, kLineHeight, + "Select a game from the list ...", kTextAlignCenter); // Add three buttons at the bottom const int border = 10; @@ -72,7 +72,7 @@ LauncherDialog::LauncherDialog(OSystem* osystem, uInt16 x, uInt16 y, xpos += space + width; // Add list with game titles - myList = new ListWidget(this, 10, 24, 300, 142); + myList = new ListWidget(this, 10, 24, _w - 20, _h - 24 - 26 - 10); myList->setEditable(false); myList->setNumberingMode(kListNumberingOff);