[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src sound.cpp game.cpp preferences.cpp ...
From: |
Jon Daniel |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src sound.cpp game.cpp preferences.cpp ... |
Date: |
Sun, 31 Jul 2005 16:22:08 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Jon Daniel <address@hidden> 05/07/31 20:22:08
Modified files:
src : sound.cpp game.cpp preferences.cpp
preferences.hpp
Log message:
workaround a gcc-3.3 bug which causes a member function with the same
name as a namespace to result in syntax errors.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/sound.cpp.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/game.cpp.diff?tr1=1.267&tr2=1.268&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/preferences.cpp.diff?tr1=1.165&tr2=1.166&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/preferences.hpp.diff?tr1=1.60&tr2=1.61&r1=text&r2=text
Patches:
Index: wesnoth/src/game.cpp
diff -u wesnoth/src/game.cpp:1.267 wesnoth/src/game.cpp:1.268
--- wesnoth/src/game.cpp:1.267 Sun Jul 31 18:56:58 2005
+++ wesnoth/src/game.cpp Sun Jul 31 20:22:08 2005
@@ -1,4 +1,4 @@
-/* $Id: game.cpp,v 1.267 2005/07/31 18:56:58 j_daniel Exp $ */
+/* $Id: game.cpp,v 1.268 2005/07/31 20:22:08 j_daniel Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -228,7 +228,7 @@
}
}
- if (preferences::sound() || preferences::music()) {
+ if (preferences::sound_on() || preferences::music_on()) {
if(!sound::init_sound()) {
preferences::set_sound(false);
preferences::set_music(false);
Index: wesnoth/src/preferences.cpp
diff -u wesnoth/src/preferences.cpp:1.165 wesnoth/src/preferences.cpp:1.166
--- wesnoth/src/preferences.cpp:1.165 Sun Jul 31 19:40:39 2005
+++ wesnoth/src/preferences.cpp Sun Jul 31 20:22:08 2005
@@ -1,4 +1,4 @@
-/* $Id: preferences.cpp,v 1.165 2005/07/31 19:40:39 j_daniel Exp $ */
+/* $Id: preferences.cpp,v 1.166 2005/07/31 20:22:08 j_daniel Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -448,36 +448,36 @@
prefs["message_bell"] = (ison ? "yes" : "no");
}
-bool sound() {
+bool sound_on() {
return prefs["sound"] != "no";
}
bool set_sound(bool ison) {
- if(!sound() && ison) {
+ if(!sound_on() && ison) {
prefs["sound"] = "yes";
- if(!music()) {
+ if(!music_on()) {
if(!sound::init_sound()) {
prefs["sound"] = "no";
return false;
}
}
- } else if(sound() && !ison) {
+ } else if(sound_on() && !ison) {
prefs["sound"] = "no";
sound::stop_sound();
- if(!music())
+ if(!music_on())
sound::close_sound();
}
return true;
}
-bool music() {
+bool music_on() {
return prefs["music"] != "no";
}
bool set_music(bool ison) {
- if(!music() && ison) {
+ if(!music_on() && ison) {
prefs["music"] = "yes";
- if(!sound()) {
+ if(!sound_on()) {
if(!sound::init_sound()) {
prefs["music"] = "no";
return false;
@@ -485,9 +485,9 @@
}
else
sound::play_music("");
- } else if(music() && !ison) {
+ } else if(music_on() && !ison) {
prefs["music"] = "no";
- if(!sound())
+ if(!sound_on())
sound::close_sound();
else
sound::stop_music();
@@ -918,14 +918,14 @@
maximum<unsigned>(scroll_label_.width(),
gamma_label_.width())));
- sound_button_.set_check(sound());
+ sound_button_.set_check(sound_on());
sound_button_.set_help_string(_("Sound on/off"));
sound_slider_.set_min(0);
sound_slider_.set_max(128);
sound_slider_.set_value(sound_volume());
sound_slider_.set_help_string(_("Change the sound effects volume"));
- music_button_.set_check(music());
+ music_button_.set_check(music_on());
music_button_.set_help_string(_("Music on/off"));
music_slider_.set_min(0);
music_slider_.set_max(128);
Index: wesnoth/src/preferences.hpp
diff -u wesnoth/src/preferences.hpp:1.60 wesnoth/src/preferences.hpp:1.61
--- wesnoth/src/preferences.hpp:1.60 Sun Jul 31 19:40:39 2005
+++ wesnoth/src/preferences.hpp Sun Jul 31 20:22:08 2005
@@ -1,4 +1,4 @@
-/* $Id: preferences.hpp,v 1.60 2005/07/31 19:40:39 j_daniel Exp $ */
+/* $Id: preferences.hpp,v 1.61 2005/07/31 20:22:08 j_daniel Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -55,13 +55,15 @@
const std::string& language();
void set_language(const std::string& s);
- bool sound();
+ // don't rename it to sound() because of a gcc-3.3 branch bug
+ // which will cause it to conflict with the sound namespace
+ bool sound_on();
bool set_sound(bool ison);
int sound_volume();
void set_sound_volume(int vol);
- bool music();
+ bool music_on();
bool set_music(bool ison);
int music_volume();
Index: wesnoth/src/sound.cpp
diff -u wesnoth/src/sound.cpp:1.32 wesnoth/src/sound.cpp:1.33
--- wesnoth/src/sound.cpp:1.32 Sun Jul 31 18:56:58 2005
+++ wesnoth/src/sound.cpp Sun Jul 31 20:22:08 2005
@@ -1,4 +1,4 @@
-/* $Id: sound.cpp,v 1.32 2005/07/31 18:56:58 j_daniel Exp $ */
+/* $Id: sound.cpp,v 1.33 2005/07/31 20:22:08 j_daniel Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
@@ -135,7 +135,7 @@
current_music = file;
- if(preferences::music() && mix_ok) {
+ if(preferences::music_on() && mix_ok) {
std::map<std::string,Mix_Music*>::const_iterator itor =
music_cache.find(file);
if(itor == music_cache.end()) {
const std::string& filename =
get_binary_file_location("music",file);
@@ -168,7 +168,7 @@
void play_sound(const std::string& file)
{
- if(preferences::sound() && mix_ok) {
+ if(preferences::sound_on() && mix_ok) {
// the insertion will fail if there is already an element in
the cache
std::pair< std::map< std::string, Mix_Chunk * >::iterator, bool
>
it = sound_cache.insert(std::make_pair(file, (Mix_Chunk
*)0));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src sound.cpp game.cpp preferences.cpp ...,
Jon Daniel <=