mirror of https://github.com/stella-emu/stella.git
Fixed compile warnings under clang:
- multiline IF statements should have braces - override keyword not being used when overriding virtual methods
This commit is contained in:
parent
46f2ae0cab
commit
1fa3f0cf0d
|
@ -59,7 +59,7 @@ GameInfoDialog::GameInfoDialog(
|
||||||
StaticTextWidget* t;
|
StaticTextWidget* t;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
_w = 52 * fontWidth + 8;
|
_w = 52 * fontWidth + 8;
|
||||||
_h = 9 * (lineHeight + vGap) + vBorder * 2 + buttonHeight + fontHeight + ifont.getLineHeight() + 20;
|
_h = 9 * (lineHeight + vGap) + vBorder * 2 + buttonHeight + fontHeight + ifont.getLineHeight() + 20;
|
||||||
|
|
||||||
// The tab widget
|
// The tab widget
|
||||||
|
@ -79,7 +79,7 @@ GameInfoDialog::GameInfoDialog(
|
||||||
myName = new EditTextWidget(myTab, font, xpos+lwidth, ypos-1,
|
myName = new EditTextWidget(myTab, font, xpos+lwidth, ypos-1,
|
||||||
fwidth, lineHeight, "");
|
fwidth, lineHeight, "");
|
||||||
wid.push_back(myName);
|
wid.push_back(myName);
|
||||||
|
|
||||||
ypos += lineHeight + vGap;
|
ypos += lineHeight + vGap;
|
||||||
new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight,
|
new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight,
|
||||||
"MD5", kTextAlignLeft);
|
"MD5", kTextAlignLeft);
|
||||||
|
@ -183,7 +183,7 @@ GameInfoDialog::GameInfoDialog(
|
||||||
wid.clear();
|
wid.clear();
|
||||||
tabID = myTab->addTab("Controller");
|
tabID = myTab->addTab("Controller");
|
||||||
|
|
||||||
ypos = vBorder;
|
ypos = vBorder;
|
||||||
pwidth = font.getStringWidth("Paddles_IAxis");
|
pwidth = font.getStringWidth("Paddles_IAxis");
|
||||||
t = new StaticTextWidget(myTab, font, hSpace, ypos+1, "P0 Controller ", kTextAlignLeft);
|
t = new StaticTextWidget(myTab, font, hSpace, ypos+1, "P0 Controller ", kTextAlignLeft);
|
||||||
ctrls.clear();
|
ctrls.clear();
|
||||||
|
@ -215,13 +215,13 @@ GameInfoDialog::GameInfoDialog(
|
||||||
myP1Controller = new PopUpWidget(myTab, font, t->getRight(), t->getTop()-1,
|
myP1Controller = new PopUpWidget(myTab, font, t->getRight(), t->getTop()-1,
|
||||||
pwidth, lineHeight, ctrls, "", 0, kRightCChanged);
|
pwidth, lineHeight, ctrls, "", 0, kRightCChanged);
|
||||||
wid.push_back(myP1Controller);
|
wid.push_back(myP1Controller);
|
||||||
|
|
||||||
//ypos += lineHeight + vGap;
|
//ypos += lineHeight + vGap;
|
||||||
mySwapPorts = new CheckboxWidget(myTab, font, myP0Controller->getRight() + fontWidth*5, myP0Controller->getTop()+1,
|
mySwapPorts = new CheckboxWidget(myTab, font, myP0Controller->getRight() + fontWidth*5, myP0Controller->getTop()+1,
|
||||||
"Swap Ports");
|
"Swap Ports");
|
||||||
wid.push_back(mySwapPorts);
|
wid.push_back(mySwapPorts);
|
||||||
//ypos += lineHeight + vGap;
|
//ypos += lineHeight + vGap;
|
||||||
mySwapPaddles = new CheckboxWidget(myTab, font, myP1Controller->getRight() + fontWidth*5, myP1Controller->getTop()+1,
|
mySwapPaddles = new CheckboxWidget(myTab, font, myP1Controller->getRight() + fontWidth*5, myP1Controller->getTop()+1,
|
||||||
"Swap Paddles");
|
"Swap Paddles");
|
||||||
wid.push_back(mySwapPaddles);
|
wid.push_back(mySwapPaddles);
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ GameInfoDialog::GameInfoDialog(
|
||||||
myEraseEEPROMLabel = new StaticTextWidget(myTab, font, hSpace, ypos, "AtariVox/SaveKey ");
|
myEraseEEPROMLabel = new StaticTextWidget(myTab, font, hSpace, ypos, "AtariVox/SaveKey ");
|
||||||
myEraseEEPROMButton = new ButtonWidget(myTab, font, myEraseEEPROMLabel->getRight(), ypos - 4,
|
myEraseEEPROMButton = new ButtonWidget(myTab, font, myEraseEEPROMLabel->getRight(), ypos - 4,
|
||||||
"Erase EEPROM", kEEButtonPressed);
|
"Erase EEPROM", kEEButtonPressed);
|
||||||
myEraseEEPROMInfo = new StaticTextWidget(myTab, ifont, myEraseEEPROMButton->getRight() + 4, myEraseEEPROMLabel->getTop() + 3,
|
myEraseEEPROMInfo = new StaticTextWidget(myTab, ifont, myEraseEEPROMButton->getRight() + 4, myEraseEEPROMLabel->getTop() + 3,
|
||||||
"(for this game only)");
|
"(for this game only)");
|
||||||
|
|
||||||
ypos += lineHeight + vGap * 4;
|
ypos += lineHeight + vGap * 4;
|
||||||
|
@ -332,8 +332,8 @@ GameInfoDialog::GameInfoDialog(
|
||||||
myPhosphor = new CheckboxWidget(myTab, font, hSpace, ypos+1, "Use Phosphor", kPhosphorChanged);
|
myPhosphor = new CheckboxWidget(myTab, font, hSpace, ypos+1, "Use Phosphor", kPhosphorChanged);
|
||||||
wid.push_back(myPhosphor);
|
wid.push_back(myPhosphor);
|
||||||
|
|
||||||
myPPBlend = new SliderWidget(myTab, font,
|
myPPBlend = new SliderWidget(myTab, font,
|
||||||
myPhosphor->getRight() + 16, myPhosphor->getTop()-2,
|
myPhosphor->getRight() + 16, myPhosphor->getTop()-2,
|
||||||
8*fontWidth, lineHeight, "Blend ",
|
8*fontWidth, lineHeight, "Blend ",
|
||||||
font.getStringWidth("Blend "),
|
font.getStringWidth("Blend "),
|
||||||
kPPBlendChanged);
|
kPPBlendChanged);
|
||||||
|
@ -518,7 +518,7 @@ void GameInfoDialog::saveConfig()
|
||||||
myGameProperties.set(Display_Height, myHeightLabel->getLabel() == "Auto" ? "0" :
|
myGameProperties.set(Display_Height, myHeightLabel->getLabel() == "Auto" ? "0" :
|
||||||
myHeightLabel->getLabel());
|
myHeightLabel->getLabel());
|
||||||
myGameProperties.set(Display_Phosphor, myPhosphor->getState() ? "YES" : "NO");
|
myGameProperties.set(Display_Phosphor, myPhosphor->getState() ? "YES" : "NO");
|
||||||
|
|
||||||
myGameProperties.set(Display_PPBlend, myPPBlendLabel->getLabel() == "Auto" ? "0" :
|
myGameProperties.set(Display_PPBlend, myPPBlendLabel->getLabel() == "Auto" ? "0" :
|
||||||
myPPBlendLabel->getLabel());
|
myPPBlendLabel->getLabel());
|
||||||
|
|
||||||
|
@ -556,15 +556,19 @@ void GameInfoDialog::updateControllerStates(int cmd)
|
||||||
|
|
||||||
// make sure the CompuMate is always selected for both controllers
|
// make sure the CompuMate is always selected for both controllers
|
||||||
if(cmd == kLeftCChanged)
|
if(cmd == kLeftCChanged)
|
||||||
|
{
|
||||||
if(contrP0 == "COMPUMATE")
|
if(contrP0 == "COMPUMATE")
|
||||||
myP1Controller->setSelected("COMPUMATE");
|
myP1Controller->setSelected("COMPUMATE");
|
||||||
else if(contrP1 == "COMPUMATE")
|
else if(contrP1 == "COMPUMATE")
|
||||||
myP1Controller->setSelected(contrP0);
|
myP1Controller->setSelected(contrP0);
|
||||||
|
}
|
||||||
if(cmd == kRightCChanged)
|
if(cmd == kRightCChanged)
|
||||||
|
{
|
||||||
if(contrP1 == "COMPUMATE")
|
if(contrP1 == "COMPUMATE")
|
||||||
myP0Controller->setSelected("COMPUMATE");
|
myP0Controller->setSelected("COMPUMATE");
|
||||||
else if(contrP0 == "COMPUMATE")
|
else if(contrP0 == "COMPUMATE")
|
||||||
myP0Controller->setSelected(contrP1);
|
myP0Controller->setSelected(contrP1);
|
||||||
|
}
|
||||||
|
|
||||||
enableSwapPorts = myP0Controller->getSelectedTag().toString() != "COMPUMATE";
|
enableSwapPorts = myP0Controller->getSelectedTag().toString() != "COMPUMATE";
|
||||||
enableSwapPaddles = string::npos != contrP0.find("PADDLES")
|
enableSwapPaddles = string::npos != contrP0.find("PADDLES")
|
||||||
|
|
|
@ -42,8 +42,8 @@ class PopUpWidget : public Widget, public CommandSender
|
||||||
const string& label, int labelWidth = 0, int cmd = 0);
|
const string& label, int labelWidth = 0, int cmd = 0);
|
||||||
virtual ~PopUpWidget() = default;
|
virtual ~PopUpWidget() = default;
|
||||||
|
|
||||||
int getTop() const { return _y + 1; }
|
int getTop() const override { return _y + 1; }
|
||||||
int getBottom() const { return _y + 1 + getHeight(); }
|
int getBottom() const override { return _y + 1 + getHeight(); }
|
||||||
|
|
||||||
/** Add the given items to the widget. */
|
/** Add the given items to the widget. */
|
||||||
void addItems(const VariantList& items) { myMenu->addItems(items); }
|
void addItems(const VariantList& items) { myMenu->addItems(items); }
|
||||||
|
|
Loading…
Reference in New Issue