Add slider for fullscreen ratio
This commit is contained in:
parent
996ac3dab2
commit
7773c9ccca
4 changed files with 115 additions and 43 deletions
|
@ -20,6 +20,10 @@
|
|||
|
||||
const int amigawidth_values[] = { 320, 352, 384, 640, 704, 768 };
|
||||
const int amigaheight_values[] = { 200, 216, 240, 256, 262, 270 };
|
||||
#ifdef RASPBERRY
|
||||
const int FullscreenRatio[] = { 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
|
||||
90, 91, 92, 93, 94, 95, 96, 97 ,98, 99 ,100 };
|
||||
#endif
|
||||
|
||||
static gcn::Window *grpAmigaScreen;
|
||||
static gcn::Label* lblAmigaWidth;
|
||||
|
@ -32,6 +36,11 @@ static gcn::Label* lblVertPos;
|
|||
static gcn::Label* lblVertPosInfo;
|
||||
static gcn::Slider* sldVertPos;
|
||||
static gcn::UaeCheckBox* chkFrameskip;
|
||||
#ifdef RASPBERRY
|
||||
static gcn::Label* lblFSRatio;
|
||||
static gcn::Label* lblFSRatioInfo;
|
||||
static gcn::Slider* sldFSRatio;
|
||||
#endif
|
||||
|
||||
|
||||
class AmigaScreenActionListener : public gcn::ActionListener
|
||||
|
@ -67,6 +76,16 @@ class AmigaScreenActionListener : public gcn::ActionListener
|
|||
{
|
||||
changed_prefs.gfx_framerate = chkFrameskip->isSelected() ? 1 : 0;
|
||||
}
|
||||
#ifdef RASPBERRY
|
||||
else if (actionEvent.getSource() == sldFSRatio)
|
||||
{
|
||||
if(changed_prefs.gfx_fullscreen_ratio != FullscreenRatio[(int)(sldFSRatio->getValue())])
|
||||
{
|
||||
changed_prefs.gfx_fullscreen_ratio = FullscreenRatio[(int)(sldFSRatio->getValue())];
|
||||
RefreshPanelDisplay();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
};
|
||||
AmigaScreenActionListener* amigaScreenActionListener;
|
||||
|
@ -76,64 +95,87 @@ void InitPanelDisplay(const struct _ConfigCategory& category)
|
|||
{
|
||||
amigaScreenActionListener = new AmigaScreenActionListener();
|
||||
|
||||
lblAmigaWidth = new gcn::Label("Width:");
|
||||
lblAmigaWidth->setSize(80, LABEL_HEIGHT);
|
||||
lblAmigaWidth = new gcn::Label("Width:");
|
||||
lblAmigaWidth->setSize(150, LABEL_HEIGHT);
|
||||
lblAmigaWidth->setAlignment(gcn::Graphics::RIGHT);
|
||||
sldAmigaWidth = new gcn::Slider(0, 5);
|
||||
sldAmigaWidth->setSize(160, SLIDER_HEIGHT);
|
||||
sldAmigaWidth->setBaseColor(gui_baseCol);
|
||||
sldAmigaWidth->setMarkerLength(20);
|
||||
sldAmigaWidth->setStepLength(1);
|
||||
sldAmigaWidth->setId("sldWidth");
|
||||
sldAmigaWidth->setMarkerLength(20);
|
||||
sldAmigaWidth->setStepLength(1);
|
||||
sldAmigaWidth->setId("sldWidth");
|
||||
sldAmigaWidth->addActionListener(amigaScreenActionListener);
|
||||
lblAmigaWidthInfo = new gcn::Label("320");
|
||||
|
||||
lblAmigaHeight = new gcn::Label("Height:");
|
||||
lblAmigaHeight->setSize(80, LABEL_HEIGHT);
|
||||
lblAmigaHeight = new gcn::Label("Height:");
|
||||
lblAmigaHeight->setSize(150, LABEL_HEIGHT);
|
||||
lblAmigaHeight->setAlignment(gcn::Graphics::RIGHT);
|
||||
sldAmigaHeight = new gcn::Slider(0, 5);
|
||||
sldAmigaHeight->setSize(160, SLIDER_HEIGHT);
|
||||
sldAmigaHeight->setBaseColor(gui_baseCol);
|
||||
sldAmigaHeight->setMarkerLength(20);
|
||||
sldAmigaHeight->setStepLength(1);
|
||||
sldAmigaHeight->setId("sldHeight");
|
||||
sldAmigaHeight->setMarkerLength(20);
|
||||
sldAmigaHeight->setStepLength(1);
|
||||
sldAmigaHeight->setId("sldHeight");
|
||||
sldAmigaHeight->addActionListener(amigaScreenActionListener);
|
||||
lblAmigaHeightInfo = new gcn::Label("200");
|
||||
|
||||
lblVertPos = new gcn::Label("Vert. offset:");
|
||||
lblVertPos->setSize(80, LABEL_HEIGHT);
|
||||
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->setMarkerLength(20);
|
||||
sldVertPos->setStepLength(1);
|
||||
sldVertPos->setId("sldVertPos");
|
||||
sldVertPos->addActionListener(amigaScreenActionListener);
|
||||
lblVertPosInfo = new gcn::Label("000");
|
||||
|
||||
chkFrameskip = new gcn::UaeCheckBox("Frameskip");
|
||||
|
||||
#ifdef RASPBERRY
|
||||
lblFSRatio = new gcn::Label("Fullscreen Ratio:");
|
||||
lblFSRatio->setSize(150, LABEL_HEIGHT);
|
||||
lblFSRatio->setAlignment(gcn::Graphics::RIGHT);
|
||||
sldFSRatio = new gcn::Slider(0, 20);
|
||||
sldFSRatio->setSize(160, SLIDER_HEIGHT);
|
||||
sldFSRatio->setBaseColor(gui_baseCol);
|
||||
sldFSRatio->setMarkerLength(20);
|
||||
sldFSRatio->setStepLength(1);
|
||||
sldFSRatio->setId("FSRatio");
|
||||
sldFSRatio->addActionListener(amigaScreenActionListener);
|
||||
lblFSRatioInfo = new gcn::Label("100%%");
|
||||
#endif
|
||||
|
||||
chkFrameskip = new gcn::UaeCheckBox("Frameskip");
|
||||
chkFrameskip->addActionListener(amigaScreenActionListener);
|
||||
|
||||
grpAmigaScreen = new gcn::Window("Amiga Screen");
|
||||
grpAmigaScreen->setPosition(DISTANCE_BORDER, DISTANCE_BORDER);
|
||||
grpAmigaScreen = new gcn::Window("Amiga Screen");
|
||||
grpAmigaScreen->setPosition(DISTANCE_BORDER, DISTANCE_BORDER);
|
||||
|
||||
int posY = 10;
|
||||
grpAmigaScreen->add(lblAmigaWidth, 8, posY);
|
||||
grpAmigaScreen->add(sldAmigaWidth, 100, posY);
|
||||
grpAmigaScreen->add(lblAmigaWidthInfo, 100 + sldAmigaWidth->getWidth() + 12, posY);
|
||||
posY += sldAmigaWidth->getHeight() + DISTANCE_NEXT_Y;
|
||||
grpAmigaScreen->add(lblAmigaHeight, 8, posY);
|
||||
grpAmigaScreen->add(sldAmigaHeight, 100, posY);
|
||||
grpAmigaScreen->add(lblAmigaHeightInfo, 100 + sldAmigaHeight->getWidth() + 12, posY);
|
||||
posY += sldAmigaHeight->getHeight() + DISTANCE_NEXT_Y;
|
||||
grpAmigaScreen->add(lblVertPos, 8, posY);
|
||||
grpAmigaScreen->add(sldVertPos, 100, posY);
|
||||
grpAmigaScreen->add(lblVertPosInfo, 100 + sldVertPos->getWidth() + 12, posY);
|
||||
posY += sldVertPos->getHeight() + DISTANCE_NEXT_Y;
|
||||
int posY = 10;
|
||||
grpAmigaScreen->add(lblAmigaWidth, 0, posY);
|
||||
grpAmigaScreen->add(sldAmigaWidth, 160, posY);
|
||||
grpAmigaScreen->add(lblAmigaWidthInfo, 160 + sldAmigaWidth->getWidth() + 12, posY);
|
||||
posY += sldAmigaWidth->getHeight() + DISTANCE_NEXT_Y;
|
||||
grpAmigaScreen->add(lblAmigaHeight, 0, posY);
|
||||
grpAmigaScreen->add(sldAmigaHeight, 160, posY);
|
||||
grpAmigaScreen->add(lblAmigaHeightInfo, 160 + sldAmigaHeight->getWidth() + 12, posY);
|
||||
posY += sldAmigaHeight->getHeight() + DISTANCE_NEXT_Y;
|
||||
grpAmigaScreen->add(lblVertPos, 0, posY);
|
||||
grpAmigaScreen->add(sldVertPos, 160, posY);
|
||||
grpAmigaScreen->add(lblVertPosInfo, 160 + sldVertPos->getWidth() + 12, posY);
|
||||
posY += sldVertPos->getHeight() + DISTANCE_NEXT_Y;
|
||||
|
||||
#ifdef RASPBERRY
|
||||
grpAmigaScreen->add(lblFSRatio, 0, posY);
|
||||
grpAmigaScreen->add(sldFSRatio, 160, posY);
|
||||
grpAmigaScreen->add(lblFSRatioInfo, 160 + sldFSRatio->getWidth() + 12, posY);
|
||||
posY += sldFSRatio->getHeight() + DISTANCE_NEXT_Y;
|
||||
#endif
|
||||
|
||||
|
||||
grpAmigaScreen->setMovable(false);
|
||||
grpAmigaScreen->setSize(320, posY + DISTANCE_BORDER);
|
||||
grpAmigaScreen->setMovable(false);
|
||||
grpAmigaScreen->setSize(460, posY + DISTANCE_BORDER);
|
||||
grpAmigaScreen->setBaseColor(gui_baseCol);
|
||||
|
||||
category.panel->add(grpAmigaScreen);
|
||||
|
@ -157,6 +199,11 @@ void ExitPanelDisplay(void)
|
|||
delete grpAmigaScreen;
|
||||
delete chkFrameskip;
|
||||
delete amigaScreenActionListener;
|
||||
#ifdef RASPBERRY
|
||||
delete lblFSRatio;
|
||||
delete sldFSRatio;
|
||||
delete lblFSRatioInfo;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -187,6 +234,19 @@ void RefreshPanelDisplay(void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef RASPBERRY
|
||||
for(i=0; i<21; ++i)
|
||||
{
|
||||
if(changed_prefs.gfx_fullscreen_ratio == FullscreenRatio[i])
|
||||
{
|
||||
sldFSRatio->setValue(i);
|
||||
snprintf(tmp, 32, "%d%%", changed_prefs.gfx_fullscreen_ratio);
|
||||
lblFSRatioInfo->setCaption(tmp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
sldVertPos->setValue(changed_prefs.pandora_vertical_offset);
|
||||
snprintf(tmp, 32, "%d", changed_prefs.pandora_vertical_offset);
|
||||
lblVertPosInfo->setCaption(tmp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue