Commit Graph

77 Commits (7d6382905d119e106b06c541e3f1a56e761010a3)

Author SHA1 Message Date
Giel van Schijndel 26f2672bfd * remove macro PTRVALID
* 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
2007-04-03 13:20:41 +00:00
Giel van Schijndel 13c85370b9 * enable libvorbisfile to seek into a file opened with PhysicsFS
* also allow this to be disabled on a per file basis (this code is basically taken from the sound branch: lib/sound/decoding.cpp)
 * some minor code cleanups (using a temporary to cast into, rather than casting directly into a function call's parameters, optimizer will optimize this away anyhow)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1345 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-03 11:15:41 +00:00
Dennis Schridde 3b09a756df - Remove unneeded gettext files and instead create them via autopoint
- Remove unneeded checks from autogen.sh (all of them are also checked in configure.ac)
- Move AM_CPPFLAGS=-$(top_srcdir), which was included in nearly every Makefile, to configure.ac
- Remove -g from CFLAGS for usual builds. This should be set by the buildscripts instead
- Remove CFLAGS_OVERRIDE, which was rendered obsolete by the above change


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1332 4a71c877-e1ca-e34f-864e-861f7616d084
2007-04-02 17:21:05 +00:00
Giel van Schijndel d659136496 * move audio_id.[ch] to lib/sound (because the soundlib depends on it, and libraries shouldn't depend on the main source, i.e. src/)
* 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
2007-03-27 18:59:03 +00:00
Dennis Schridde ca3b5909c8 Fix indention and some minor cleanup...
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
2007-03-16 19:31:15 +00:00
Per Inge Mathisen cfea4b4b3e Remove strange usage of hash names in soundtrack code. I am not sure
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
2007-03-16 19:03:53 +00:00
Dennis Schridde 2a74242eb3 - Replaced various vectors with Vector3i and Vector3f (idea by Watermelon)
- 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
2007-03-16 16:20:16 +00:00
Dennis Schridde b6fe2eb42b Patch by Jessica: Fix compilation without MP3 support
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1209 4a71c877-e1ca-e34f-864e-861f7616d084
2007-03-06 20:35:15 +00:00
Per Inge Mathisen d434901a21 Fix audio for those who have none. Patch by Gerard Krol, who said
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
2007-02-21 20:21:30 +00:00
Giel van Schijndel c07332714b * removed some redundant code from src/data.c:
- 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
2007-02-19 21:52:27 +00:00
Per Inge Mathisen 79b3875fc4 This commit fixes all warnings (on my system). -Werror added for
debug builds. Hopefully this will not cause too much pain, but
rather increase code quality for the future.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1144 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-19 14:10:44 +00:00
Giel van Schijndel 3880422cbe copied some code from branches/sound/lib/sound/decoding.cpp
This allows files to be decoded by OggVorbis directly through PHYSFS. Previously PHYSFS was used to read the entire file into memory and then to decode it from that memory buffer.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1138 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-18 22:16:55 +00:00
Giel van Schijndel b73646d04b * improve code readability (e.g. only keeping the `if (malloc(...) == NULL) handleError;` part, so as not to wrap all the rest of the code in a big (recursive) else block
* 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
2007-02-18 21:30:51 +00:00
Dennis Schridde 8a70df4064 Use some more advanced Automake techniques like noinst_HEADERS. Changes partly autogenerated by KDevelop, so this should be compatible with Automake 1.6.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1118 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-16 14:36:03 +00:00
Per Inge Mathisen 3d6771a521 Unify the several different definitions of pi in the codebase. Now we use the
C macro M_PI (if available, or we will define it on our own in fractions.h).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1033 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-24 19:42:20 +00:00
Giel van Schijndel 731c145b75 removed alGetError() error-check because an al* error couldn't be legally generated at this stage since no al* calls are made yet
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1018 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-17 22:18:59 +00:00
Giel van Schijndel 5bcc7819ac git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1017 4a71c877-e1ca-e34f-864e-861f7616d084 2007-01-17 21:39:38 +00:00
Dennis Schridde 49ceba7503 Add GPL notices to all sourcecode files.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1014 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-15 20:09:25 +00:00
Per Inge Mathisen 85767a6ae8 Remove the unused (unconfigurable) CD soundtrack code, since we now
anyway prepare to add our own, new music tracks to the game.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@997 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-10 23:00:04 +00:00
Per Inge Mathisen a0c67a74c1 While I am at it, remove some more dead code and set correct log flag.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@996 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-10 22:50:09 +00:00
Per Inge Mathisen 6856fab9de Fix autoconf build system that was broken in commit 994.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@995 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-10 22:38:55 +00:00
Giel van Schijndel c3276dcf59 last commit only emptied lib/sound/mixer_stub.c
fix that by deleting it now

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@994 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-10 21:56:50 +00:00
Giel van Schijndel 1591402b4c removed lib/sound/mixer_stub.c and all function calls to it (or more precisely the calls to its empty functions)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@993 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-10 21:55:39 +00:00
Giel van Schijndel 340710edf8 workaround for bug #8198
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@975 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-08 22:35:43 +00:00
Dennis Schridde f1ad4d83c9 - Expand DISP_HEIGTH/DISP_WIDTH
- Remove an unused function


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@964 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-07 19:29:26 +00:00
Giel van Schijndel 241f40f5fc soundsystem fixes/improvements
* remove file-global var `ALfloat listenerPos[3]` and replaced with function calls to alListener{Get}{n}{fi}{v}( AL_POSITION, ... )
 * modified sound_SetObjectPosition() to be better human-readable (removed some unnecessary temporary vars)
 * modified sound_SetPlayerOrientation() to a more verbose writing (+Doxygen comment)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@962 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-07 16:28:54 +00:00
Dennis Schridde a7aac74fae - Removed some commented parts
- Removed unneeded check for psTarget == NULL from the establishTarget* functions, would have crashed before anyway
- Patch by Watermelon: Projectile Fix 7: 1.Fixed a crash with VTOL bomber with NULL weapon pIMD.
- Fix include of lib/framework/frame.h


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@942 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-30 22:01:34 +00:00
Per Inge Mathisen 9c22bf56ba Fix possible source of redefined macro warnings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@941 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-30 19:22:08 +00:00
Dennis Schridde 4e28453441 src/* and lib/ivis_common/piemode.h by me: Cleanup unused functions.
Rest: Patch by Giel van Schijndel: codecleaning patch: lets delete stuff


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@939 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-29 19:56:06 +00:00
Dennis Schridde a432f5628f Patches by Christian Ohm:
010 - Remove unused sound compression code
011 - Remove unused audio parameter VagID


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@863 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-26 11:45:04 +00:00
Dennis Schridde f25a9aa3ac Not yet changed parts from patches of Christian Ohm:
003 - Remove all references to hWnd
004 - Remove DirectDraw flag
005 - Remove DDrawDriverName and D3DDriverName
006 - Remove all references to hInstance
007 - Remove some unused Windows types
008 - Remove VidMem parameter
009 - Remove bitdepth variables


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@862 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-26 11:39:54 +00:00
Dennis Schridde 13528b9d71 Patch by Christian Ohm: 045 - Fix playlist code
- Move two global variables only used in PlayList_Read into that
   function.
 - Remove a useless comparison (unsigned int can never be < 0)
 - Check for '\r' as well as '\n'. This should make playlists with DOS
   line endings work.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@860 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-26 10:54:22 +00:00
Dennis Schridde 7d3ad56fd5 Compilation fixes, macro removal, PHYSFS_fileLength by Gerard Krol.
Some more initialization in interp.c by me.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@824 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-06 21:58:13 +00:00
Dennis Schridde fb74a1f8dc Patch by Thomas Rast: Include string.h against warnings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@821 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-06 14:40:07 +00:00
Dennis Schridde b1c7773299 Patches by Charon, slightly modified:
- *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
2006-11-04 21:05:31 +00:00
Dennis Schridde d3cd44148d Patch by Gerard Krol: Replace STRING with char (STRING was confusingly defined to char)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@804 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-03 21:35:50 +00:00
Roman C 3ea3f99f73 Patch by Gerard Krol: lesswarnings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@802 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-02 20:15:08 +00:00
Dennis Schridde 1e34dc870d Fix/mark 2 unused symbols
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@790 4a71c877-e1ca-e34f-864e-861f7616d084
2006-10-21 06:14:35 +00:00
Stefan Huehner 30f6dc392e mark some Strings an read-only by adding const.
On the way replace STRING with char



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@756 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-24 19:11:34 +00:00
Stefan Huehner bc25579a7a Correct openal buffer: void *pMem -> ALuint iBufferName
as openal 'buffers' are indexed by ALUint.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@755 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-24 18:53:08 +00:00
Stefan Huehner b3e3d17b82 Include frameresource.h directly in its users. Fixup after
the big cleanup in 748:749.




git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@750 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-23 18:38:12 +00:00
Dennis Schridde 3261a09baf BIG cleanup of headers.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@749 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-23 17:24:55 +00:00
Dennis Schridde 912cf2c8e2 Partially revert r739.
SDL < 1.2.10 doesn't define the string function wrappers.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@747 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-23 14:56:18 +00:00
Dennis Schridde d39f787caf - Enforce floats in several places
- Define WORD and BYTE types to SDL types
- Let SDL handle some more of the win32fixes


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@739 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-20 19:46:33 +00:00
Stefan Huehner 1395a7c69c Make some more functions static which aren't used outside their
declaring source files and which have no prototype.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@731 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-19 18:45:48 +00:00
Dennis Schridde d889ce9da7 Patch by Christian Ohm: "g++ fixes"
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
2006-09-17 20:39:25 +00:00
Dennis Schridde 3fdc9539b9 Add the missing playlist.h I forgot in r707.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@710 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-13 21:37:48 +00:00
Dennis Schridde 7e8990c661 Patch by Stefan Huehner: "code cleanup: static"
Patch marks several function & datastructures without prototypes, which aren't used outside their declaring sourcefiles as static.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@708 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-13 21:14:47 +00:00
Dennis Schridde 3b59d20acb Patch by Stefan Huehner: "code cleanup: playlist.h"
Comment by him:
Patch removes the playlist prototypes from the c-file cdaudio.c and add an extra header playlist.h for them.
This is then included in both cdaudio.c and playlist.c



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@707 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-13 21:13:19 +00:00
Dennis Schridde b9087ef4ca Patch by Stefan Huehner: "code cleanup: void 4"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@706 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-13 21:11:11 +00:00