Commit Graph

4950 Commits (d1308a59f6cff3af988539b9e6b7cd9147e3f504)

Author SHA1 Message Date
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
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 e81ac54c92 Mark removeAfterNewLine as static
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6149 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 12:58:53 +00:00
Buginator f914a437dd BUG FIX:
Make sure to add the correct number of team widgets, instead of having to display MAX_PLAYERS amount.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6148 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 03:40:48 +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
Giel van Schijndel 872a436895 Force using the C++ compiler as linker
This fixes #65

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6142 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-13 11:45:47 +00:00
Buginator a4e9ac0e09 Fixes & closes ticket:103
Alliances were formed in a SP game that were not supposed to be formed as a byproduct of having game.alliance set to ALLIANCES_TEAMS in a skirmish/MP game.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6140 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-12 18:05:47 +00:00
Per Inge Mathisen ea2dcd8b5e Fix bug #12430: assert in widget:1080 while modifying vehicle, reported by
Thomas Frauendorfer. Make us test validity of system component when changing 
propulsion, and also avoid crashing if current weapon mode is invalid. Pach 
reviewed by Buginator.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6139 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-12 18:04:26 +00:00
Per Inge Mathisen 7d46dd0a44 Improve logging, update some comments.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6138 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-12 12:17:10 +00:00
Per Inge Mathisen 4f33dfa994 Fix bug #12400: assert in droid.c (r6104). First issue is that we check against DROID_MAXWEAPS on
a structure, which has potentially one more weapon that this. Second and more serious issue is that 
if a building is demolished, it will no longer be updated in regards to dead targets.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6136 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-12 09:48:52 +00:00
Per Inge Mathisen dcc87a0973 Purely cosmetic fixes for bug #12430: assert in widget:1080 while modifying vehicle
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6135 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-12 09:26:40 +00:00
Buginator fd10f48279 *Changed* default FMV mode to 2x instead of full screen. (Most people play game >640x480, so FS looked pretty bad)
Fix FMV text to display correctly no matter screen size.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6134 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-12 03:05:40 +00:00
Buginator 4a03edafc1 Updating ChangeLog with some bug fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6133 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-11 19:21:29 +00:00
Buginator e4a10b71bc Since return/enter key was remapped to enable chat mode, we didn't remove this keypress from the input stream when we would save games. This resulted in the chat mode being enabled when a user saves their game.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6132 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-11 19:17:59 +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
Per Inge Mathisen 36f3ec168c From ticket #97: Change height of some buildings so that they can fire over walls as they should. Patch by Zarel.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6130 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-11 15:09:35 +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
Freddie Witherden 89f631a6b2 Add timer.[ch] to the Xcode project. This allows Warzone to build on OS X again.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6128 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-11 10:22:28 +00:00
Freddie Witherden f02f2c272a Commit patch #52 which fixes invalid research items in multi-player. This closes ticket #52.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6127 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-11 10:16:00 +00:00
Buginator 768686397c Disables stopping of the backdrop, to fix the flickering issue that some people have seen while on the loading screen.
Closes ticket:87

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6126 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-11 03:57:45 +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
Buginator 84002ab665 Adds a new menu option specifically for Mouse Options, and moves all options that have to do with the mouse to this menu.
Adds a hardware (SDL) / software (color) cursor menu option.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6124 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-11 03:06:33 +00:00
Buginator 67ca56f6b5 Slight correction, uploaded the wrong version of last patch.
Fixed formatting of frontend.h correctly.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6123 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-10 20:08:16 +00:00
Buginator 0c469ea1f2 Get rid of the #define(s) in this file, and using enum instead.
Makes it easier to modify/change menu entries and such.

Should not affect code behavior at all.





git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6122 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-10 20:02:47 +00:00
Giel van Schijndel 3e1509e874 Remove the Eidos and Pumpkin "logo" videos from the "Show Intro" list. There's no need to advertise for them anymore...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6120 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-08 20:56:14 +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
Freddie Witherden 8573255b29 Commit patch #94 by Zarel. This gives logical names to things such as Nexus resistance circuits and repair turrets.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6118 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-07 22:31:28 +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 74038caddc Mark some nasty piece of code for fixing
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6116 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 21:12:51 +00:00
Giel van Schijndel d8e0d93a5d * Initialise aHardPath at compile time to "sequences/" (the only value it was ever set to)
* Get rid of bCDPath and bHardPath which guarded the initialisation of aHardPath
 * Remove seq_SetVideoPath which performed the initialisation of aHardPath

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6113 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 19:28:41 +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