Brought back several PANDORA specific items, using #ifdef PANDORA to enable them conditionally

This commit is contained in:
Dimitris Panokostas 2017-09-29 17:21:56 +02:00
parent 9d8dc58b19
commit 0646927e7a
10 changed files with 274 additions and 39 deletions

View file

@ -21,6 +21,12 @@ static gcn::Window* grpScalingMethod;
static gcn::UaeRadioButton* optAuto;
static gcn::UaeRadioButton* optNearest;
static gcn::UaeRadioButton* optLinear;
#ifdef PANDORA
static gcn::Window *grpAmigaScreen;
static gcn::Label* lblVertPos;
static gcn::Label* lblVertPosInfo;
static gcn::Slider* sldVertPos;
#endif // PANDORA
class AmigaScreenActionListener : public gcn::ActionListener
{
@ -31,6 +37,16 @@ public:
{
changed_prefs.gfx_framerate = chkFrameskip->isSelected() ? 1 : 0;
}
#ifdef PANDORA
else if (actionEvent.getSource() == sldVertPos)
{
if(changed_prefs.pandora_vertical_offset != (int)(sldVertPos->getValue()) + OFFSET_Y_ADJUST)
{
changed_prefs.pandora_vertical_offset = (int)(sldVertPos->getValue()) + OFFSET_Y_ADJUST;
RefreshPanelDisplay();
}
}
#endif // PANDORA
}
};
@ -82,9 +98,37 @@ void InitPanelDisplay(const struct _ConfigCategory& category)
posY += DISTANCE_BORDER + grpScalingMethod->getHeight() + DISTANCE_NEXT_Y;
#ifdef PANDORA
lblVertPos = new gcn::Label("Vert. offset:");
lblVertPos->setSize(150, LABEL_HEIGHT);
lblVertPos->setAlignment(gcn::Graphics::RIGHT);
sldVertPos = new gcn::Slider(-16, 16);
sldVertPos->setSize(160, SLIDER_HEIGHT);
sldVertPos->setBaseColor(gui_baseCol);
sldVertPos->setMarkerLength(20);
sldVertPos->setStepLength(1);
sldVertPos->setId("sldVertPos");
sldVertPos->addActionListener(amigaScreenActionListener);
lblVertPosInfo = new gcn::Label("000");
#endif //PANDORA
chkFrameskip = new gcn::UaeCheckBox("Frameskip");
chkFrameskip->addActionListener(amigaScreenActionListener);
#ifdef PANDORA
grpAmigaScreen = new gcn::Window("Amiga Screen");
grpAmigaScreen->setPosition(DISTANCE_BORDER, DISTANCE_BORDER);
grpAmigaScreen->add(lblVertPos, 0, posY);
grpAmigaScreen->add(sldVertPos, 160, posY);
grpAmigaScreen->add(lblVertPosInfo, 160 + sldVertPos->getWidth() + 12, posY);
posY += sldVertPos->getHeight() + DISTANCE_NEXT_Y;
grpAmigaScreen->setMovable(false);
grpAmigaScreen->setSize(460, posY + DISTANCE_BORDER);
grpAmigaScreen->setBaseColor(gui_baseCol);
category.panel->add(grpAmigaScreen);
#endif //PANDORA
category.panel->add(chkFrameskip, DISTANCE_BORDER, posY);
RefreshPanelDisplay();
@ -95,7 +139,12 @@ void ExitPanelDisplay()
{
delete chkFrameskip;
delete amigaScreenActionListener;
#ifdef PANDORA
delete lblVertPos;
delete sldVertPos;
delete lblVertPosInfo;
delete grpAmigaScreen;
#endif //PANDORA
delete optAuto;
delete optNearest;
delete optLinear;
@ -114,6 +163,11 @@ void RefreshPanelDisplay()
optNearest->setSelected(true);
else if (changed_prefs.scaling_method == 1)
optLinear->setSelected(true);
#ifdef PANDORA
sldVertPos->setValue(changed_prefs.pandora_vertical_offset - OFFSET_Y_ADJUST);
snprintf(tmp, 32, "%d", changed_prefs.pandora_vertical_offset - OFFSET_Y_ADJUST);
lblVertPosInfo->setCaption(tmp);
#endif //PANDORA
}
bool HelpPanelDisplay(std::vector<std::string> &helptext)
@ -124,6 +178,11 @@ bool HelpPanelDisplay(std::vector<std::string> &helptext)
helptext.push_back("and crisp image, but it may come with some distortion if your resolution is not an exact multiple.");
helptext.push_back("\"Linear\" will give you a smoother scaling but some people might find it a bit blurry.");
helptext.push_back("");
#ifdef PANDORA
helptext.push_back("With \"Vert. offset\" you can adjust the position of the first drawn line of the Amiga screen. You can also change");
helptext.push_back("this during emulation with left and right shoulder button and dpad up/down.");
helptext.push_back("");
#endif //PANDORA
helptext.push_back("When you activate \"Frameskip\", only every second frame is drawn. This will improve performance and some");
helptext.push_back("more games are playable.");
return true;