This pointer can later on be used to stop, pause & resume playing of the given stream
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3577 4a71c877-e1ca-e34f-864e-861f7616d084
* Modify audio_PlayStream's prototype to match sound_PlayStream's implementation & prototype
* In cdspan_PlayInGameAudio use sasprintf instead of a statically sized array and snprintf
* Add some Doxygen comments
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3276 4a71c877-e1ca-e34f-864e-861f7616d084
* This command will cause the amount of samples in the sound library's queues & lists to be constantly displayed (until turned off) on screen
Patch #887 by Buginator
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3107 4a71c877-e1ca-e34f-864e-861f7616d084
* Apply patch #879 by Buginator (refactored by me to use less handcrafted code, and more functions instead)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3048 4a71c877-e1ca-e34f-864e-861f7616d084
* Upon removing BASE_OBJECTs loop through the lists of outstanding AUDIO_SAMPLEs to delete all of those that refer to this BASE_OBJECT
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3023 4a71c877-e1ca-e34f-864e-861f7616d084
* In the error messages being output, distinguish between a NULL pointer and an empty string
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2890 4a71c877-e1ca-e34f-864e-861f7616d084
* Refactor a linked list iteration to for-loop
* In audio_StopAll() check whether psSample->psObj is marked for deletion (i.e. audio_ObjectDead(psSample->psObj) returns true); if it is, set the pointer to NULL
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2683 4a71c877-e1ca-e34f-864e-861f7616d084
* Remove a dual check of psTrack == NULL in sound_Play2DTrack (is already tested by invoked function sound_CheckTrack)
* sound_GetTrackID now won't loop through a list of 600 pointers to find a match anymore if the given pointer is NULL
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2102 4a71c877-e1ca-e34f-864e-861f7616d084
* Move a large portion of code from audio_SetTrackVals into sound_SetTrackVals (audio_SetTrackVals only checks whether sound is enabled now, the rest of the job is entirely delegated to sound_SetTrackVals)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2084 4a71c877-e1ca-e34f-864e-861f7616d084
* Remove parameter `SDWORD iMaxSameSamples` from sound_Init who's value was only used to set g_iMaxSameSamples
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2081 4a71c877-e1ca-e34f-864e-861f7616d084
* Remove global var g_i3DVolume and audio_Set3DVolume which would set its value since g_i3DVolume was never ever read (well audio_Get3DVolume read it, but this function never got called)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1976 4a71c877-e1ca-e34f-864e-861f7616d084
* remove global var g_bStopAll which seems to function as some kind of crude (and non-functional) mutex lock (while Warzone doesn't even uses threads!)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1961 4a71c877-e1ca-e34f-864e-861f7616d084
* Adapt all code that depends on display3D by either removing if (!display3D){} code or removing the conditional around if(display3D){}
* remove now useless function audio_Display3D (returned display3D) and now unused function audio_Get2DPlayerPos
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1958 4a71c877-e1ca-e34f-864e-861f7616d084
* Change the array iteration code such that it is a bit easier to read
* remove audio_CheckAllUnloaded() which only forwarded to sound_CheckAllUnloaded()
* Add some comments
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1910 4a71c877-e1ca-e34f-864e-861f7616d084
* This conditional compilation is controlled by WZ_NOSOUND (which replaces WZ_NOOGG)
* Remove an unneed inclusion from oggvorbis.h (track.h)
NOTE: This is currently integrated in none of the build systems
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1832 4a71c877-e1ca-e34f-864e-861f7616d084
That is:
* Don't use a custom memory heap implementation anymore
* Remove all usages of HEAP code and replace it with malloc/free
NOTE: MacOSX projectfile probably requires an update
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1820 4a71c877-e1ca-e34f-864e-861f7616d084
* AUDIO_SAMPLE
* remove unused variable iLoops from the struct
* rename bRemove to the more descriptive title of bFinishedPlaying
* change sound_SetupChannel to return a BOOL rather than be return void and throw its output value in a pointer
* make audio_Update() return void (instead of BOOL) since its output value was TRUE always anyway, plus all its callees ignored the output value
* increase readability of lots of functions in audio.c
* remove unused (and nothing doing) functions: audio_StopTrack, audio_SetTrackPan, audio_SetTrackVol and audio_SetTrackFreq
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1444 4a71c877-e1ca-e34f-864e-861f7616d084
* remove ptrlist.c from lib/gamelib/Makefile.raw
* some modifications of char* -> const char*
* modify typedef of audio callback function to take a parameter of `void *psObj` rather than `AUDIO_SAMPLE *psSample` to minimize exposure (psSample->psObj was the only thing used by all callback functions anyway)
* modify all callback functions to match the new typedef's signature
* modify all functions calling callbacks to match the new signature (I think I've got them all, but since passing a pointer to a void* parameter doesn't generate any compiler errors/warnings I might have missed one, which would lead to undefined behaviour)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1442 4a71c877-e1ca-e34f-864e-861f7616d084
* remove wrapping function audio_LoadTrackFromFile from lib/sound/audio.c
* move similar code in sound_LoadTrackFromBuffer and sound_LoadTrackFromFile to a static inline: sound_ConstructTrack (lib/sound/track.c)
* this code also allocates memory for a TRACK and a string using one malloc call, this to make one free call sufficient for cleaning those up (they should _always_ be free'd together anyway, which previously was *not* always the case: memleaks)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1395 4a71c877-e1ca-e34f-864e-861f7616d084
* remove an unused variable from lib/ivis_opengl/piemode.c
* some code refactoring to increase readability, change if branches that handle error conditions to the folowing style:
if (error)
{
deal with the error;
return something (usually false or 0);
}
continue with normal execution path;
* previously was something like: if(not error) {normal execution path;} else {deal with error;}; the above way groups error detection and handling which is more easily readable/understandable
* wrap some if branches from r1374 with curly braces according to Per's advice on the dev mailinglist
* completely get rid of iPriority from struct TRACK (also stripped it out of functions' argumentlists) since the only code that seemed to use it is the removed priority queue implementation
PS someone might want to look at lib/gamelib/audp_parser.y to finalize the modification to audio_SetTrackVals there, I'm not sure whether it will break any code/script if I would simply remove values from the parameter list, so I'm leaving it as is for this moment
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1378 4a71c877-e1ca-e34f-864e-861f7616d084
* remove some unnecessary else branches in audio_SetTrackVals (the if respective if branches really only where error handlers which caused the function to return anyway)
* rename some things in audio_id.c to a more explaining name (i.e. the struct and its members)
* fix some serious abuse of tabs ('\t') in audio_id.c, while the file looks partially good with a tabsize of 4, it looks awful with a tabsize of 8
PS audio_id.c's sole duty seems to be to map sound events to audio files, for the sake of moddability I think we ought to move this out of sources and into scripts.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1372 4a71c877-e1ca-e34f-864e-861f7616d084
* further remove audio_GetIDFromStr from src/aud.c and rename audioID_GetIDFromStr (from audio_id.c) to audio_GetIDFromStr
* also changed calling method of audio_GetIDFromStr, now it returns its retrieved value (ID index number) rather than writing it in a pointer given as parameter
PS MSVC project might be broken, I don't have it so can't check nor fix it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1288 4a71c877-e1ca-e34f-864e-861f7616d084
Fixing type-punned pointers is difficult, especially with that HEAP_ALLOC function...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1252 4a71c877-e1ca-e34f-864e-861f7616d084
- Vector3i from lib/ivis also used in lib/audio, maybe want to move it to some more generic place?
- Replace iPoint with Vector2i
- Remove additional integer type declarations from pietypes.h
- Rename all iSprite to iTexture
- Various warning fixes: Unsigned/signed comparisons, uninitialized variables, declared but not defined symbols
- Replace DEBUG_BLOCK with DEBUG_MALLOC (it was virtually the same)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1245 4a71c877-e1ca-e34f-864e-861f7616d084
r1150 "made it return FALSE when sound is disabled. The attached
patch corrects this, and also removes the redundant function
audio_LoadTrackFromBuffer which was only a very thin wrapper for
sound_LoadTrackFromBuffer. The check if sound is enabled is again in
dataAudioLoad."
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1157 4a71c877-e1ca-e34f-864e-861f7616d084
Mainly explicit casts, some type changes, a few fixes.
We need to have a look if this line creates any problems:
lib/script/interp.c @@ -329,7 +329,7 @@
- if(!RetStackRemember(CurEvent, (ip + 2))) //Remember where to jump back later
+ if(!RetStackRemember(CurEvent, *(ip + 2))) //Remember where to jump back later
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@719 4a71c877-e1ca-e34f-864e-861f7616d084
- Simplify definition of ASSERT(). Now is the same for GCC and MSVC.
This may not work on versions older than MSVC 2005. If you experience this, please report it!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@613 4a71c877-e1ca-e34f-864e-861f7616d084
some things on platforms where 'just char' means unsigned char. Fix lots of
new signedness warnings resulting from that fix (which would have cropped
up on unsigned char platforms anyway). Also implement a small subset of
stdint.h for windows platform in frame.h, hope this does not create any
conflicts. This allows us to use types like uint64_t where relevant.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@569 4a71c877-e1ca-e34f-864e-861f7616d084
more than half the warnings on gcc4, and makes sure we do not
get signedness problems between platforms where char is defined
with different signedness. Also set line-ending properites for
some bison/flex files that did not have it set.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@563 4a71c877-e1ca-e34f-864e-861f7616d084
Same as in r431, but now for lib/
- converted the sources in lib/ to use full path includes instead of just the filename.
- marked places where lib/ivis_*implementation* (eg opengl) is needed, because of incomplete lib/ivis_common.
Should improve the understanding of interfaces and code organization.
(Also fixed a double slash (//) include in src/multimenu.c)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@432 4a71c877-e1ca-e34f-864e-861f7616d084