Commit Graph

23 Commits (457c7005f3cf71e862f760305ef21f436c28f78a)

Author SHA1 Message Date
Per Inge Mathisen 274ae7c9a4 Enforce strict function prototypes for autoconf builds, and fix function prototype problems.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4487 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 15:34:55 +00:00
Dennis Schridde 2537bfc61c Cleanup #includes a bit
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4107 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 12:39:08 +00:00
Giel van Schijndel 491b968833 * Make cdAudio_PlayTrack work with an enum instead of "magic numbers"
* Use this enum's values throughout the src/* code
 * Replace scripting function playCDAudio(int) by playIngameCDAudio() which is equivalent to cdAudio_PlayTrack(playlist_ingame)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3687 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-04 16:46:55 +00:00
Giel van Schijndel 93c387f1fb * Change "failed to open file" error message, when attempting to load a playlist, from LOG_ERROR to LOG_NEVER as it isn't a real error condition
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2717 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-04 18:45:57 +00:00
Giel van Schijndel 6268b6fff2 * Don't allocate memory in PlayList_Init() while we don't need it yet
* Make sure to set '''global''' pointers to NULL when free()ing them
 * Also set the "size" variables belonging to these pointers to zero
* Use a swap(a, b) style function for variable swapping (in PlayList_Shuffle()) rather than obfuscating code
* Make sure that PlayList_CurrentSong() and PlayList_NextSong() return "const char*" rather than "char*" to make sure no one touches memory he/she shouldn't
* Some general changes to conform with coding style (most notably: braces on a line of their own)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2712 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-04 16:14:24 +00:00
Giel van Schijndel aa4bb6c529 * Prevent a segfault occuring when quitting from warzone if a non-power of two number of tracks has been loaded into a playlist (due to uninitialized pointers)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2711 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-04 16:05:11 +00:00
Giel van Schijndel 7a01000da9 * Clean up some of the playlist code:
* Make PlayList_Read return a bool instead of char (using 'char' there was a perfect example of premature optimisation; to save memory most likely)
   * Remove macro CURRENT_TRACK which expanded to playlist[current_track] (it did _not_ increase readability)
   * Make sure to free resources from __all__ return paths from PlayList_Read
   * Check realloc's return value
   * Don't bitshift but multiply!
   * Make sure to follow coding style (in PlayList_Read)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2709 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-04 15:24:37 +00:00
Giel van Schijndel 5efc500f88 * Fix a bug where (in some cases) file names in the music.wpl playlist would be truncated
Bug reported by Jessicatz (on IRC)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2708 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-04 15:16:56 +00:00
Giel van Schijndel e06c186bd6 * Replace a _lot_ of strcpy(), strcat() and sprintf() calls with the safer strncpy(), strncat() and snprintf() respectively
* 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
2007-10-24 21:11:29 +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 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
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 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 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 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
Dennis Schridde ffbf96fc08 Fix infinite loop in playlist loading. There still doesn't seem to be any music...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@473 4a71c877-e1ca-e34f-864e-861f7616d084
2006-07-17 20:48:39 +00:00
Dennis Schridde 194026f379 Rewritten mod loading
This patch includes:
- Strongly modified way of adding mods, maps and addons
- Make nearly everything use PhysFS (just netlog and debug stay)
- Convert several DBERRORs etc. to debug()

The new modloader works like this:
For every mod supplied on the commandline ("-mod") (maximum of MAX_MODS=100) keep it in mind (char * global_mods[]).
After initializing PhysFS do scanDataDirs(), which tries to register all possible paths, global_mods[] and maps with PhysFS. Dont check wether we succeed, only at the very end check if we got a "gamedesc.lev".

When we buildMapList(), mark "gamedesc.lev" as MOD_CAMPAIGN, "addon.lev" and every user supplied map as MOD_MULTIPLAY.

When we loadMods() modify the searchPath according to the supplied mods.
Note: T1 maps like Sk-Rush come from gamedesc.lev, are marked MOD_CAMPAIGN and thus wont load any multiplay_mods[], even if the user starts a multplayer game. Instead those maps are threated as campaignmode and will only load campaign_mods[].

This patch requires the "mp" patches to be either in ProgramDir/mp, in ProgramDir/data/mp or in ProgramDir/mp.wz
This is because one cannot add warzone.wz/mp to the search path if warzone.wz is an archive.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@436 4a71c877-e1ca-e34f-864e-861f7616d084
2006-06-16 19:10:23 +00:00
Dennis Schridde 5175535d9d Full pathname includes
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
2006-06-02 19:34:58 +00:00
Dennis Schridde 1e7edf9fa2 Fixes some minor memleaks and marks the source of the big one in pie_PNGLoadMem.
Also big amount of whitespace changes, sorry for the inconvenience...



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@400 4a71c877-e1ca-e34f-864e-861f7616d084
2006-02-18 18:54:37 +00:00
Rodolphe Suescun d72f0cdc02 Fixed data directory problem.
Fixed sound source destruction problem.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@395 4a71c877-e1ca-e34f-864e-861f7616d084
2006-02-11 09:00:20 +00:00
No Author 5ba7ddac6b Create final repository structure.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@362 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-28 17:47:08 +00:00