Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 269721 Details for
Bug 363395
games-action/teeworlds-0.6.0 version bump
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
fix wavpack loading
teeworlds-0.6.0-002-fixed-wavpack-sound-loading.patch (text/plain), 2.88 KB, created by
Bruno 'brubru' Tarquini
on 2011-04-12 21:27:01 UTC
(
hide
)
Description:
fix wavpack loading
Filename:
MIME Type:
Creator:
Bruno 'brubru' Tarquini
Created:
2011-04-12 21:27:01 UTC
Size:
2.88 KB
patch
obsolete
>From 5a5322491704c14f5aed72148db6b134484cedec Mon Sep 17 00:00:00 2001 >From: xalduin <xalduin@gmail.com> >Date: Sat, 12 Feb 2011 23:58:55 -0500 >Subject: [PATCH 2/3] Fixed wavpack sound loading > >--- > src/engine/client/sound.cpp | 56 ++++++++++++++++++++++++++++++++++++++---- > 1 files changed, 50 insertions(+), 6 deletions(-) > >diff --git a/src/engine/client/sound.cpp b/src/engine/client/sound.cpp >index e38ad32..6101602 100644 >--- a/src/engine/client/sound.cpp >+++ b/src/engine/client/sound.cpp >@@ -49,6 +49,54 @@ 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} }; >@@ -328,14 +376,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) >@@ -345,7 +391,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) > { >@@ -398,13 +444,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.7.3.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 363395
:
269715
|
269717
| 269721 |
269723
|
281847