mr_bones_ 15/01/06 09:27:01 Added: 01-use-system-wavpack.patch 02-fixed-wavpack-sound-loading.patch 05-cc-cflags.patch 03-use-system-pnglite.patch 04-dedicated.patch Log: version bump (Portage version: 2.2.14/cvs/Linux x86_64, unsigned Manifest commit)
Revision Changes Path 1.1 games-action/teeworlds/files/0.6.3/01-use-system-wavpack.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-action/teeworlds/files/0.6.3/01-use-system-wavpack.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-action/teeworlds/files/0.6.3/01-use-system-wavpack.patch?rev=1.1&content-type=text/plain Index: 01-use-system-wavpack.patch =================================================================== commit 7202b142891ee10771af9f1f3063664d75a38bbc Author: hasufell <hasuf...@gentoo.org> Date: Thu Sep 5 12:28:30 2013 +0200 Use system wavpack. Based on patch from Gentoo Bugzilla From: Azamat H. Hackimov <azamat.hacki...@gmail.com> https://bugs.gentoo.org/show_bug.cgi?id=363395 diff --git a/bam.lua b/bam.lua index 11ac7b9..35c1d8d 100644 --- a/bam.lua +++ b/bam.lua @@ -11,6 +11,7 @@ config:Add(OptTestCompileC("stackprotector", "int main(){return 0;}", "-fstack-p config:Add(OptTestCompileC("minmacosxsdk", "int main(){return 0;}", "-mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk")) config:Add(OptTestCompileC("macosxppc", "int main(){return 0;}", "-arch ppc")) config:Add(OptLibrary("zlib", "zlib.h", false)) +config:Add(OptLibrary("wavpack", "wavpack/wavpack.h", false)) config:Add(SDL.OptFind("sdl", true)) config:Add(FreeType.OptFind("freetype", true)) config:Finalize("config.lua") @@ -187,7 +188,7 @@ function build(settings) end -- compile zlib if needed - if config.zlib.value == 1 then + if config.zlib.value == true then settings.link.libs:Add("z") if config.zlib.include_path then settings.cc.includes:Add(config.zlib.include_path) @@ -198,8 +199,18 @@ function build(settings) settings.cc.includes:Add("src/engine/external/zlib") end + if config.wavpack.value == true then + settings.link.libs:Add("wavpack") + if config.wavpack.include_path then + settings.cc.includes:Add(config.wavpack.include_path) + end + wavpack = {} + else + wavpack = Compile(settings, Collect("src/engine/external/wavpack/*.c")) + settings.cc.includes:Add("src/engine/external/") --The header is wavpack/wavpack.h so include the external folder + end + -- build the small libraries - wavpack = Compile(settings, Collect("src/engine/external/wavpack/*.c")) pnglite = Compile(settings, Collect("src/engine/external/pnglite/*.c")) -- build game components diff --git a/src/engine/client/sound.cpp b/src/engine/client/sound.cpp index 343fa2e..e32cac9 100644 --- a/src/engine/client/sound.cpp +++ b/src/engine/client/sound.cpp @@ -13,7 +13,7 @@ #include "sound.h" extern "C" { // wavpack - #include <engine/external/wavpack/wavpack.h> + #include <wavpack/wavpack.h> } #include <math.h> @@ -351,19 +351,25 @@ int CSound::LoadWV(const char *pFilename) if(!m_pStorage) return -1; + #ifndef WAVPACK_H ms_File = m_pStorage->OpenFile(pFilename, IOFLAG_READ, IStorage::TYPE_ALL); if(!ms_File) { dbg_msg("sound/wv", "failed to open file. filename='%s'", pFilename); return -1; } + #endif SampleID = AllocID(); if(SampleID < 0) return -1; pSample = &m_aSamples[SampleID]; + #ifndef WAVPACK_H pContext = WavpackOpenFileInput(ReadData, aError); + #else + pContext = WavpackOpenFileInput(pFilename, aError, 0, 0); + #endif if (pContext) { int m_aSamples = WavpackGetNumSamples(pContext); @@ -419,8 +425,10 @@ int CSound::LoadWV(const char *pFilename) dbg_msg("sound/wv", "failed to open %s: %s", pFilename, aError); } + #ifndef WAVPACK_H io_close(ms_File); ms_File = NULL; + #endif if(g_Config.m_Debug) dbg_msg("sound/wv", "loaded %s", pFilename); 1.1 games-action/teeworlds/files/0.6.3/02-fixed-wavpack-sound-loading.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-action/teeworlds/files/0.6.3/02-fixed-wavpack-sound-loading.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-action/teeworlds/files/0.6.3/02-fixed-wavpack-sound-loading.patch?rev=1.1&content-type=text/plain Index: 02-fixed-wavpack-sound-loading.patch =================================================================== commit b96981f5f23b4269108afb465f29a23abbd32ae2 Author: hasufell <hasuf...@gentoo.org> Date: Thu Sep 5 12:31:19 2013 +0200 Fixing wavpack sound loading. Based on Gentoo Bugzilla From: Azamat H. Hackimov <azamat.hacki...@gmail.com> https://bugs.gentoo.org/show_bug.cgi?id=363395 diff --git a/src/engine/client/sound.cpp b/src/engine/client/sound.cpp index e32cac9..2a4c653 100644 --- a/src/engine/client/sound.cpp +++ b/src/engine/client/sound.cpp @@ -51,6 +51,55 @@ struct CVoice int m_X, m_Y; } ; +#ifdef WAVPACK_H +static int32_t ReadBytes(void *pFile, void *pBuffer, int32_t Size) +{ + return (int32_t)io_read((IOHANDLE)pFile, pBuffer, Size); +} +static uint32_t GetPos(void *pFile) +{ + return (uint32_t)io_tell((IOHANDLE)pFile); +} +static int SetPosAbs(void *pFile, uint32_t Offset) +{ + return io_seek((IOHANDLE)pFile, Offset, IOSEEK_START); +} +static int SetPosRel(void *pFile, int32_t Offset, int Mode) +{ + switch(Mode) + { + case SEEK_SET: + Mode = IOSEEK_START; + break; + case SEEK_CUR: + Mode = IOSEEK_CUR; + break; + case SEEK_END: + Mode = IOSEEK_END; + } + return io_seek((IOHANDLE)pFile, Offset, Mode); +} + +//TODO: Fix if 'real' functionality is needed by the wavpack header +static int PushBackByte(void *pFile, int Char) +{ + return io_seek((IOHANDLE)pFile, -1, IOSEEK_CUR); +} +static uint32_t GetLength(void *pFile) +{ + return (uint32_t)io_length((IOHANDLE)pFile); +} +// Essentially assuming this to always be true, should fix if this isn't the case +static int CanSeek(void *pFile) +{ + return pFile != NULL; +} +static WavpackStreamReader CWavpackReader = { + ReadBytes, GetPos, SetPosAbs, SetPosRel, PushBackByte, GetLength, CanSeek, 0 +}; +#endif + + static CSample m_aSamples[NUM_SAMPLES] = { {0} }; static CVoice m_aVoices[NUM_VOICES] = { {0} }; static CChannel m_aChannels[NUM_CHANNELS] = { {255, 0} }; @@ -351,14 +400,12 @@ int CSound::LoadWV(const char *pFilename) if(!m_pStorage) return -1; - #ifndef WAVPACK_H ms_File = m_pStorage->OpenFile(pFilename, IOFLAG_READ, IStorage::TYPE_ALL); if(!ms_File) { dbg_msg("sound/wv", "failed to open file. filename='%s'", pFilename); return -1; } - #endif SampleID = AllocID(); if(SampleID < 0) @@ -368,7 +415,7 @@ int CSound::LoadWV(const char *pFilename) #ifndef WAVPACK_H pContext = WavpackOpenFileInput(ReadData, aError); #else - pContext = WavpackOpenFileInput(pFilename, aError, 0, 0); + pContext = WavpackOpenFileInputEx(&CWavpackReader, ms_File, 0, aError, 0, 0); #endif if (pContext) { @@ -422,13 +469,11 @@ int CSound::LoadWV(const char *pFilename) } else { - dbg_msg("sound/wv", "failed to open %s: %s", pFilename, aError); + dbg_msg("sound/wv", "failed to open '%s': %s", pFilename, aError); } - #ifndef WAVPACK_H io_close(ms_File); ms_File = NULL; - #endif if(g_Config.m_Debug) dbg_msg("sound/wv", "loaded %s", pFilename); 1.1 games-action/teeworlds/files/0.6.3/05-cc-cflags.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-action/teeworlds/files/0.6.3/05-cc-cflags.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-action/teeworlds/files/0.6.3/05-cc-cflags.patch?rev=1.1&content-type=text/plain Index: 05-cc-cflags.patch =================================================================== From: Julian Ospald <hasuf...@gentoo.org> Date: Sun Sep 8 12:25:19 UTC 2013 Subject: respect our gentoo settings this has to be at this place or later otherwise some of our settings would be overwritten --- a/bam.lua +++ b/bam.lua @@ -168,6 +168,8 @@ -- set some platform specific settings settings.cc.includes:Add("src") + dofile("gentoo.lua") addSettings(settings) + if family == "unix" then if platform == "macosx" then settings.link.frameworks:Add("Carbon") 1.1 games-action/teeworlds/files/0.6.3/03-use-system-pnglite.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-action/teeworlds/files/0.6.3/03-use-system-pnglite.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-action/teeworlds/files/0.6.3/03-use-system-pnglite.patch?rev=1.1&content-type=text/plain Index: 03-use-system-pnglite.patch =================================================================== commit 291a375000ac8d9cd5548a863ea6b49c46cfb1bb Author: hasufell <hasuf...@gentoo.org> Date: Thu Sep 5 12:36:53 2013 +0200 Use system pnglite. Based on Gentoo Bugzilla From: Azamat H. Hackimov <azamat.hacki...@gmail.com> https://bugs.gentoo.org/show_bug.cgi?id=363395 diff --git a/bam.lua b/bam.lua index 35c1d8d..7902a2c 100644 --- a/bam.lua +++ b/bam.lua @@ -11,6 +11,7 @@ config:Add(OptTestCompileC("stackprotector", "int main(){return 0;}", "-fstack-p config:Add(OptTestCompileC("minmacosxsdk", "int main(){return 0;}", "-mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk")) config:Add(OptTestCompileC("macosxppc", "int main(){return 0;}", "-arch ppc")) config:Add(OptLibrary("zlib", "zlib.h", false)) +config:Add(OptLibrary("pnglite", "pnglite.h", false)) config:Add(OptLibrary("wavpack", "wavpack/wavpack.h", false)) config:Add(SDL.OptFind("sdl", true)) config:Add(FreeType.OptFind("freetype", true)) @@ -199,26 +200,34 @@ function build(settings) settings.cc.includes:Add("src/engine/external/zlib") end + -- build game components + engine_settings = settings:Copy() + server_settings = engine_settings:Copy() + client_settings = engine_settings:Copy() + launcher_settings = engine_settings:Copy() + + if config.pnglite.value == true then + client_settings.link.libs:Add("pnglite") + if config.pnglite.include_path then + client_settings.cc.includes:Add(config.pnglite.include_path) + end + pnglite = {} + else + pnglite = Compile(settings, Collect("src/engine/external/pnglite/*.c")) + client_settings.cc.includes:Add("src/engine/external/pnglite") + end + if config.wavpack.value == true then - settings.link.libs:Add("wavpack") + client_settings.link.libs:Add("wavpack") if config.wavpack.include_path then - settings.cc.includes:Add(config.wavpack.include_path) + client_settings.cc.includes:Add(config.wavpack.include_path) end wavpack = {} else wavpack = Compile(settings, Collect("src/engine/external/wavpack/*.c")) - settings.cc.includes:Add("src/engine/external/") --The header is wavpack/wavpack.h so include the external folder + client_settings.cc.includes:Add("src/engine/external/") --The header is wavpack/wavpack.h so include the external folder end - -- build the small libraries - pnglite = Compile(settings, Collect("src/engine/external/pnglite/*.c")) - - -- build game components - engine_settings = settings:Copy() - server_settings = engine_settings:Copy() - client_settings = engine_settings:Copy() - launcher_settings = engine_settings:Copy() - if family == "unix" then if platform == "macosx" then client_settings.link.frameworks:Add("OpenGL") diff --git a/src/engine/client/graphics.cpp b/src/engine/client/graphics.cpp index 2e8a855..97e4fd7 100644 --- a/src/engine/client/graphics.cpp +++ b/src/engine/client/graphics.cpp @@ -9,7 +9,7 @@ #include "SDL_opengl.h" #include <base/system.h> -#include <engine/external/pnglite/pnglite.h> +#include <pnglite.h> #include <engine/shared/config.h> #include <engine/graphics.h> diff --git a/src/engine/client/graphics_threaded.cpp b/src/engine/client/graphics_threaded.cpp index e34b725..60246d1 100644 --- a/src/engine/client/graphics_threaded.cpp +++ b/src/engine/client/graphics_threaded.cpp @@ -6,7 +6,7 @@ #include <base/tl/threading.h> #include <base/system.h> -#include <engine/external/pnglite/pnglite.h> +#include <pnglite.h> #include <engine/shared/config.h> #include <engine/graphics.h> diff --git a/src/tools/dilate.cpp b/src/tools/dilate.cpp index 55094a5..42a5b83 100644 --- a/src/tools/dilate.cpp +++ b/src/tools/dilate.cpp @@ -2,7 +2,7 @@ /* If you are missing that file, acquire a complete release at teeworlds.com. */ #include <base/system.h> #include <base/math.h> -#include <engine/external/pnglite/pnglite.h> +#include <pnglite.h> typedef struct { diff --git a/src/tools/tileset_borderadd.cpp b/src/tools/tileset_borderadd.cpp index 25e2fa5..88f760a 100644 --- a/src/tools/tileset_borderadd.cpp +++ b/src/tools/tileset_borderadd.cpp @@ -2,7 +2,7 @@ /* If you are missing that file, acquire a complete release at teeworlds.com. */ #include <base/math.h> #include <base/system.h> -#include <engine/external/pnglite/pnglite.h> +#include <pnglite.h> typedef struct { diff --git a/src/tools/tileset_borderfix.cpp b/src/tools/tileset_borderfix.cpp index 0facb9a..ab36292 100644 --- a/src/tools/tileset_borderfix.cpp +++ b/src/tools/tileset_borderfix.cpp @@ -1,7 +1,7 @@ /* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ /* If you are missing that file, acquire a complete release at teeworlds.com. */ #include <base/system.h> -#include <engine/external/pnglite/pnglite.h> +#include <pnglite.h> typedef struct { diff --git a/src/tools/tileset_borderrem.cpp b/src/tools/tileset_borderrem.cpp index d604ecb..8673e41 100644 --- a/src/tools/tileset_borderrem.cpp +++ b/src/tools/tileset_borderrem.cpp @@ -2,7 +2,7 @@ /* If you are missing that file, acquire a complete release at teeworlds.com. */ #include <base/math.h> #include <base/system.h> -#include <engine/external/pnglite/pnglite.h> +#include <pnglite.h> typedef struct { diff --git a/src/tools/tileset_borderset.cpp b/src/tools/tileset_borderset.cpp index 8b3e299..c762ee2 100644 --- a/src/tools/tileset_borderset.cpp +++ b/src/tools/tileset_borderset.cpp @@ -2,7 +2,7 @@ /* If you are missing that file, acquire a complete release at teeworlds.com. */ #include <base/math.h> #include <base/system.h> -#include <engine/external/pnglite/pnglite.h> +#include <pnglite.h> typedef struct { 1.1 games-action/teeworlds/files/0.6.3/04-dedicated.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-action/teeworlds/files/0.6.3/04-dedicated.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/games-action/teeworlds/files/0.6.3/04-dedicated.patch?rev=1.1&content-type=text/plain Index: 04-dedicated.patch =================================================================== From: Julian Ospald <hasuf...@gentoo.org> Date: Sun Sep 8 11:05:26 UTC 2013 Subject: fix DATADIR detection for minimal setups --- a/src/engine/shared/storage.cpp +++ b/src/engine/shared/storage.cpp @@ -208,7 +208,7 @@ for (i = 0; i < DirsCount; i++) { char aBuf[128]; - str_format(aBuf, sizeof(aBuf), "%s/mapres", aDirs[i]); + str_format(aBuf, sizeof(aBuf), "%s/maps", aDirs[i]); if(fs_is_dir(aBuf)) { str_copy(m_aDatadir, aDirs[i], sizeof(m_aDatadir));