Commit Graph

5081 Commits (2b11839902f3e913ace63cdf62e41f5dd36f51ed)

Author SHA1 Message Date
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 0cf8df8f3f Copy latest 2.1 ChangeLog entry into trunk ChangeLog and move the exceptionhandler fix (r6214, r6217 and r6218) into that entry
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6219 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 22:21:35 +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
Giel van Schijndel d141c834e5 Ignore po/remove-potcdate.sed
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6213 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 20:52:29 +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
Buginator 11b627c5b4 Another fix for r6187
setGameMode() correctly also.

Part of ticket:121

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6204 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-23 02:50:54 +00:00
Giel van Schijndel 7ab0ef51ce Clean up:
* Lets ''not'' save on the characters required to have function names make sense
 * Make DeleteButtonData a static function (because it's only used in the source file where it's defined)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6203 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-22 20:04:16 +00:00
Giel van Schijndel 962445e5fc Fix a bug that prevent proper loading of save games:
* Make sure to stop the title loop ''before'' attempting to load a save game
 * Restart the title loop only ''after'' we've determined that loading of the save game was unsuccessful

Stopping the title loop (stopTitleLoop()) causes resReleaseAllData to be called, which is required to make sure that the "frontend" (aka main menu) data doesn't conflict with the game data.

This fixes #121

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6202 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-22 20:04:10 +00:00
Per Inge Mathisen 6140e091d6 Improve assert messages. Related to bug #12474.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6201 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-22 18:47:39 +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
Buginator 54aecf520e fixes r6183 and closes ticket:119
Buildings couldn't fire at anything.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6193 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-19 04:45:38 +00:00
Buginator fedbd6e1fa Fixes & closes ticket:114
We do not exit() on a bad savegame file.
Instead, we go back to the title menu. (Since we have no easy way to make a pop-up requester with the current GUI code)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6187 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-18 18:57:54 +00:00
Buginator 03990706e6 Disables the AI from executing the reassignAI() routine, which is broken, and it instead took control of a human player, and not the dropped player (which doesn't make sense to do, since we nuke all that player's stuff.)
See ticket:105 for more info.
Fixes bug #12398 , bug  #12443


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6186 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-18 18:38:25 +00:00
Per Inge Mathisen e33161cda1 Ran astyle over validTarget(), a hideously looking function!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6185 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-18 18:28:26 +00:00
Buginator 40795ec7b8 Fixes and closes ticket:104
Prevents allowing player from having everyone on the same team.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6184 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-18 18:27:32 +00:00
Per Inge Mathisen 64b8634b35 Make structures not try to target anything from outside weapons range. From patch
by Zarel in ticket #97.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6183 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-18 18:04:49 +00:00
Per Inge Mathisen 2d02726753 Restrict direct fire to weapons range only instead of minimum of sensor range and
weapon range. Patch by myself and Zarel with input from the forums. From ticket #97.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6182 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-18 17:59:09 +00:00
Per Inge Mathisen ee5f151162 Add the purely cosmetic changes from trac ticket #97 to minimize patch size.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6181 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-18 17:27:27 +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
Giel van Schijndel abebc970fe Prevent warnings about unused parameters on non-debug builds
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6178 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 13:54:34 +00:00
Giel van Schijndel 46002d39d9 Use WZ_DECL_MAY_ALIAS for the BASE_STATS "derived" structures because we perform "type punning" on these pointers in a similar fashion to the BASE_OBJECT hierarchy.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6177 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 13:49:05 +00:00
Giel van Schijndel 0bcbf27b21 * Use "if (!condition) { action }" instead of "if (condition) { /* Nothing */ } else { action }"
* Use proper indenting/style

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6176 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 13:22:02 +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 d1308a59f6 Cleanup:
* Remove unused parameters
 * Fix several "comparison between signed and unsigned" warnings
 * Move some variables into a more local scope
 * Mark several unused parameters with WZ_DECL_UNUSED for callback functions
 * Give some variables decent names (e.g. 'j' is ''not'' a good name for a variable holding a player number)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6170 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 20:01:02 +00:00
Giel van Schijndel bc5396e8ed * Turn several constants into "static const <type>" variables
* Move these constants in the smallest scope where they're used
 * Fix a "comparison between signed and unsigned" warning
 * Move a variable into a more local scope

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6169 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 17:48:46 +00:00
Giel van Schijndel bf1e1fef77 * Get rid of some unnecessary casting
* Don't cast one operand in an expression to double only to use a float ("single") number as the other operand in the expression
 * Use sstrcpy and sstrcat's return values to determine whether string truncation occurred

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6168 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 17:48:43 +00:00
Giel van Schijndel ffd8c829de * We're not using piemode.h in seqdis.h so don't #include it there
* Don't #include seqdisp.h where it isn't used

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6167 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 17:48:40 +00:00
Giel van Schijndel 9ada88b531 * Pass the sequence text type to seq_AddTextForVideo and seq_AddTextFromFile by using enum constants (from SEQ_TEXT_POSITIONING) instead of magic "numbers"
- (true and false are even worse than magic numbers when they're used to represent non-boolean values, i.e. abused for the fact that they happen to be defined to 1 and 0 respectively.
 * This change *will* affect the way how FMV subtitles are displayed; this could be considered a bugfix, or not...
  - See the changes to seqdisp.c around line 680 and keep in mind that true = 1; and SEQ_TEXT_JUSTIFY = 2;
  - Looking at the commented out code I think SEQ_TEXT_JUSTIFY is intented, though due to true being 1 we've effectively been using SEQ_TEXT_FOLLOW_ON instead since r1, see browser:trunk/game/src/seqDisp.c@1#L1121

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6166 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 17:48:35 +00:00
Giel van Schijndel e4db079de7 * Move the SEQ_TEXT_.* constants into an enum: SEQ_TEXT_POSITIONING
* Use this enum as parameter type instead of mixed SDWORD and BOOLs (BOOLs are serious abuse here!!!)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6165 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 15:35:26 +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 0e1438c795 Cleanup:
* Remove several unused parameters
 * Fix several "comparison between signed and unsigned" warnings
 * Move variables into a more local scope where possible
 * Merge the conditions of some nested if-statements
 * Use an enum instead of some "magically defined" macros
 * Remove unused functions tooNearEdge and demoRequestStart
 * Mark function findSomethingInteresting as static
 * Use ARRAY_SIZE(array) instead of sizeof(array) / sizeof(array[0])
 * Get rid of some unnecessary casting from float to int
 * Mark several unused parameters with WZ_DECL_UNUSED for callback functions

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6161 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 22:02:35 +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 8312b90c8a Cleanup:
* Fix several "comparison between signed and unsigned" warnings
 * Use ARRAY_SIZE(array) instead of sizeof(array) / sizeof(typeof(*array))
 * Const correctness
 * Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required
 * Use "%u" as format specifier for unsigned integers instead of "%d"
 * Remove redundant function prototypes
 * Use ssprintf instead of snprintf where appropriate


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6159 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 20:53:51 +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 cfb0f11d5c Cleanup:
* Const correctness
 * Return as soon as we've got our result (rather than assigning to a temporary and returning only at the end of the function)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6156 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 20:17:55 +00:00
Giel van Schijndel 05cc7093b4 * Rename dirtySqrt() to dirtyHypot() because its more similar to hypot() than to sqrt()
* Change dirtyHypot()'s interface to match that of hypot() (i.e. specify the coordinates relative to the origin instead of another coordinate)
 * Mark dirtyHpot() as deprecated in the Doxygen documentation and suggest to use hypot() or hypotf() instead (C99 functions for which I'll provide work arounds in math-help.h soon after this commit)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6155 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 19:31:40 +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 077b3894b5 * aiexperience.[ch] was never written by Pumpkin/Eidos so lets not add a copyright notice claiming copyright for Eidos
* aiexperience.[ch] was written by Troman and included in r609

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6151 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 12:59:03 +00:00