Commit Graph

41 Commits (02901850b792c092882efffb11c5c3601787071c)

Author SHA1 Message Date
Giel van Schijndel 392c08cd3c Use LOG_INFO to report non-existant playlist files (instead of LOG_ERROR)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9732 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:28:16 +01:00
Buginator 0aff0b46cf Add a new debug flag type, LOG_FATAL.
This is used to differentiate LOG_ERROR (which is a *non* fatal error, but a error none the less) and fatal errors which result in program termination with no *visible* output (on windows/macs) on our end because of the crappy GUI functions so we usually dump it to stderr.txt and there is no clue that the program had to exit for whatever reason.

Hopefully, this will be helpful to windows people so they can differentiate between *our* exit/abort routines, and crashes that occur in drivers which look exactly the same since they get dumped back to the desktop with no visible clue why.

LOG_FATAL is *always* on in both debug & release builds.

On LOG_FATAL debug lines, on windows, we now throw up a modal dialog box with the current error message.  At this time, this only happens when we have a error, and we use abort() right after the error, which makes it fatal.

That explains why this touches ~60 files :)


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8320 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-22 16:19:51 +01:00
Per Inge Mathisen fb980b636c Ease up on the volume of repeat testing done on the audio code.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7407 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-15 22:29:32 +02:00
Dennis Schridde aac41748dc Bump copyright
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6617 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 18:01:48 +00:00
Dennis Schridde cbbc58d1e9 Move files which extend a c std library header to a filename of similar name
Extension functions dealing with ...
 * strings are in string_ext.h
 * stdio (namely printf variants) are in stdio_ext.h
 * math are in math_ext.h

These headers are no longer included by frame.h

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6613 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 17:23:09 +00:00
Buginator 21fdab0117 Modify debug output to specify the 'real' directory that physfs is using for the file in question.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5958 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 20:00:54 +00:00
Per Inge Mathisen 1f831ebd3d Add beginnings of self-test to openal and general audio subsystems.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5456 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 19:07:42 +00:00
Per Inge Mathisen 2aeda4d91e Improve playlist selftest. It now covers the entire playlist API. Remove unused
playlist declaration from header file.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5448 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 16:19:57 +00:00
Giel van Schijndel bc810ca2e2 Reset to the start of the playlist when we've reached the end of it, don't move past the end first. This addresses bug #11879 in part (by preventing it even further from occuring).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5333 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-25 20:15:20 +00:00
Giel van Schijndel 1c6ff360db Use if (condition) something; else something-else; instead of if (condition) something; if (!condition) something-else;
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5329 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-25 14:01:18 +00:00
Giel van Schijndel 91c7638ddb Check malloc's return value
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5294 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-21 21:51:35 +00:00
Giel van Schijndel 8987ee3aff Slight refactoring to return as soon as possible, thus not damaging code-readability by large amounts of scope-nesting (specifically if-branches)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5293 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-21 21:51:29 +00:00
Giel van Schijndel 952cd00d05 Only iterator over the linked list `songList` once to determine the end. Then store a pointer to the last ->next pointer and use it to append to the list instead.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5292 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-21 21:51:26 +00:00
Giel van Schijndel f7ead00bb0 * Don't use strtok to separate out lines from files as the line reading loop already takes care of that
* Remove now double variable filename and rename line_buf to filename


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5291 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-21 21:51:21 +00:00
Per Inge Mathisen d3123eaac4 Fix issue in patch #1075 - use "/" separator for physfs paths.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5282 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-21 16:35:24 +00:00
Per Inge Mathisen a1c47bccf8 patch #1075: Simplify playlist code. Thanks to Giel for patch review.
The playlist file is no a simple list of files to play during the game.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5281 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-21 15:40:56 +00:00
Dennis Schridde c9b9e98dc9 Fix "Create default playlist file; This is an ugly HACK which should be FIXME'd into oblivion some other time" by adding a default playlist file to base.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5263 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-18 18:25:35 +00:00
Per Inge Mathisen 1c3835ce23 Add original music soundtracks. If you have a playlist already, you need to delete it
or add the music to it manually.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5261 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-17 19:32:17 +00:00
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