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
This commit is contained in:
stephena 2006-03-06 15:42:27 +00:00
parent 19f348e312
commit d12721722c
2 changed files with 12 additions and 16 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 <sstream> #include <sstream>
@ -41,8 +41,6 @@
#include <os2emx.h> #include <os2emx.h>
#endif #endif
#include "stella.xpm" // The Stella icon
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FrameBuffer::FrameBuffer(OSystem* osystem) FrameBuffer::FrameBuffer(OSystem* osystem)
: myOSystem(osystem), : myOSystem(osystem),
@ -461,6 +459,8 @@ void FrameBuffer::setWindowTitle(const string& title)
void FrameBuffer::setWindowIcon() void FrameBuffer::setWindowIcon()
{ {
#ifndef MAC_OSX #ifndef MAC_OSX
#include "stella.xpm" // The Stella icon
// Set the window icon // Set the window icon
uInt32 w, h, ncols, nbytes; uInt32 w, h, ncols, nbytes;
uInt32 rgba[256], icon[32 * 32]; uInt32 rgba[256], icon[32 * 32];

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 <cassert> #include <cassert>
@ -57,14 +57,12 @@ void SettingsMACOSX::loadConfig()
char cvalue[1024]; char cvalue[1024];
// Write out each of the key and value pairs // 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) if(cvalue[0] != 0)
{ setInternal(settings[i].key, cvalue, i, true);
mySettings[i].value.assign(cvalue);
mySettings[i].save = true;
}
} }
} }
@ -72,13 +70,11 @@ void SettingsMACOSX::loadConfig()
void SettingsMACOSX::saveConfig() void SettingsMACOSX::saveConfig()
{ {
// Write out each of the key and value pairs // 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 *) settings[i].key.c_str(),
{ (char *) settings[i].value.c_str());
prefsSetString((char *) mySettings[i].key.c_str(),
(char *) mySettings[i].value.c_str());
}
} }
prefsSave(); prefsSave();
} }