Re-enabled saving of the event remappings to the rc-file.

Moved the refresh() method to FrameBuffer::refresh(), since
all ports may need it.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@219 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2003-11-24 14:51:06 +00:00
parent 6aef328c60
commit 120dd7b268
7 changed files with 35 additions and 78 deletions

View File

@ -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.22 2003-11-19 15:57:10 stephena Exp $
// $Id: EventHandler.cxx,v 1.23 2003-11-24 14:51:05 stephena Exp $
//============================================================================
#include <algorithm>
@ -215,32 +215,6 @@ void EventHandler::setJoymap()
setDefaultJoymap();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string EventHandler::getKeymap()
{
ostringstream buf;
// Iterate through the keymap table and create a colon-separated list
for(Int32 i = 0; i < StellaEvent::LastKCODE; ++i)
buf << myKeyTable[i] << ":";
myKeymapString = buf.str();
return myKeymapString;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string EventHandler::getJoymap()
{
ostringstream buf;
// Iterate through the joymap table and create a colon-separated list
for(Int32 i = 0; i < StellaEvent::LastJSTICK*StellaEvent::LastJCODE; ++i)
buf << myJoyTable[i] << ":";
myJoymapString = buf.str();
return myJoymapString;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::getKeymapArray(Event::Type** array, uInt32* size)
{

View File

@ -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.12 2003-11-06 22:22:32 stephena Exp $
// $Id: EventHandler.hxx,v 1.13 2003-11-24 14:51:06 stephena Exp $
//============================================================================
#ifndef EVENTHANDLER_HXX
@ -41,7 +41,7 @@ class MediaSource;
mapping can take place.
@author Stephen Anthony
@version $Id: EventHandler.hxx,v 1.12 2003-11-06 22:22:32 stephena Exp $
@version $Id: EventHandler.hxx,v 1.13 2003-11-24 14:51:06 stephena Exp $
*/
class EventHandler
{
@ -97,20 +97,6 @@ class EventHandler
*/
void setMediaSource(MediaSource* mediaSource);
/**
Get the current keymapping being used in string form
@return The keymap list in string form
*/
string getKeymap();
/**
Get the current joymapping being used in string form
@return The joymap list in string form
*/
string getJoymap();
/**
Enable/disable remapping mode.
@ -119,12 +105,12 @@ class EventHandler
void enableRemapping(bool status) { myRemapEnabledFlag = status; }
/**
This method indicated whether a pause event has been received.
This method indicates whether a pause event has been received.
*/
bool doPause() { return myPauseStatus; }
/**
This method indicated whether a quit event has been received.
This method indicates whether a quit event has been received.
*/
bool doQuit() { return myQuitStatus; }

View File

@ -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.6 2003-11-19 15:57:10 stephena Exp $
// $Id: FrameBuffer.cxx,v 1.7 2003-11-24 14:51:06 stephena Exp $
//============================================================================
#include <sstream>
@ -617,6 +617,19 @@ void FrameBuffer::loadRemapMenu()
ourRemapMenu[i].key = key;
}
}
// Save the new bindings
ostringstream keybuf, joybuf;
// Iterate through the keymap table and create a colon-separated list
for(uInt32 i = 0; i < StellaEvent::LastKCODE; ++i)
keybuf << myKeyTable[i] << ":";
myConsole->settings().setString("keymap", keybuf.str());
// Iterate through the joymap table and create a colon-separated list
for(uInt32 i = 0; i < StellaEvent::LastJSTICK*StellaEvent::LastJCODE; ++i)
joybuf << myJoyTable[i] << ":";
myConsole->settings().setString("joymap", joybuf.str());
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -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.6 2003-11-19 15:57:10 stephena Exp $
// $Id: FrameBuffer.hxx,v 1.7 2003-11-24 14:51:06 stephena Exp $
//============================================================================
#ifndef FRAMEBUFFER_HXX
@ -35,7 +35,7 @@ class Console;
can be changed.
@author Stephen Anthony
@version $Id: FrameBuffer.hxx,v 1.6 2003-11-19 15:57:10 stephena Exp $
@version $Id: FrameBuffer.hxx,v 1.7 2003-11-24 14:51:06 stephena Exp $
*/
class FrameBuffer
{
@ -121,6 +121,12 @@ class FrameBuffer
*/
void pause(bool status);
/**
Indicates that a redraw should be done, since the window contents
are dirty.
*/
void refresh() { theRedrawEntireFrameIndicator = true; }
public:
//////////////////////////////////////////////////////////////////////
// The following methods are system-specific and must be implemented

View File

@ -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: Settings.cxx,v 1.13 2003-11-24 01:14:38 stephena Exp $
// $Id: Settings.cxx,v 1.14 2003-11-24 14:51:06 stephena Exp $
//============================================================================
#include <cassert>
@ -141,10 +141,6 @@ bool Settings::loadCommandLine(Int32 argc, char** argv)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Settings::saveConfig()
{
// if(!myConsole)
// return;
// FIXME - there should not be a dependency on Console
ofstream out(mySettingsOutputFilename.c_str());
if(!out || !out.is_open())
{
@ -152,10 +148,6 @@ void Settings::saveConfig()
return;
}
// Make sure that any modifications to key remapping is saved
// set("keymap", myConsole->eventHandler().getKeymap());
// set("joymap", myConsole->eventHandler().getJoymap());
out << "; Stella configuration file" << endl
<< ";" << endl
<< "; Lines starting with ';' are comments and are ignored." << endl

View File

@ -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: FrameBufferSDL.cxx,v 1.5 2003-11-17 17:43:39 stephena Exp $
// $Id: FrameBufferSDL.cxx,v 1.6 2003-11-24 14:51:06 stephena Exp $
//============================================================================
#include <SDL.h>
@ -59,9 +59,7 @@ void FrameBufferSDL::toggleFullscreen()
isFullscreen = !isFullscreen;
// Update the settings
ostringstream tmp;
tmp << isFullscreen;
myConsole->settings().set("fullscreen", tmp.str());
myConsole->settings().setBool("fullscreen", isFullscreen);
if(isFullscreen)
mySDLFlags |= SDL_FULLSCREEN;
@ -118,9 +116,7 @@ void FrameBufferSDL::resize(int mode)
return;
// Update the settings
ostringstream tmp;
tmp << theZoomLevel;
myConsole->settings().set("zoom", tmp.str());
myConsole->settings().setInt("zoom", theZoomLevel);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -135,9 +131,7 @@ void FrameBufferSDL::showCursor(bool show)
SDL_ShowCursor(SDL_DISABLE);
// Update the settings
ostringstream tmp;
tmp << !show;
myConsole->settings().set("hidecursor", tmp.str());
myConsole->settings().setBool("hidecursor", !show);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -152,9 +146,7 @@ void FrameBufferSDL::grabMouse(bool grab)
SDL_WM_GrabInput(SDL_GRAB_OFF);
// Update the settings
ostringstream tmp;
tmp << grab;
myConsole->settings().set("grabmouse", tmp.str());
myConsole->settings().setBool("grabmouse", grab);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -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: FrameBufferSDL.hxx,v 1.6 2003-11-23 20:54:59 stephena Exp $
// $Id: FrameBufferSDL.hxx,v 1.7 2003-11-24 14:51:06 stephena Exp $
//============================================================================
#ifndef FRAMEBUFFER_SDL_HXX
@ -34,7 +34,7 @@
the core FrameBuffer.
@author Stephen Anthony
@version $Id: FrameBufferSDL.hxx,v 1.6 2003-11-23 20:54:59 stephena Exp $
@version $Id: FrameBufferSDL.hxx,v 1.7 2003-11-24 14:51:06 stephena Exp $
*/
class FrameBufferSDL : public FrameBuffer
{
@ -92,12 +92,6 @@ class FrameBufferSDL : public FrameBuffer
*/
uInt32 maxWindowSizeForScreen();
/**
Indicates that a redraw should be done, since the window contents
are dirty.
*/
void refresh() { theRedrawEntireFrameIndicator = true; }
//////////////////////////////////////////////////////////////////////
// The following methods are derived from FrameBuffer.hxx
//////////////////////////////////////////////////////////////////////