# ChangeLog for games-strategy/scorched3d
# Copyright 2000-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-strategy/scorched3d/ChangeLog,v 1.37 2006/10/29 23:36:24 nyhm Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-strategy/scorched3d/ChangeLog,v 1.38 2006/11/15 11:08:05 nyhm Exp $
+
+*scorched3d-40.1c (15 Nov 2006)
+
+ 15 Nov 2006; Tristan Heaven <nyhm@gentoo.org>
+ -files/scorched3d-40.1b-freealut.patch,
+ +files/scorched3d-40.1c-freealut.patch, -scorched3d-40.1b.ebuild,
+ +scorched3d-40.1c.ebuild:
+ Version bump
*scorched3d-40.1b (29 Oct 2006)
--- /dev/null
+MD5 a45c9446af99c943a19a4c9a7602531f Scorched3D-40.1c-src.tar.gz 55063066
+RMD160 24f6050e590624d1d44dbabfa55e599cbacfba37 Scorched3D-40.1c-src.tar.gz 55063066
+SHA256 7fd57324bd930857e29f1caf8f2ff3b42f975f1639305050ed5043ec28c2ce85 Scorched3D-40.1c-src.tar.gz 55063066
--- /dev/null
+--- configure
++++ configure
+@@ -4010,6 +4010,7 @@
+
+ CFLAGS="$CFLAGS `$FREEALUT_CONFIG --cflags`"
+ CXXFLAGS="$CXXFLAGS `$FREEALUT_CONFIG --cflags`"
++ LIBS="$LIBS `$FREEALUT_CONFIG --libs`"
+
+ echo "$as_me:$LINENO: result: yes" >&5
+ echo "${ECHO_T}yes" >&6
+
+--- src/sound/SoundBufferStaticWav.cpp
++++ src/sound/SoundBufferStaticWav.cpp
+@@ -57,44 +57,7 @@
+ SoundBuffer(fileName),
+ buffer_(0)
+ {
+- unsigned int error;
+-
+- // Create a buffer
+- alGetError();
+- alGenBuffers(1, &buffer_);
+- if ((error = alGetError()) != AL_NO_ERROR)
+- {
+- return;
+- }
+-
+- // Load WAV
+- void *data;
+- ALenum format;
+- ALsizei size;
+- ALsizei freq;
+- ALboolean loop;
+-
+-#ifdef __DARWIN__
+- alutLoadWAVFile((ALbyte*) fileName,&format,&data,&size,&freq);
+-#else
+- alutLoadWAVFile((ALbyte*) fileName,&format,&data,&size,&freq,&loop);
+-#endif
+-
+- if ((error = alGetError()) != AL_NO_ERROR)
+- {
+- return;
+- }
+-
+- // Load WAV into buffer
+- alBufferData(buffer_,format,data,size,freq);
+- if ((error = alGetError()) != AL_NO_ERROR)
+- {
+- return;
+- }
+-
+- // Delete WAV memory
+- alutUnloadWAV(format,data,size,freq);
+- if ((error = alGetError()) != AL_NO_ERROR)
++ if ((buffer_ = alutCreateBufferFromFile(fileName)) == AL_NONE)
+ {
+ return;
+ }
+
+--- src/sound/Sound.cpp
++++ src/sound/Sound.cpp
+@@ -152,6 +152,7 @@
+ totalSources_.push_back(source);
+ availableSources_.push_back(source);
+ }
++ alutInitWithoutContext(NULL, NULL);
+
+ init_ = true;
+ return init_;
--- /dev/null
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-strategy/scorched3d/scorched3d-40.1c.ebuild,v 1.1 2006/11/15 11:08:05 nyhm Exp $
+
+inherit eutils wxwidgets games
+
+DESCRIPTION="Multi-player tank battle in 3D (OpenGL)"
+HOMEPAGE="http://www.scorched3d.co.uk/"
+SRC_URI="mirror://sourceforge/${PN}/Scorched3D-${PV}-src.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="mysql"
+
+DEPEND="virtual/opengl
+ virtual/glu
+ media-libs/libogg
+ media-libs/libvorbis
+ media-libs/openal
+ media-libs/freealut
+ media-libs/libsdl
+ media-libs/sdl-net
+ >=x11-libs/wxGTK-2.6
+ >=media-libs/freetype-2
+ mysql? ( dev-db/mysql )"
+
+S=${WORKDIR}/scorched
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${P}-freealut.patch
+}
+
+pkg_setup() {
+ games_pkg_setup
+ WX_GTK_VER="2.6" need-wxwidgets unicode
+}
+
+src_compile() {
+ egamesconf \
+ --disable-dependency-tracking \
+ --datadir="${GAMES_DATADIR}/${PN}" \
+ --with-docdir="/usr/share/doc/${PF}" \
+ --with-wx-config="${WX_CONFIG}" \
+ $(use_with mysql) \
+ || die
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+ prepgamesdirs
+}