From d12721722cb10e3db42c77b630df763f2cf88edd Mon Sep 17 00:00:00 2001 From: stephena Date: Mon, 6 Mar 2006 15:42:27 +0000 Subject: [PATCH] Converted OSX port to the new Settings API. I'm hoping this will take care of the bugs reported on AtariAge where joystick settings weren't being saved to the plist file. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1020 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/emucore/FrameBuffer.cxx | 6 +++--- stella/src/macosx/SettingsMACOSX.cxx | 22 +++++++++------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/stella/src/emucore/FrameBuffer.cxx b/stella/src/emucore/FrameBuffer.cxx index 32035bc6b..5d973e1d8 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.78 2006-03-05 01:18:42 stephena Exp $ +// $Id: FrameBuffer.cxx,v 1.79 2006-03-06 15:42:26 stephena Exp $ //============================================================================ #include @@ -41,8 +41,6 @@ #include #endif -#include "stella.xpm" // The Stella icon - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FrameBuffer::FrameBuffer(OSystem* osystem) : myOSystem(osystem), @@ -461,6 +459,8 @@ void FrameBuffer::setWindowTitle(const string& title) void FrameBuffer::setWindowIcon() { #ifndef MAC_OSX + #include "stella.xpm" // The Stella icon + // Set the window icon uInt32 w, h, ncols, nbytes; uInt32 rgba[256], icon[32 * 32]; diff --git a/stella/src/macosx/SettingsMACOSX.cxx b/stella/src/macosx/SettingsMACOSX.cxx index 8996c7037..4088e4f1c 100644 --- a/stella/src/macosx/SettingsMACOSX.cxx +++ b/stella/src/macosx/SettingsMACOSX.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: SettingsMACOSX.cxx,v 1.9 2006-03-06 02:26:16 stephena Exp $ +// $Id: SettingsMACOSX.cxx,v 1.10 2006-03-06 15:42:27 stephena Exp $ //============================================================================ #include @@ -57,14 +57,12 @@ void SettingsMACOSX::loadConfig() char cvalue[1024]; // Write out each of the key and value pairs - for(uInt32 i = 0; i < mySize; ++i) + const SettingsArray& settings = getInternalSettings(); + for(unsigned int i = 0; i < settings.size(); ++i) { - prefsGetString((char *) mySettings[i].key.c_str(), cvalue); + prefsGetString((char *) settings[i].key.c_str(), cvalue); if(cvalue[0] != 0) - { - mySettings[i].value.assign(cvalue); - mySettings[i].save = true; - } + setInternal(settings[i].key, cvalue, i, true); } } @@ -72,13 +70,11 @@ void SettingsMACOSX::loadConfig() void SettingsMACOSX::saveConfig() { // Write out each of the key and value pairs - for(uInt32 i = 0; i < mySize; ++i) + const SettingsArray& settings = getInternalSettings(); + for(unsigned int i = 0; i < settings.size(); ++i) { - if(mySettings[i].save) - { - prefsSetString((char *) mySettings[i].key.c_str(), - (char *) mySettings[i].value.c_str()); - } + prefsSetString((char *) settings[i].key.c_str(), + (char *) settings[i].value.c_str()); } prefsSave(); }