This went to the wrong bug previously. Hopefully I'm sending it to the right place this time....
On 6/13/07, Steven Barker <[EMAIL PROTECTED]> wrote:
tags 427904 + patch tags 425096 + patch thanks Attached is a patch that solves the current build issues related to the current versions of guichan and boost-filesystem. I put it together by fixing each compiler error message that I encountered until it worked. The boost linking issue was simple to resolve, though as with the rest of the patch, I don't really know what the deep meaning of the change is (just that the library names are different). The rest of the fixes were related to the new guichan API. Half of these were trivial find/replace jobs (setEventID becomes setActionEventID and so on). Only in one place was there a non-obvious fix needed and I found that simply commenting out that line has few harmful effects. I have marked that line with "XXX FIXME" so it can be found and fixed if it was actually doing something important. The patched version compiles and runs on my system (unstable, amd64). It should be ok on other architectures and systems (but it is untested!). Please let me know if there is anything more I can assist with. Steven Barker [EMAIL PROTECTED]
diff -ru balder2d-1.0~rc1-orig/include/menu/gamesetup.h balder2d-1.0~rc1/include/menu/gamesetup.h --- balder2d-1.0~rc1-orig/include/menu/gamesetup.h 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/include/menu/gamesetup.h 2007-06-12 21:14:12.000000000 -0700 @@ -33,7 +33,7 @@ public: GameSetupMenu(gcn::Container* top, SubMenu* parent); virtual ~GameSetupMenu(); - void action(const std::string& action); + void action(const gcn::ActionEvent& action); private: gcn::Button* backButton; SampleMapWidget* sampleMap; diff -ru balder2d-1.0~rc1-orig/include/menu/mainmenu.h balder2d-1.0~rc1/include/menu/mainmenu.h --- balder2d-1.0~rc1-orig/include/menu/mainmenu.h 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/include/menu/mainmenu.h 2007-06-12 21:00:53.000000000 -0700 @@ -32,7 +32,7 @@ public: MainMenu(gcn::Container* top, Menu* menusystem); virtual ~MainMenu(); - void action(const std::string& action); + void action(const gcn::ActionEvent& action); private: Menu* system; SubMenu* optionsMenu; diff -ru balder2d-1.0~rc1-orig/include/menu/menu.h balder2d-1.0~rc1/include/menu/menu.h --- balder2d-1.0~rc1-orig/include/menu/menu.h 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/include/menu/menu.h 2007-06-12 20:46:50.000000000 -0700 @@ -35,7 +35,7 @@ public: Menu(SoundManager *); virtual ~Menu(); - void action(const std::string& action); + void action(const gcn::ActionEvent& action); bool Run(); static SDLKey lastKeyPressed; // ugly hack for keybinding private: diff -ru balder2d-1.0~rc1-orig/include/menu/numberfield.h balder2d-1.0~rc1/include/menu/numberfield.h --- balder2d-1.0~rc1-orig/include/menu/numberfield.h 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/include/menu/numberfield.h 2007-06-12 22:22:31.000000000 -0700 @@ -25,7 +25,7 @@ { public: NumberField(int n, int maxDigits = 3); - virtual void mousePress(int x, int y, int button); + virtual void mousePressed(gcn::MouseEvent &e); virtual void keyPress (const gcn::Key &key); virtual void draw(gcn::Graphics*); int getValue(); diff -ru balder2d-1.0~rc1-orig/include/menu/options.h balder2d-1.0~rc1/include/menu/options.h --- balder2d-1.0~rc1-orig/include/menu/options.h 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/include/menu/options.h 2007-06-12 21:10:44.000000000 -0700 @@ -31,7 +31,7 @@ public: OptionsMenu(gcn::Container* top, SubMenu* parent); virtual ~OptionsMenu(); - void action(const std::string& action); + void action(const gcn::ActionEvent& action); private: SubMenu* gameSetupMenu; SubMenu* playerSetupMenu; diff -ru balder2d-1.0~rc1-orig/include/menu/playersetup.h balder2d-1.0~rc1/include/menu/playersetup.h --- balder2d-1.0~rc1-orig/include/menu/playersetup.h 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/include/menu/playersetup.h 2007-06-12 21:21:48.000000000 -0700 @@ -34,7 +34,7 @@ public: PlayerSetupMenu(gcn::Container* top, SubMenu* parent); virtual ~PlayerSetupMenu(); - void action(const std::string& action); + void action(const gcn::ActionEvent& action); void BindKey(const gcn::Key& key); private: void RefreshKeys(); diff -ru balder2d-1.0~rc1-orig/include/menu/soundvideo.h balder2d-1.0~rc1/include/menu/soundvideo.h --- balder2d-1.0~rc1-orig/include/menu/soundvideo.h 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/include/menu/soundvideo.h 2007-06-12 21:15:23.000000000 -0700 @@ -31,7 +31,7 @@ public: SoundVideoMenu(gcn::Container* top, SubMenu* parent); virtual ~SoundVideoMenu(); - void action(const std::string& action); + void action(const gcn::ActionEvent& action); private: gcn::Button* backButton; gcn::CheckBox* fullScreenCheckbox; diff -ru balder2d-1.0~rc1-orig/SConstruct balder2d-1.0~rc1/SConstruct --- balder2d-1.0~rc1-orig/SConstruct 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/SConstruct 2007-06-12 22:33:46.000000000 -0700 @@ -11,7 +11,7 @@ import glob files = glob.glob("src/*.cpp") + glob.glob("src/*/*.cpp") + glob.glob("src/*/*.c") -libs = Split('guichan_sdl guichan SDL_image SDL_mixer SDL_gfx python2.4 boost_filesystem') +libs = Split('guichan_sdl guichan SDL_image SDL_mixer SDL_gfx python2.4 boost_filesystem-mt') env.ParseConfig('sdl-config --cflags --libs') env.Program('bin/balder2d',files, LIBS=libs) diff -ru balder2d-1.0~rc1-orig/src/menu/gamesetup.cpp balder2d-1.0~rc1/src/menu/gamesetup.cpp --- balder2d-1.0~rc1-orig/src/menu/gamesetup.cpp 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/src/menu/gamesetup.cpp 2007-06-12 21:17:54.000000000 -0700 @@ -31,7 +31,7 @@ page->setPosition(150,200); backButton = new gcn::Button("Back"); - backButton->setEventId("back"); + backButton->setActionEventId("back"); backButton->addActionListener(this); sampleMap = new SampleMapWidget(ConfigManager::GetMap(), 0, 0, 100, 80); @@ -41,7 +41,7 @@ mapScrollArea = new gcn::ScrollArea(); mapListBox = new gcn::ListBox(); mapListBox->setWidth(400 - mapnameLabel->getWidth()); - mapListBox->setEventId("selectNewMap"); + mapListBox->setActionEventId("selectNewMap"); mapListBox->addActionListener(this); mapDropDown = new gcn::DropDown(maplistModel, mapScrollArea, mapListBox); mapDropDown->setWidth(mapListBox->getWidth()+20); @@ -51,13 +51,13 @@ int time = ConfigManager::GetIntValue("GameSetup", "TimeLimit"); int life = ConfigManager::GetIntValue("GameSetup", "LifeLimit"); scoreLimitSelector = new gcn::CheckBox("Maximum Score", score > 0); - scoreLimitSelector->setEventId("toggleScoreLimit"); + scoreLimitSelector->setActionEventId("toggleScoreLimit"); scoreLimitSelector->addActionListener(this); timeLimitSelector = new gcn::CheckBox("Time (minutes)", time > 0); - timeLimitSelector->setEventId("toggleTimeLimit"); + timeLimitSelector->setActionEventId("toggleTimeLimit"); timeLimitSelector->addActionListener(this); lifeLimitSelector = new gcn::CheckBox("Limited Lives", life > 0); - lifeLimitSelector->setEventId("toggleLifeLimit"); + lifeLimitSelector->setActionEventId("toggleLifeLimit"); lifeLimitSelector->addActionListener(this); scoreLimitValue = new NumberField(score); scoreLimitValue->setEnabled(score > 0); @@ -83,14 +83,14 @@ GameSetupMenu::~GameSetupMenu() {} -void GameSetupMenu::action(const std::string& action) +void GameSetupMenu::action(const gcn::ActionEvent& action) { - if (action == "selectNewMap") + if (action.getId() == "selectNewMap") { ConfigManager::SetMap(maplistModel->getElementAt(mapListBox->getSelected()).c_str()); sampleMap->setSampleMap(ConfigManager::GetMap()); } - else if (action == "toggleScoreLimit") + else if (action.getId() == "toggleScoreLimit") { int score = scoreLimitValue->getValue()*-1; if (0 == score) score = -10; @@ -100,7 +100,7 @@ scoreLimitValue->setVisible(score > 0); ConfigManager::SetIntValue("GameSetup", "ScoreLimit", scoreLimitValue->getValue()); } - else if (action == "toggleTimeLimit") + else if (action.getId() == "toggleTimeLimit") { int time = timeLimitValue->getValue()*-1; if (0 == time) time = 10; @@ -110,7 +110,7 @@ timeLimitValue->setVisible(time > 0); ConfigManager::SetIntValue("GameSetup", "TimeLimit", timeLimitValue->getValue()); } - else if (action == "toggleLifeLimit") + else if (action.getId() == "toggleLifeLimit") { int life = lifeLimitValue->getValue()*-1; if (0 == life) life = -10; @@ -120,7 +120,7 @@ lifeLimitValue->setVisible(life > 0); ConfigManager::SetIntValue("GameSetup", "LifeLimit", lifeLimitValue->getValue()); } - else if (action == "back") + else if (action.getId() == "back") { hide(); parent->show(); diff -ru balder2d-1.0~rc1-orig/src/menu/mainmenu.cpp balder2d-1.0~rc1/src/menu/mainmenu.cpp --- balder2d-1.0~rc1-orig/src/menu/mainmenu.cpp 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/src/menu/mainmenu.cpp 2007-06-12 21:11:25.000000000 -0700 @@ -30,18 +30,18 @@ page->setPosition(150,200); startButton = new gcn::Button("Start New Game"); - startButton->setEventId("startgame"); + startButton->setActionEventId("startgame"); startButton->addActionListener(this); startButton->setWidth(500); optionsButton = new gcn::Button("Options"); - optionsButton->setEventId("optionsMenu"); + optionsButton->setActionEventId("optionsMenu"); optionsButton->addActionListener(this); optionsButton->setWidth(500); quitButton = new gcn::Button("Quit"); quitButton->setWidth(500); - quitButton->setEventId("quitgame"); + quitButton->setActionEventId("quitgame"); quitButton->addActionListener(this); // Add them to the page container @@ -58,10 +58,10 @@ } -void MainMenu::action(const std::string& action) +void MainMenu::action(const gcn::ActionEvent& action) { // Main menu events.******************************************************** - if (action == "optionsMenu") + if (action.getId() == "optionsMenu") { hide(); optionsMenu->show(); diff -ru balder2d-1.0~rc1-orig/src/menu/menu.cpp balder2d-1.0~rc1/src/menu/menu.cpp --- balder2d-1.0~rc1-orig/src/menu/menu.cpp 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/src/menu/menu.cpp 2007-06-12 23:44:03.000000000 -0700 @@ -70,7 +70,7 @@ gcn::Widget::setGlobalFont(font); // create top level wigets we want on all menus - headerImage = new gcn::Image("menu/balderheader.png"); + headerImage = gcn::Image::load("menu/balderheader.png"); headerIcon = new gcn::Icon(headerImage); topContainer->add(headerIcon, 250, 40); @@ -111,7 +111,7 @@ // update the screen SDL_UpdateRect(screen,0,0,0,0); } - Menu::action("saveSettings"); +// Menu::action(ActionEvent(???, "saveSettings")); XXX FIXME: what wiget should send this event? if (startgame) { return true; @@ -119,15 +119,15 @@ return false; } -void Menu::action(const std::string& action) +void Menu::action(const gcn::ActionEvent& action) { // Main menu events.******************************************************** - if (action == "startgame") + if (action.getId() == "startgame") { running = false; startgame = true; } - else if (action == "quitgame") + else if (action.getId() == "quitgame") { running = false; startgame = false; diff -ru balder2d-1.0~rc1-orig/src/menu/numberfield.cpp balder2d-1.0~rc1/src/menu/numberfield.cpp --- balder2d-1.0~rc1-orig/src/menu/numberfield.cpp 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/src/menu/numberfield.cpp 2007-06-12 22:26:30.000000000 -0700 @@ -10,6 +10,8 @@ // // #include <sstream> +#include <guichan/font.hpp> +#include <guichan/graphics.hpp> #include "../../include/menu/numberfield.h" using namespace Balder; @@ -40,11 +42,11 @@ setText(ss.str()); } -void NumberField::mousePress(int x, int y, int button) +void NumberField::mousePressed(MouseEvent& e) { - if (hasMouse() && button == MouseInput::LEFT) + if (e.getButton() == MouseEvent::LEFT) { - mCaretPosition = getFont()->getStringIndexAt(mText, x + mXScroll); + mCaretPosition = getFont()->getStringIndexAt(mText, e.getX() + mXScroll); fixScroll(); } } @@ -102,7 +104,7 @@ graphics->setColor(faceColor); graphics->fillRectangle(Rectangle(0, 0, getWidth(), getHeight())); - if (hasFocus()) + if (isFocused()) { drawCaret(graphics, getWidth()-getFont()->getWidth(mText.substr(mCaretPosition,mText.size())) - 4); } diff -ru balder2d-1.0~rc1-orig/src/menu/options.cpp balder2d-1.0~rc1/src/menu/options.cpp --- balder2d-1.0~rc1-orig/src/menu/options.cpp 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/src/menu/options.cpp 2007-06-12 21:22:29.000000000 -0700 @@ -33,7 +33,7 @@ page->setPosition(150,200); backButton = new gcn::Button("Back"); - backButton->setEventId("back"); + backButton->setActionEventId("back"); backButton->addActionListener(this); std::stringstream ss; @@ -42,29 +42,29 @@ numPlayersLabel = new gcn::Label(ss.str()); morePlayersButton = new gcn::Button("+"); - morePlayersButton->setEventId("morePlayers"); + morePlayersButton->setActionEventId("morePlayers"); morePlayersButton->addActionListener(this); morePlayersButton->setHeight(numPlayersLabel->getHeight()/2); lessPlayersButton = new gcn::Button("-"); - lessPlayersButton->setEventId("lessPlayers"); + lessPlayersButton->setActionEventId("lessPlayers"); lessPlayersButton->addActionListener(this); lessPlayersButton->setHeight(numPlayersLabel->getHeight()/2); lessPlayersButton->setWidth(morePlayersButton->getWidth()); soundVideoButton = new gcn::Button("Sound and Video"); - soundVideoButton->setEventId("soundVideoMenu"); + soundVideoButton->setActionEventId("soundVideoMenu"); soundVideoButton->addActionListener(this); soundVideoButton->setAlignment(0); //alignment is justified left. gameSetupButton = new gcn::Button("Game Setup"); - gameSetupButton->setEventId("gameSetupMenu"); + gameSetupButton->setActionEventId("gameSetupMenu"); gameSetupButton->addActionListener(this); gameSetupButton->setWidth(soundVideoButton->getWidth()); gameSetupButton->setAlignment(0); //alignment is justified left. playersButton = new gcn::Button("Player Setup"); - playersButton->setEventId("playerSetupMenu"); + playersButton->setActionEventId("playerSetupMenu"); playersButton->addActionListener(this); playersButton->setWidth(soundVideoButton->getWidth()); playersButton->setAlignment(0); //alignment is justified left. @@ -87,9 +87,9 @@ { } -void OptionsMenu::action(const std::string& action) +void OptionsMenu::action(const gcn::ActionEvent& action) { - if (action == "morePlayers") + if (action.getId() == "morePlayers") { if (numPlayers < 8) { @@ -100,7 +100,7 @@ ConfigManager::SetNumPlayers(numPlayers); } } - else if (action == "lessPlayers") + else if (action.getId() == "lessPlayers") { if (numPlayers > 1) { @@ -111,22 +111,22 @@ ConfigManager::SetNumPlayers(numPlayers); } } - else if (action == "gameSetupMenu") + else if (action.getId() == "gameSetupMenu") { hide(); gameSetupMenu->show(); } - else if (action == "playerSetupMenu") + else if (action.getId() == "playerSetupMenu") { hide(); playerSetupMenu->show(); } - else if (action == "soundVideoMenu") + else if (action.getId() == "soundVideoMenu") { hide(); soundVideoMenu->show(); } - else if (action == "back") + else if (action.getId() == "back") { hide(); ConfigManager::SaveConfigFile(); diff -ru balder2d-1.0~rc1-orig/src/menu/playersetup.cpp balder2d-1.0~rc1/src/menu/playersetup.cpp --- balder2d-1.0~rc1-orig/src/menu/playersetup.cpp 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/src/menu/playersetup.cpp 2007-06-12 22:29:35.000000000 -0700 @@ -34,7 +34,7 @@ page->setPosition(100,200); backButton = new gcn::Button("Back"); - backButton->setEventId("back"); + backButton->setActionEventId("back"); backButton->addActionListener(this); currentPlayer = 1; @@ -43,33 +43,33 @@ currentPlayerLabel = new gcn::Label(ss.str()); nextPlayerButton = new gcn::Button(" > "); - nextPlayerButton->setEventId("nextPlayer"); + nextPlayerButton->setActionEventId("nextPlayer"); nextPlayerButton->addActionListener(this); prevPlayerButton = new gcn::Button(" < "); - prevPlayerButton->setEventId("prevPlayer"); + prevPlayerButton->setActionEventId("prevPlayer"); prevPlayerButton->addActionListener(this); setRotateRightButton = new KeyBindButton("Rotate Right:", this); - setRotateRightButton->setEventId("bindRight"); + setRotateRightButton->setActionEventId("bindRight"); setRotateRightButton->addActionListener(this); rotateRightLabel = new gcn::Label(ConfigManager::GetPlayerControl(currentPlayer, "right")); setRotateRightButton->setAlignment(0); setRotateLeftButton = new KeyBindButton("Rotate Left:", this); - setRotateLeftButton->setEventId("bindLeft"); + setRotateLeftButton->setActionEventId("bindLeft"); setRotateLeftButton->addActionListener(this); rotateLeftLabel = new gcn::Label(ConfigManager::GetPlayerControl(currentPlayer, "left")); setRotateLeftButton->setAlignment(0); setStickPushButton = new KeyBindButton("Stick/Push Off:", this); - setStickPushButton->setEventId("bindStick"); + setStickPushButton->setActionEventId("bindStick"); setStickPushButton->addActionListener(this); stickPushLabel = new gcn::Label(ConfigManager::GetPlayerControl(currentPlayer, "stick")); setStickPushButton->setAlignment(0); setFireButton = new KeyBindButton("Fire:", this); - setFireButton->setEventId("bindFire"); + setFireButton->setActionEventId("bindFire"); setFireButton->addActionListener(this); fireLabel = new gcn::Label(ConfigManager::GetPlayerControl(currentPlayer, "fire")); setFireButton->setAlignment(0); @@ -89,31 +89,31 @@ playerColor = playerColor >> 8; Uint8 cRed = Uint8(playerColor); - redImage= new gcn::Image("menu/redspectrum.png"); + redImage= gcn::Image::load("menu/redspectrum.png"); redIcon = new gcn::Icon(redImage); redSlider = new gcn::Slider(0, 255); redSlider->setWidth(redIcon->getWidth()); redSlider->setHeight(15); redSlider->setValue(double(cRed)); - redSlider->setEventId("colorChange"); + redSlider->setActionEventId("colorChange"); redSlider->addActionListener(this); - greenImage= new gcn::Image("menu/greenspectrum.png"); + greenImage= gcn::Image::load("menu/greenspectrum.png"); greenIcon = new gcn::Icon(greenImage); greenSlider = new gcn::Slider(0, 255); greenSlider->setWidth(redIcon->getWidth()); greenSlider->setHeight(15); greenSlider->setValue(double(cGreen)); - greenSlider->setEventId("colorChange"); + greenSlider->setActionEventId("colorChange"); greenSlider->addActionListener(this); - blueImage= new gcn::Image("menu/bluespectrum.png"); + blueImage= gcn::Image::load("menu/bluespectrum.png"); blueIcon = new gcn::Icon(blueImage); blueSlider = new gcn::Slider(0, 255); blueSlider->setWidth(redIcon->getWidth()); blueSlider->setHeight(15); blueSlider->setValue(double(cBlue)); - blueSlider->setEventId("colorChange"); + blueSlider->setActionEventId("colorChange"); blueSlider->addActionListener(this); // AI Script list box. @@ -122,7 +122,7 @@ aiScrollArea = new gcn::ScrollArea(); aiListBox = new gcn::ListBox(); aiListBox->setWidth(redIcon->getWidth() - 12); - aiListBox->setEventId("changeAIScript"); + aiListBox->setActionEventId("changeAIScript"); aiListBox->addActionListener(this); aiDropDown = new gcn::DropDown(ailistModel, aiScrollArea, aiListBox); aiDropDown->setWidth(redIcon->getWidth()); @@ -163,10 +163,10 @@ { } -void PlayerSetupMenu::action(const std::string& action) +void PlayerSetupMenu::action(const gcn::ActionEvent& action) { // Player options menu events.********************************************** - if (action == "nextPlayer") + if (action.getId() == "nextPlayer") { if (currentPlayer < ConfigManager::GetNumPlayers()) { @@ -174,7 +174,7 @@ RefreshKeys(); } } - else if (action == "prevPlayer") + else if (action.getId() == "prevPlayer") { if (currentPlayer > 1 ) { @@ -182,36 +182,36 @@ RefreshKeys(); } } - else if (action == "bindRight") + else if (action.getId() == "bindRight") { rotateRightLabel->setCaption(" "); actionToBind = "right"; bindNextKey = true; } - else if (action == "bindLeft") + else if (action.getId() == "bindLeft") { rotateLeftLabel->setCaption(" "); actionToBind = "left"; bindNextKey = true; } - else if (action == "bindStick") + else if (action.getId() == "bindStick") { stickPushLabel->setCaption(" "); actionToBind = "stick"; bindNextKey = true; } - else if (action == "bindFire") + else if (action.getId() == "bindFire") { fireLabel->setCaption(" "); actionToBind = "fire"; bindNextKey = true; } - else if (action == "changeAIScript") + else if (action.getId() == "changeAIScript") { ConfigManager::SetControlType(currentPlayer, ailistModel->getElementAt(aiListBox->getSelected()).c_str()); RefreshKeys(); } - else if (action == "colorChange") + else if (action.getId() == "colorChange") { Uint32 rgbColor = Uint8(redSlider->getValue()); rgbColor = rgbColor << 8; @@ -221,7 +221,7 @@ sampleProbe->setProbeColor((rgbColor << 8) + 0xFF); ConfigManager::SetPlayerColor(currentPlayer, rgbColor); } - else if (action == "back") + else if (action.getId() == "back") { hide(); parent->show(); diff -ru balder2d-1.0~rc1-orig/src/menu/sampleprobewidget.cpp balder2d-1.0~rc1/src/menu/sampleprobewidget.cpp --- balder2d-1.0~rc1-orig/src/menu/sampleprobewidget.cpp 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/src/menu/sampleprobewidget.cpp 2007-06-12 20:58:53.000000000 -0700 @@ -31,7 +31,7 @@ SampleProbeWidget::SampleProbeWidget(): probeFrame(0), probeColor(0) { // Loads sprite for sample probe. - probeSpriteImage = new gcn::Image("probe.png"); + probeSpriteImage = gcn::Image::load("probe.png"); if (probeSpriteImage == 0){ throw "could not load Probe sprite!"; } diff -ru balder2d-1.0~rc1-orig/src/menu/soundvideo.cpp balder2d-1.0~rc1/src/menu/soundvideo.cpp --- balder2d-1.0~rc1-orig/src/menu/soundvideo.cpp 2006-10-15 23:42:21.000000000 -0700 +++ balder2d-1.0~rc1/src/menu/soundvideo.cpp 2007-06-12 21:17:06.000000000 -0700 @@ -30,34 +30,34 @@ page->setPosition(150,200); backButton = new gcn::Button("Back"); - backButton->setEventId("back"); + backButton->setActionEventId("back"); backButton->addActionListener(this); fullScreenCheckbox = new gcn::CheckBox("fullscreen", ConfigManager::GetIntValue("Video", "fullscreen")); - fullScreenCheckbox->setEventId("toggleFullscreen"); + fullScreenCheckbox->setActionEventId("toggleFullscreen"); fullScreenCheckbox->addActionListener(this); soundCheckbox = new gcn::CheckBox("sound", ConfigManager::GetIntValue("Sound", "sound")); - soundCheckbox->setEventId("toggleSound"); + soundCheckbox->setActionEventId("toggleSound"); soundCheckbox->addActionListener(this); musicCheckbox = new gcn::CheckBox("music", ConfigManager::GetIntValue("Sound", "music")); - musicCheckbox->setEventId("toggleMusic"); + musicCheckbox->setActionEventId("toggleMusic"); musicCheckbox->addActionListener(this); fxVolumeLabel = new gcn::Label(" volume"); fxVolumeSlider = new gcn::Slider(); fxVolumeSlider->setSize(200, fxVolumeLabel->getHeight()/2); fxVolumeSlider->setValue(ConfigManager::GetDoubleValue("Sound", "fxvolume")); - fxVolumeSlider->setEventId("fxVolumeChange"); + fxVolumeSlider->setActionEventId("fxVolumeChange"); fxVolumeSlider->addActionListener(this); musicVolumeLabel = new gcn::Label(" volume"); musicVolumeSlider = new gcn::Slider(); musicVolumeSlider->setSize(200, musicVolumeLabel->getHeight()/2); musicVolumeSlider->setValue(ConfigManager::GetDoubleValue("Sound", "musicvolume")); - musicVolumeSlider->setEventId("musicVolumeChange"); + musicVolumeSlider->setActionEventId("musicVolumeChange"); musicVolumeSlider->addActionListener(this); page->add(backButton, 0, 300); @@ -74,32 +74,32 @@ { } -void SoundVideoMenu::action(const std::string& action) +void SoundVideoMenu::action(const gcn::ActionEvent& action) { - if (action == "toggleSound") + if (action.getId() == "toggleSound") { ConfigManager::SetIntValue("Sound", "sound", soundCheckbox->isMarked()); } - else if (action == "toggleMusic") + else if (action.getId() == "toggleMusic") { ConfigManager::SetIntValue("Sound", "music", musicCheckbox->isMarked()); // sound->PlayMusic("menu"); } - else if (action == "fxVolumeChange") + else if (action.getId() == "fxVolumeChange") { Mix_Volume(-1, (int)(MIX_MAX_VOLUME * fxVolumeSlider->getValue())); ConfigManager::SetDoubleValue("Sound", "fxvolume", fxVolumeSlider->getValue()); } - else if (action == "musicVolumeChange") + else if (action.getId() == "musicVolumeChange") { Mix_VolumeMusic(int(MIX_MAX_VOLUME * musicVolumeSlider->getValue())); ConfigManager::SetDoubleValue("Sound", "musicvolume", musicVolumeSlider->getValue()); } - else if (action == "toggleFullscreen") + else if (action.getId() == "toggleFullscreen") { ConfigManager::SetIntValue("Video", "fullscreen", fullScreenCheckbox->isMarked()); } - else if (action == "back") + else if (action.getId() == "back") { hide(); parent->show();