| 1 | //============================================================================ |
| 2 | // |
| 3 | // SSSS tt lll lll |
| 4 | // SS SS tt ll ll |
| 5 | // SS tttttt eeee ll ll aaaa |
| 6 | // SSSS tt ee ee ll ll aa |
| 7 | // SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" |
| 8 | // SS SS tt ee ll ll aa aa |
| 9 | // SSSS ttt eeeee llll llll aaaaa |
| 10 | // |
| 11 | // Copyright (c) 1995-2019 by Bradford W. Mott, Stephen Anthony |
| 12 | // and the Stella Team |
| 13 | // |
| 14 | // See the file "License.txt" for information on usage and redistribution of |
| 15 | // this file, and for a DISCLAIMER OF ALL WARRANTIES. |
| 16 | //============================================================================ |
| 17 | |
| 18 | #include "Dialog.hxx" |
| 19 | #include "FrameBufferConstants.hxx" |
| 20 | #include "OptionsDialog.hxx" |
| 21 | #include "StellaSettingsDialog.hxx" |
| 22 | #include "FrameBuffer.hxx" |
| 23 | #include "bspf.hxx" |
| 24 | #include "Menu.hxx" |
| 25 | |
| 26 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 27 | Menu::(OSystem& osystem) |
| 28 | : DialogContainer(osystem), |
| 29 | stellaSettingDialog(nullptr), |
| 30 | optionsDialog(nullptr) |
| 31 | { |
| 32 | } |
| 33 | |
| 34 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 35 | Menu::() |
| 36 | { |
| 37 | delete stellaSettingDialog; stellaSettingDialog = nullptr; |
| 38 | delete optionsDialog; optionsDialog = nullptr; |
| 39 | } |
| 40 | |
| 41 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| 42 | Dialog* Menu::() |
| 43 | { |
| 44 | if (myOSystem.settings().getBool("basic_settings" )) |
| 45 | { |
| 46 | if (stellaSettingDialog == nullptr) |
| 47 | stellaSettingDialog = new StellaSettingsDialog(myOSystem, *this, myOSystem.frameBuffer().font(), |
| 48 | FBMinimum::Width, FBMinimum::Height, AppMode::emulator); |
| 49 | return stellaSettingDialog; |
| 50 | } |
| 51 | else |
| 52 | { |
| 53 | if (optionsDialog == nullptr) |
| 54 | optionsDialog = new OptionsDialog(myOSystem, *this, nullptr, |
| 55 | FBMinimum::Width, FBMinimum::Height, AppMode::emulator); |
| 56 | return optionsDialog; |
| 57 | } |
| 58 | } |
| 59 | |