Skip to content

Commit

Permalink
fixed and adjusted build w/o IMAGE_SUPPORT
Browse files Browse the repository at this point in the history
  • Loading branch information
thrust26 committed Jan 31, 2024
1 parent 4388c7a commit 34a9df1
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/emucore/EventHandler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2847,7 +2847,9 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
{ Event::ExitMode, "Exit current Stella menu/mode" },
{ Event::OptionsMenuMode, "Enter Options menu UI" },
{ Event::CmdMenuMode, "Toggle Commands menu UI" },
#ifdef IMAGE_SUPPORT
{ Event::ToggleBezel, "Toggle bezel display" },
#endif
{ Event::HighScoresMenuMode, "Toggle High Scores UI" },
{ Event::PlusRomsSetupMode, "Toggle PlusROMs setup UI" },
{ Event::TogglePauseMode, "Toggle Pause mode" },
Expand Down
4 changes: 2 additions & 2 deletions src/emucore/EventHandler.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ class EventHandler
COMBO_SIZE = 16,
EVENTS_PER_COMBO = 8,
#ifdef IMAGE_SUPPORT
PNG_SIZE = 3,
PNG_SIZE = 4,
#else
PNG_SIZE = 0,
#endif
Expand All @@ -540,7 +540,7 @@ class EventHandler
#else
REFRESH_SIZE = 0,
#endif
EMUL_ACTIONLIST_SIZE = 235 + PNG_SIZE + COMBO_SIZE + REFRESH_SIZE,
EMUL_ACTIONLIST_SIZE = 234 + PNG_SIZE + COMBO_SIZE + REFRESH_SIZE,
MENU_ACTIONLIST_SIZE = 20
;

Expand Down
11 changes: 10 additions & 1 deletion src/gui/GameInfoDialog.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@ void GameInfoDialog::addControllersTab()
void GameInfoDialog::addCartridgeTab()
{
// 4) Cartridge properties
const GUI::Font& ifont = instance().frameBuffer().infoFont();
const int lineHeight = Dialog::lineHeight(),
fontHeight = Dialog::fontHeight(),
VBORDER = Dialog::vBorder(),
Expand Down Expand Up @@ -485,6 +484,9 @@ void GameInfoDialog::addCartridgeTab()
bw, myUrl->getHeight(), ">>", kLinkPressed);
wid.push_back(myUrlButton);

#ifdef IMAGE_SUPPORT
const GUI::Font& ifont = instance().frameBuffer().infoFont();

ypos += lineHeight + VGAP;
new StaticTextWidget(myTab, _font, xpos, ypos + 1, lwidth, fontHeight, "Bezelname");
myBezelName = new EditTextWidget(myTab, _font, xpos + lwidth, ypos - 1,
Expand All @@ -499,6 +501,7 @@ void GameInfoDialog::addCartridgeTab()
ypos += lineHeight + VGAP;
myBezelDetected = new StaticTextWidget(myTab, ifont, xpos + lwidth, ypos,
"'1234567890123456789012345678901234567' selected");
#endif

// Add items for tab 3
addToFocusList(wid, myTab, tabID);
Expand Down Expand Up @@ -894,6 +897,7 @@ void GameInfoDialog::loadCartridgeProperties(const Properties& props)
myNote->setText(props.get(PropType::Cart_Note));
myUrl->setText(props.get(PropType::Cart_Url));

#ifdef IMAGE_SUPPORT
bool autoSelected = false;
string bezelName = props.get(PropType::Bezel_Name);
if(bezelName.empty())
Expand All @@ -910,6 +914,7 @@ void GameInfoDialog::loadCartridgeProperties(const Properties& props)
myBezelDetected->setLabel("auto-selected");
else
myBezelDetected->setLabel("");
#endif

updateLink();
}
Expand Down Expand Up @@ -1026,11 +1031,13 @@ void GameInfoDialog::saveProperties()
myGameProperties.set(PropType::Cart_Rarity, myRarity->getText());
myGameProperties.set(PropType::Cart_Note, myNote->getText());
myGameProperties.set(PropType::Cart_Url, myUrl->getText());
#ifdef IMAGE_SUPPORT
// avoid saving auto-selected bezel names:
if(myBezelName->getText() == Bezel::getName(instance().bezelDir().getPath(), myGameProperties))
myGameProperties.reset(PropType::Bezel_Name);
else
myGameProperties.set(PropType::Bezel_Name, myBezelName->getText());
#endif
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down Expand Up @@ -1616,6 +1623,7 @@ void GameInfoDialog::handleCommand(CommandSender* sender, int cmd,
MediaFactory::openURL(myUrl->getText());
break;

#ifdef IMAGE_SUPPORT
case kBezelFilePressed:
BrowserDialog::show(this, _font, "Select bezel image",
instance().bezelDir().getPath() + myBezelName->getText(),
Expand All @@ -1631,6 +1639,7 @@ void GameInfoDialog::handleCommand(CommandSender* sender, int cmd,
return BSPF::endsWithIgnoreCase(node.getName(), ".png");
});
break;
#endif

case EditTextWidget::kChangedCmd:
if(id == kLinkId)
Expand Down
2 changes: 1 addition & 1 deletion src/gui/RomInfoWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void RomInfoWidget::parseProperties(const FSNode& node, bool full)
+ (isPlusCart ? " - PlusROM" : "")
+ buf.str());
}
#ifdef DEBUG_BUILD
#if DEBUG_BUILD && IMAGE_SUPPORT
// Debug bezel properties:
if(myProperties.get(PropType::Bezel_Name).empty())
myRomInfo.push_back("*Bezel: " + Bezel::getName(instance().bezelDir().getPath(), myProperties));
Expand Down
8 changes: 8 additions & 0 deletions src/gui/VideoAudioDialog.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ VideoAudioDialog::VideoAudioDialog(OSystem& osystem, DialogContainer& parent,
addDisplayTab();
addPaletteTab();
addTVEffectsTab();
#ifdef IMAGE_SUPPORT
addBezelTab();
#endif
addAudioTab();

// Add Defaults, OK and Cancel buttons
Expand Down Expand Up @@ -770,6 +772,7 @@ void VideoAudioDialog::loadConfig()
myTVScanMask->setSelected(settings.getString("tv.scanmask"), TIASurface::SETTING_STANDARD);

/////////////////////////////////////////////////////////////////////////////
#ifdef IMAGE_SUPPORT
// Bezel tab
myBezelEnableCheckbox->setState(settings.getBool("bezel.show"));
myBezelPath->setText(settings.getString("bezel.dir"));
Expand All @@ -780,6 +783,7 @@ void VideoAudioDialog::loadConfig()
myWinTopSlider->setValue(settings.getInt("bezel.win.top"));
myWinBottomSlider->setValue(settings.getInt("bezel.win.bottom"));
handleBezelChange();
#endif

/////////////////////////////////////////////////////////////////////////////
// Audio tab
Expand Down Expand Up @@ -905,6 +909,7 @@ void VideoAudioDialog::saveConfig()
settings.setValue("tv.scanmask", myTVScanMask->getSelectedTag());

/////////////////////////////////////////////////////////////////////////////
#ifdef IMAGE_SUPPORT
// Bezel tab
settings.setValue("bezel.show", myBezelEnableCheckbox->getState());
settings.setValue("bezel.dir", myBezelPath->getText());
Expand All @@ -914,6 +919,7 @@ void VideoAudioDialog::saveConfig()
settings.setValue("bezel.win.right", myWinRightSlider->getValueLabel());
settings.setValue("bezel.win.top", myWinTopSlider->getValueLabel());
settings.setValue("bezel.win.bottom", myWinBottomSlider->getValueLabel());
#endif

// Note: The following has to happen after all video related setting have been saved
if(instance().hasConsole())
Expand Down Expand Up @@ -1050,6 +1056,7 @@ void VideoAudioDialog::setDefaults()
break;
}
case 3: // Bezels
#ifdef IMAGE_SUPPORT
myBezelEnableCheckbox->setState(true);
myBezelPath->setText(instance().userDir().getShortPath());
myBezelShowWindowed->setState(false);
Expand All @@ -1058,6 +1065,7 @@ void VideoAudioDialog::setDefaults()
break;

case 4: // Audio
#endif
mySoundEnableCheckbox->setState(AudioSettings::DEFAULT_ENABLED);
myVolumeSlider->setValue(AudioSettings::DEFAULT_VOLUME);
myDevicePopup->setSelected(AudioSettings::DEFAULT_DEVICE);
Expand Down

0 comments on commit 34a9df1

Please sign in to comment.