From 1b0c9ba663f210131654350f4692dcbfc70fb5cf Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Tue, 19 Apr 2005 14:06:01 +0000 Subject: A few random changes. --- src/gui/setup.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'src/gui/setup.cpp') diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 42b770f9..a0be66cc 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -39,15 +39,15 @@ ModeListModel::ModeListModel() SDL_Rect **modes; /* Get available fullscreen/hardware modes */ - modes = SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE); - + modes = SDL_ListModes(NULL, SDL_FULLSCREEN | SDL_HWSURFACE); + /* Check is there are any modes available */ - if(modes == (SDL_Rect **)0) { + if (modes == (SDL_Rect **)0) { logger.log("No modes available"); } - + /* Check if our resolution is restricted */ - if(modes == (SDL_Rect **)-1) { + if (modes == (SDL_Rect **)-1) { logger.log("All resolutions available"); } else{ @@ -64,7 +64,6 @@ ModeListModel::ModeListModel() ModeListModel::~ModeListModel() { - //delete videoModes; } int ModeListModel::getNumberOfElements() @@ -89,7 +88,7 @@ Setup::Setup(): fsCheckBox = new CheckBox("Full screen", false); openGlCheckBox = new CheckBox("OpenGL", false); openGlCheckBox->setEnabled(false); - alphaLabel = new gcn::Label("Gui opacity:"); + alphaLabel = new gcn::Label("Gui opacity"); alphaSlider = new Slider(0.2, 1.0); audioLabel = new gcn::Label("Audio settings"); soundCheckBox = new CheckBox("Sound", false); @@ -128,14 +127,14 @@ Setup::Setup(): applyButton->setPosition( cancelButton->getX() - 5 - applyButton->getWidth(), 216 - 5 - applyButton->getHeight()); - + // Listen for actions applyButton->addActionListener(this); cancelButton->addActionListener(this); alphaSlider->addActionListener(this); sfxSlider->addActionListener(this); musicSlider->addActionListener(this); - + // Assemble dialog add(videoLabel); add(scrollArea); @@ -202,7 +201,7 @@ void Setup::action(const std::string &eventId) else if (eventId == "apply") { setVisible(false); - + if (fsCheckBox->isMarked()) { // Fullscreen config.setValue("screen", 1); displayFlags |= SDL_FULLSCREEN; @@ -211,16 +210,16 @@ void Setup::action(const std::string &eventId) config.setValue("screen", 0); displayFlags &= ~SDL_FULLSCREEN; } - + displayFlags |= SDL_DOUBLEBUF; - + screen = SDL_SetVideoMode(screenW, screenH, bitDepth, displayFlags); if (screen == NULL) { std::cerr << "Couldn't set " << screenW << "x" << screenH << "x" << bitDepth << " video mode: " << SDL_GetError() << std::endl; exit(1); } - + // Sound settings if (soundCheckBox->isMarked()) { config.setValue("sound", 1); @@ -229,7 +228,7 @@ void Setup::action(const std::string &eventId) } catch (const char *err) { new OkDialog(this, "Sound Engine", err); - logger.log("Warning: %s", err); + logger.log("Warning: %s", err); } } else { config.setValue("sound", 0); -- cgit v1.2.3-70-g09d2