Added ability to dynamically toggle phosphor effect, bound to the Alt-p key.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@952 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2006-01-11 14:13:19 +00:00
parent a70171b28c
commit d784073016
3 changed files with 35 additions and 4 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: Console.cxx,v 1.80 2006-01-10 20:37:00 stephena Exp $
// $Id: Console.cxx,v 1.81 2006-01-11 14:13:19 stephena Exp $
//============================================================================
#include <assert.h>
@ -349,6 +349,28 @@ void Console::togglePalette(const string& palette)
setPalette();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::togglePhosphor()
{
string phosphor = myProperties.get("Display.Phosphor", true);
bool enable;
if(phosphor == "YES")
{
myProperties.set("Display.Phosphor", "No");
enable = false;
myOSystem->frameBuffer().showMessage("Phosphor effect disabled");
}
else
{
myProperties.set("Display.Phosphor", "Yes");
enable = true;
myOSystem->frameBuffer().showMessage("Phosphor effect enabled");
}
myOSystem->frameBuffer().enablePhosphor(enable);
setPalette();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::saveProperties(string filename, bool merge)
{

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: Console.hxx,v 1.41 2005-12-23 20:48:50 stephena Exp $
// $Id: Console.hxx,v 1.42 2006-01-11 14:13:19 stephena Exp $
//============================================================================
#ifndef CONSOLE_HXX
@ -37,7 +37,7 @@ class System;
This class represents the entire game console.
@author Bradford W. Mott
@version $Id: Console.hxx,v 1.41 2005-12-23 20:48:50 stephena Exp $
@version $Id: Console.hxx,v 1.42 2006-01-11 14:13:19 stephena Exp $
*/
class Console
{
@ -150,6 +150,11 @@ class Console
*/
void togglePalette(const string& palette = "");
/**
Toggles phosphor effect.
*/
void togglePhosphor();
/**
Save a copy of the current properties after any changes.

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.145 2006-01-09 19:30:04 stephena Exp $
// $Id: EventHandler.cxx,v 1.146 2006-01-11 14:13:19 stephena Exp $
//============================================================================
#include <sstream>
@ -453,6 +453,10 @@ void EventHandler::poll(uInt32 time)
saveProperties();
break;
case SDLK_p: // Alt-p toggles phosphor effect
myOSystem->console().togglePhosphor();
break;
// FIXME - these will be removed when a UI is added for event recording
case SDLK_e: // Alt-e starts/stops event recording
if(myEventStreamer->isRecording())