* Refactor NETlogEntry() to use the array of strings (packetname[]) instead of a large switch-statement with a lot of copy & pasted code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2617 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
* Add some additional info about which track is being asked about into the assert
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2095 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
* in sound_GetAvailableID start looking for available IDs starting from ID_SOUND_NEXT, not zero (0) as that might cause ID collisions when used in conjunction with the hardcoded IDs in audio_id.*
* Make ID_SOUND_MAX be equal to the highest ID number (of the ID set defined in audio_id.*) rather than one more (since this is what "max" suggests: the highest number, not one more than the highest number)
* ID_SOUND_NEXT is now one higher than the highest ID number and can be/is used where one higher is required
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2082 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
* Fix two typos of wrong filenames (these two are not case mismatches) in audio_id.c (one used a ',' instead of '.' and used wav as extension, the other missed a '-')
* Don't use case insensitive matching of filenames in audio_GetIDFromStr anymore as our filesystems aren't guaranteed to be case insensitive (this should cause no problems together with the above fixes)
* Use calloc instead of malloc and a for-loop to allocate an array of NULL pointers in sound_Init
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2076 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
* 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 "-%token <sval> TEXT" from audp_parser.y since it clashed with declarations in MinGW's Windows headers. It does still compile and run, but this may have harmed something anyway. Please check!
- Hack around DATADIR being defined by objbase.h in MinGW by undefining it before the inclusion of shlobj.h (incl. in main.c) This only works since the case that DATADIR is actually used on Windows is extremely rare.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1437 4a71c877-e1ca-e34f-864e-861f7616d084
* move construction (allocation and initialization) of struct TRACK to openal_track.c where it is also decoded
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1401 4a71c877-e1ca-e34f-864e-861f7616d084
* change audp_parser/lexer to be able to read directly from a file (through PHYSFS)
* change data.c's mapping for "AUDIOCFG" to use the parsing directly from file
* rename dataAudioLoadFile to dataAudioLoad
* add a second list with load function mappings to audio.c for load from file mappings
* add a second piece of iteration code for the file mapping list
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1398 4a71c877-e1ca-e34f-864e-861f7616d084
* turn a one-statement function into an inline (resDoResLoadCallback)
* revive resource loading from file (the function pointer for this was removed in r1394, to actually use this pointer new code had to be written)
* modify resDataInit to handle memory allocation as well as data initialization
* modify struct RES_DATA to not have a fixed size char array to contain the filename (is now dynamically allocated together with the rest of the struct, see resDataInit)
* modify some argument lists to take `const char*` instead of `char*`
* change resLoadFile to use RES_TYPE.fileLoad if available, also remove an unused if statement (well actually the condition could never be false)
* resource type "WAV" (see data.c) now directly loads from a file (rather than copying the file entirely into memory and then to operate on that)
* fix sound_ConstructTrack (track.c) where I used the wrong source to copy the filename from
* fix sound_LoadTrackFromBuffer (track.c) to *not* add the track to the tracklist because this breaks other code
* modify sound_ReleaseTrack (track.c) to gracefully deal with NULL pointers
* remove dataAudioRelease (data.c) and instead just use sound_ReleaseTrack
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1397 4a71c877-e1ca-e34f-864e-861f7616d084
* Change some calls to FREE(TRACK*) to free(TRACK*), because TRACK is always allocated using malloc
* Change only one instance of MALLOC and only other instance of FREE in lib/sound/track.c to malloc and free respectively
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1396 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
* (probably caused because I was editing this file when r1377 was committed which probably was merged wrongly with my changes)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1379 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
* replace all instances of PTRVALID(ptr,size) by (ptr != NULL)
* remove asserts of style ASSERT( x == NULL || x != NULL ) because they would evaluate to true always anyhow and as such wouldn't ever trigger
* remove macros iV_HeapAlloc and iV_HeapFree and replaced them with MALLOC and FREE respectively (that's what they expanded to anyway)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1348 4a71c877-e1ca-e34f-864e-861f7616d084
why it worked, or, perhaps, why it still works. Take care ;-)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1251 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
- the function dataAudioLoad first checked whether the audio system is disabled and if it is sets return buffer (*ppData) to NULL, even though this functionality is already performed by the function it calls (audio_LoadTrackFromBuffer)
- this is similar for dataAudioRelease, additionally I moved the (low-level) call FREE(psTrack) to lib/sound/track.c which is also the file in which it gets malloc'ed
* while at it I directly changed sound_ReleaseTrack from returning BOOL to void since its return value was meaningless anyway (would always be TRUE no matter what), not to mention it was completely ignored by its only caller (dataAudioRelease)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1150 4a71c877-e1ca-e34f-864e-861f7616d084
* remove function `static void sound_SaveTrackData` because the operation it performs doesn't justify a whole function (and its calling overhead)
* some cleanup in functions sound_ReadTrackFromBuffer and sound_ReadTrackFromFile
* commented operation of both functions
* moved the content of function sound_SaveTrackData (only one statement) to sound_ReadTrackFromBuffer
* modified sound_ReadTrackFromFile to not allocate double the size of the needed memory for a buffer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1137 4a71c877-e1ca-e34f-864e-861f7616d084
- *WarzoneKeyNumeric definition changed to SDWORD
- Report wrong tracknumbers to LOG_SOUND and don't crash in sound_Play*DTrack
- Correct --help text
- Make console backlog key configurable
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@810 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
- Replace every occurence of VOID with void (and LPVOID with void*)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@703 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
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
with slight changes by me. See bug report #5168 for details.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@394 4a71c877-e1ca-e34f-864e-861f7616d084