From 44203e578a1403da344c4865e4de2f8f4f5f41c3 Mon Sep 17 00:00:00 2001 From: markgrebe Date: Fri, 18 Feb 2005 01:05:23 +0000 Subject: [PATCH] Updated Mac code to reflect setting changes which were implemented in other versions git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@357 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/macosx/SettingsMACOSX.cxx | 32 +++++++++++++++++----------- stella/src/macosx/mainSDL.cxx | 6 +++--- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/stella/src/macosx/SettingsMACOSX.cxx b/stella/src/macosx/SettingsMACOSX.cxx index bf6460140..85702394b 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.2 2004-08-02 04:08:10 markgrebe Exp $ +// $Id: SettingsMACOSX.cxx,v 1.3 2005-02-18 01:05:23 markgrebe Exp $ //============================================================================ #include @@ -51,17 +51,25 @@ SettingsMACOSX::SettingsMACOSX() if(access(myStateDir.c_str(), R_OK|W_OK|X_OK) != 0 ) mkdir(myStateDir.c_str(), 0777); - myUserPropertiesFile = stelladir + "stella.pro"; - mySystemPropertiesFile = stelladir + "stella.pro"; - myUserConfigFile = ""; - mySystemConfigFile = ""; + string userPropertiesFile = stelladir + "stella.pro"; +// mySystemPropertiesFile = stelladir + "stella.pro"; + string userConfigFile = ""; +// mySystemConfigFile = ""; // Set up the names of the input and output config files - mySettingsOutputFilename = myUserConfigFile; - mySettingsInputFilename = myUserConfigFile; - - mySnapshotFile = ""; - myStateFile = ""; + myConfigOutputFile = userConfigFile; + if (fileExists(userConfigFile)) + myConfigInputFile = userConfigFile; + else + myConfigInputFile = ""; + + myPropertiesOutputFile = userPropertiesFile; + if(fileExists(userPropertiesFile)) + myPropertiesInputFile = userPropertiesFile; +// Êelse if(fileExists(systemPropertiesFile) +// Ê ÊmyPropertiesInputFile = systemPropertiesFile; + else + myPropertiesInputFile = ""; // Now create MacOSX specific settings #ifdef SNAPSHOT_SUPPORT @@ -115,9 +123,7 @@ string SettingsMACOSX::stateFilename(const string& md5, uInt32 state) { ostringstream buf; buf << myStateDir << md5 << ".st" << state; - - myStateFile = buf.str(); - return myStateFile; + return buf.str(); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/macosx/mainSDL.cxx b/stella/src/macosx/mainSDL.cxx index 9bb5614e5..a04898176 100644 --- a/stella/src/macosx/mainSDL.cxx +++ b/stella/src/macosx/mainSDL.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: mainSDL.cxx,v 1.6 2004-08-02 04:08:10 markgrebe Exp $ +// $Id: mainSDL.cxx,v 1.7 2005-02-18 01:05:23 markgrebe Exp $ //============================================================================ #include @@ -924,8 +924,8 @@ bool setupProperties(PropertiesSet& set) { bool useMemList = false; string theAlternateProFile = theSettings->getString("altpro"); - string theUserProFile = theSettings->userPropertiesFilename(); - string theSystemProFile = theSettings->systemPropertiesFilename(); + string theUserProFile = theSettings->propertiesInputFilename(); + string theSystemProFile = theSettings->propertiesOutputFilename(); #ifdef DEVELOPER_SUPPORT // If the user wishes to merge any property modifications to the