[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src sound.cpp
From: |
David White |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src sound.cpp |
Date: |
Sun, 29 Aug 2004 11:26:06 -0400 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: David White <address@hidden> 04/08/29 15:21:10
Modified files:
src : sound.cpp
Log message:
fixed sounds to hopefully work well on all systems
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/sound.cpp.diff?tr1=1.20&tr2=1.21&r1=text&r2=text
Patches:
Index: wesnoth/src/sound.cpp
diff -u wesnoth/src/sound.cpp:1.20 wesnoth/src/sound.cpp:1.21
--- wesnoth/src/sound.cpp:1.20 Sat Aug 28 19:34:02 2004
+++ wesnoth/src/sound.cpp Sun Aug 29 15:21:10 2004
@@ -1,4 +1,4 @@
-/* $Id: sound.cpp,v 1.20 2004/08/28 19:34:02 Sirp Exp $ */
+/* $Id: sound.cpp,v 1.21 2004/08/29 15:21:10 Sirp Exp $ */
/*
Copyright (C) 2003 by David White <address@hidden>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -43,7 +43,15 @@
manager::manager()
{
- const int res =
Mix_OpenAudio(MIX_DEFAULT_FREQUENCY,MIX_DEFAULT_FORMAT,2,4096);
+//sounds don't sound good on Windows unless the buffer size is 4k,
+//but this seems to cause crashes on other systems...
+#ifdef WIN32
+ const size_t buf_size = 4096
+#else
+ const size_t buf_size = 1024;
+#endif
+
+ const int res =
Mix_OpenAudio(MIX_DEFAULT_FREQUENCY,MIX_DEFAULT_FORMAT,2,buf_size);
if(res >= 0) {
mix_ok = true;
Mix_AllocateChannels(16);