Updates to conditional compilation.

- Don't create certain directories when not needed
- Don't include certain items in ContextMenu when not applicable
This commit is contained in:
Stephen Anthony 2019-05-15 13:30:27 -02:30
parent 5502c4c5fb
commit 3a4e2b7f3b
4 changed files with 49 additions and 35 deletions

View File

@ -48,7 +48,9 @@ TiaOutputWidget::TiaOutputWidget(GuiObject* boss, const GUI::Font& font,
VarList::push_back(l, "Fill to scanline", "scanline");
VarList::push_back(l, "Toggle breakpoint", "bp");
VarList::push_back(l, "Set zoom position", "zoom");
#ifdef PNG_SUPPORT
VarList::push_back(l, "Save snapshot", "snap");
#endif
myMenu = make_unique<ContextMenu>(this, font, l);
}

View File

@ -262,8 +262,11 @@ void OSystem::setConfigPaths()
buildDirIfRequired(myStateDir, myBaseDir + "state");
buildDirIfRequired(myNVRamDir, myBaseDir + "nvram");
#ifdef DEBUGGER_SUPPORT
buildDirIfRequired(myCfgDir, myBaseDir + "cfg");
#endif
#ifdef PNG_SUPPORT
mySnapshotSaveDir = mySettings->getString("snapsavedir");
if(mySnapshotSaveDir == "") mySnapshotSaveDir = defaultSaveDir();
buildDirIfRequired(mySnapshotSaveDir, mySnapshotSaveDir);
@ -271,6 +274,7 @@ void OSystem::setConfigPaths()
mySnapshotLoadDir = mySettings->getString("snaploaddir");
if(mySnapshotLoadDir == "") mySnapshotLoadDir = defaultLoadDir();
buildDirIfRequired(mySnapshotLoadDir, mySnapshotLoadDir);
#endif
myCheatFile = FilesystemNode(myBaseDir + "stella.cht").getPath();
myPaletteFile = FilesystemNode(myBaseDir + "stella.pal").getPath();

View File

@ -174,15 +174,6 @@ class OSystem
*/
void saveConfig();
#ifdef DEBUGGER_SUPPORT
/**
Get the ROM debugger of the system.
@return The debugger object
*/
Debugger& debugger() const { return *myDebugger; }
#endif
#ifdef CHEATCODE_SUPPORT
/**
Get the cheat manager of the system.
@ -192,13 +183,13 @@ class OSystem
CheatManager& cheat() const { return *myCheatManager; }
#endif
#ifdef PNG_SUPPORT
#ifdef DEBUGGER_SUPPORT
/**
Get the PNG handler of the system.
Get the ROM debugger of the system.
@return The PNGlib object
@return The debugger object
*/
PNGLibrary& png() const { return *myPNGLib; }
Debugger& debugger() const { return *myDebugger; }
#endif
#ifdef GUI_SUPPORT
@ -231,6 +222,15 @@ class OSystem
TimeMachine& timeMachine() const { return *myTimeMachine; }
#endif
#ifdef PNG_SUPPORT
/**
Get the PNG handler of the system.
@return The PNGlib object
*/
PNGLibrary& png() const { return *myPNGLib; }
#endif
/**
Set all config file paths for the OSystem.
*/
@ -246,30 +246,36 @@ class OSystem
*/
const string& stateDir() const { return myStateDir; }
/**
Return the full/complete directory name for saving and loading
PNG snapshots.
*/
const string& snapshotSaveDir() const { return mySnapshotSaveDir; }
const string& snapshotLoadDir() const { return mySnapshotLoadDir; }
/**
Return the full/complete directory name for storing nvram
(flash/EEPROM) files.
*/
const string& nvramDir() const { return myNVRamDir; }
/**
Return the full/complete directory name for storing Distella cfg files.
*/
const string& cfgDir() const { return myCfgDir; }
#ifdef CHEATCODE_SUPPORT
/**
This method should be called to get the full path of the cheat file.
@return String representing the full path of the cheat filename.
*/
const string& cheatFile() const { return myCheatFile; }
#endif
#ifdef DEBUGGER_SUPPORT
/**
Return the full/complete directory name for storing Distella cfg files.
*/
const string& cfgDir() const { return myCfgDir; }
#endif
#ifdef PNG_SUPPORT
/**
Return the full/complete directory name for saving and loading
PNG snapshots.
*/
const string& snapshotSaveDir() const { return mySnapshotSaveDir; }
const string& snapshotLoadDir() const { return mySnapshotLoadDir; }
#endif
/**
This method should be called to get the full path of the
@ -483,6 +489,16 @@ class OSystem
// Pointer to audio settings object
unique_ptr<AudioSettings> myAudioSettings;
#ifdef CHEATCODE_SUPPORT
// Pointer to the CheatManager object
unique_ptr<CheatManager> myCheatManager;
#endif
#ifdef DEBUGGER_SUPPORT
// Pointer to the Debugger object
unique_ptr<Debugger> myDebugger;
#endif
#ifdef GUI_SUPPORT
// Pointer to the Menu object
unique_ptr<Menu> myMenu;
@ -497,16 +513,6 @@ class OSystem
unique_ptr<TimeMachine> myTimeMachine;
#endif
#ifdef DEBUGGER_SUPPORT
// Pointer to the Debugger object
unique_ptr<Debugger> myDebugger;
#endif
#ifdef CHEATCODE_SUPPORT
// Pointer to the CheatManager object
unique_ptr<CheatManager> myCheatManager;
#endif
#ifdef PNG_SUPPORT
// PNG object responsible for loading/saving PNG images
unique_ptr<PNGLibrary> myPNGLib;

View File

@ -96,7 +96,9 @@ GlobalPropsDialog::GlobalPropsDialog(GuiObject* boss, const GUI::Font& font)
new StaticTextWidget(this, font, xpos, ypos+1, "Startup mode");
items.clear();
VarList::push_back(items, "Console", "false");
#ifdef DEBUGGER_SUPPORT
VarList::push_back(items, "Debugger", "true");
#endif
myDebug = new PopUpWidget(this, font, xpos+lwidth, ypos,
pwidth, lineHeight, items, "");
wid.push_back(myDebug);