Commit Graph

1848 Commits (9a2788aca82c224c2cf1b4d7d28197213c5e85db)

Author SHA1 Message Date
Giel van Schijndel ccc6206247 Add Doxygen documentation for v?asprintf
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6289 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-14 14:30:12 +00:00
Giel van Schijndel 7b37001471 Make v?asprintf return -1 on all errors (similar to GNU's implementation)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6287 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-14 14:28:21 +00:00
Giel van Schijndel 11e378ccce Allow WZ_ASSERT_STATIC_STRING to work when compiled as C++ as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6262 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-09 23:49:39 +00:00
Giel van Schijndel c99a123b50 * Remove unused list macros: LIST_INIT and LIST_ADD
* Rename LIST_ADDEND to LIST_APPEND (because that's what it does: append to a list)
 * Clean up the assertion in LIST_REMOVE
 * Prevent a potential bug in LIST_APPEND by not initialising the psNext pointer to NULL
  - doesn't ever occur right now, for one simple reason: the only place where this macro is used is on a structure that's initialised with memset(0)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6260 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-09 22:58:04 +00:00
Giel van Schijndel 17a0228d18 Remove unused function endian_fract
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6259 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-09 22:58:01 +00:00
Giel van Schijndel 2391ddd622 * Make the endian_*word class of functions/macros inline functions (and the type checking of their parameter) on ''all'' platforms!
* Fix several parameters that got passed wrong and didn't get caught due to the different definitions

Caught by EvilGuru

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6256 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-09 19:21:20 +00:00
Gerard Krol 03c11abefb Hide the mouse cursor during loading screens and movies.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6252 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-08 21:37:32 +00:00
Giel van Schijndel 03353e833e Allow the initialisation function of the debug callback to fail and report its failure through its return value:
* If initialisation of the debug callback failed, do ''not'' add it to the list of debug callbacks to use

This fixes ticket:136

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6249 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-08 19:30:18 +00:00
Buginator c5c02052d6 Add Hack from ticket:115
Forces window XP users to also use a software device for openAL.  (already the default for the other platforms & vista).  This allows 256 sources, instead of 16.
Note: *this is windows specific* and will not affect the other platforms.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6223 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-26 17:10:42 +00:00
Giel van Schijndel a47f0e94a7 Oops, need to copy filename template into template buffer (see r6214, r6217)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6218 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 22:16:13 +00:00
Giel van Schijndel a5c5328609 Make sure we take sizeof(array), not sizeof(pointer)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6217 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 22:11:43 +00:00
Giel van Schijndel 0269d11d16 In the exception handler:
* use mkstemp(3) to create a temporary file that's guaranteed not to exist already

Prevents a potential symlink attack (e.g. where /tmp/warzone2100.gdmp is symlinked by user A to a file owned by user B, then having user B crash warzone)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6214 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 21:47:00 +00:00
Buginator 6f3419da73 Modify scrOutputCallTrace() to dump the stack on script errors, and act normally whenever it is called normally.
(Normally, it dumps only when LOG_SCRIPT is defined, but we can't determine where the script errors are when LOG_SCRIPT isn't used)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6212 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 17:56:43 +00:00
Giel van Schijndel ceeb8780c7 Explain the "funny" iteration used to iterate over OpenAL devices
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6199 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-22 17:19:43 +00:00
Buginator 48eacfbc3d Dump out available devices available for openAL in the PrintOpenALVersion() function.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6196 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-21 18:40:05 +00:00
Giel van Schijndel cb2ec762e2 * Change animObj_Remove such that it doesn't set the passed in ANIM_OBJECT* pointer to NULL (i.e. a ** pointer was passed)
* Instead rely on setting that pointer to NULL in the client code that calls animObj_Remove in the first place
  - This was already done in all but one case where animObj_Remove was called

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6180 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 17:40:58 +00:00
Giel van Schijndel 64910221e7 Fix several warnings that occur on NDEBUG builds:
* Missing returns from function
 * Functions that are defined in both DEBUG and NDEBUG builds but only used in DEBUG builds

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6179 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 14:22:29 +00:00
Freddie Witherden 19f1175c04 Making padding a const int, as opposed to accessing it directly, in the hBox class.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6175 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 12:34:19 +00:00
Freddie Witherden c12227b453 Simplify the fitting algorithm for the hBox class.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6174 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 11:36:38 +00:00
Freddie Witherden f42ce71599 Fix a nasty typo in the hBox class which caused hBoxGetMinSize to be called for widgetGetMaxSize.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6173 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 11:33:49 +00:00
Freddie Witherden 3a4b246ff7 Add padding support to the hBox class; also, ensure that we set the default alignment/padding in the constructor; finally, improve the Doxygen documentation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6172 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 10:38:50 +00:00
Freddie Witherden 96509127b1 Add table.[ch] which is a partially completed table container implementation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6171 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 20:06:18 +00:00
Giel van Schijndel e5183abb69 Lets at least keep the comment in front of the declaration it applies to... (regardless of C89/C99, see r6162)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6164 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 13:18:51 +00:00
Freddie Witherden ec00337b6c Use alloca as opposed to malloc for allocating temporary storage in hBox.c.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6163 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 11:38:09 +00:00
Buginator 2ce52672c7 Declarations *before* statements. (To make a C89 compiler happy.)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6162 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 03:22:18 +00:00
Giel van Schijndel 71ddbdc5e4 Cleanup:
* Mark several parameters that aren't being used (but shouldn't be removed) with WZ_DECL_UNUSED
 * Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required
 * Instead of "(X - Y) >= 0" use the logically equivalent and more readable "X >= Y"
 * Remove redundant function prototypes
 * Move variables into a more local scope where possible
 * Assign the result of an expression to a variable once so that the expression doesn't have to be duplicated several times
 * Move constant UNALLOCATED_OBJECT out of the header and into the only source file where it's ever used

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6160 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 21:03:23 +00:00
Giel van Schijndel 1df1706440 * Fix several "comparison between signed and unsigned" warnings
* Const correctness
 * Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6158 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 20:42:20 +00:00
Giel van Schijndel ec4867f297 dirtyHypot() cleanup:
* Implement hypot() and hypotf() on non-C99 systems
 * Wherever the parameters to dirtyHypot() are signed: use hypotf() instead
 * Move some variables in to a more local scope
 * Merge the conditions of some nested if-statements
 * Get rid of some stupidly named variables (tempx and tempy are ''not'' good variable names, the names should indicate ''what'' the variables contain, not for how long)
 * Remove some unnecessary casting between float and [SU]DWORD


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6157 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 20:25:41 +00:00
Giel van Schijndel 29d7c7abfd Fix the raw win32 makefile system which got broken in r6144 and r6145:
* The lexers depend on the parser's headers so make sure to compile the parsers first
 * Move a misplaced line-wrapping backslash in src/makefile.win32


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6153 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 18:28:21 +00:00
Giel van Schijndel 55aaffac40 Construct programPath from the iterators of "buf" not from a char* pointer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6152 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 13:00:36 +00:00
Giel van Schijndel 5f5489b650 * Stuff SESSIONDESC.dwUser[1-4] in an array: SESSIONDESC.dwUserFlags\[4]
* Rewrite NETgetGameFlagsUnjoined such that it's not hardcoded for its `flag` parameter anymore

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6150 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 12:58:59 +00:00
Giel van Schijndel 0c1a577ee7 * Use GlobalAlloc and GlobalFree instead of malloc() and free() respectively
Do this because we cannot trust malloc()'s heaps to be intact at the time an exception handler gets called.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6146 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-13 15:41:50 +00:00
Giel van Schijndel 810fac209b * Wrap all file lists in the automake and win32 makefiles across lines such that there's only one file on each line
* Alphabetically sort the file lists

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6144 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-13 13:04:37 +00:00
Buginator 6a70a7750d Changes the 'optional file not found' from LOG_WARNING to LOG_WZ, because of too much spam.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6131 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-11 19:15:08 +00:00
Freddie Witherden aa447545b2 Outlaw the use of SDL_SetGamma (patch #83). This closes ticket #83. Approved by Giel.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6129 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-11 10:51:53 +00:00
Buginator 31b3895caf Closes & fixes ticket:99
Using --nosound is handled correctly for the FMVs now.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6125 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-11 03:21:03 +00:00
Giel van Schijndel d871a85964 Add video playback support:
* Add support for decoding and displaying of OggTheora/Vorbis videos
 * Change all references to *.rpl files to *.ogg files (and lower case them)
 * Add a new menu (and config) option for selecting the size at which to display videos (1x (native), 2x, full screen)

This closes ticket:64 and ticket:46

Code changes are ticket:64 (patch by Gerard Krol, Giel van Schijndel and Buginator)

FMVs can be found at http://download.gna.org/warzone/videos/sequences_ogg.zip (for now at least)
Videos encoded by Angus Lees


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6119 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-08 18:24:19 +00:00
Giel van Schijndel 58117a87c0 * Remove duplicate sound effect pcv483.ogg
* Rename pcv483.ogg to power-transferred.ogg


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6117 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 21:49:58 +00:00
Giel van Schijndel df801f1b08 * Make seq_Play const correct
* Use "bool" instead of "BOOL" for the return types of lib/sequence functions

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6112 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 18:45:18 +00:00
Giel van Schijndel 77d7490ed3 Move all header content of math-help.h inside its header guards
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6111 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 12:34:42 +00:00
Giel van Schijndel a74c27019d Make sure to #define the [SU]BYTE_(MIN|MAX) and [SU]D?WORD_(MIN|MAX) constants in terms of the U?INT(8|16|32)_(MIN|MAX) constants
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6110 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 12:09:58 +00:00
Giel van Schijndel 953a3a998b Allow #including lib/framework/types.h without lib/framework/frame.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6109 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 12:09:53 +00:00
Buginator 4971f0cdcd Adds a message to the console when screenshot key is hit.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6108 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 03:31:18 +00:00
Per Inge Mathisen 4a9c00e469 Revert tagfile changes in r6084, r6080 and r6079. Apparently not ready for the unwashed masses yet.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6102 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-02 21:50:05 +00:00
Per Inge Mathisen b66897f058 Port to trunk the fix for virtual group recursion from tagfile branch. Add unit test to ensure
it never comes back.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6084 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-26 19:14:56 +00:00
Per Inge Mathisen 87bf67480e Also port over the required fixes for tagfile.c, or previous commit will not work.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6080 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-26 17:48:33 +00:00
Per Inge Mathisen 6fc021819c Do a dummy load of basic object data from tagfile to stress test tagfile system. Ported from work in tagfile branch.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6079 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-26 17:45:18 +00:00
Per Inge Mathisen 68ca9bef81 Fix tagfile type definition
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6078 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-26 17:39:10 +00:00
Giel van Schijndel 2cea275cb5 * Fully define struct timeval (not just forward declare)
* Forward declare struct timezone


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6063 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-20 23:42:48 +00:00
http://www.openasthra.com/c-tidbits/gettimeofday-function-for-windows/ 05f7761bab Add a gettimeofday() implementation for Windows
Epoch and hint to use GetSystemTimeAsFileTime taken from: http://www.openasthra.com/c-tidbits/gettimeofday-function-for-windows/

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6062 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-20 23:24:17 +00:00