Commit Graph

2307 Commits (9bfd7455495b51335569668ca840edf31b8cce01)

Author SHA1 Message Date
Dennis Schridde dbf5e962b9 Use squared radius to test in-sphere for projectile impacts
The attached patch fixes a bug in proj_ImpactFunc whereby it would use the radius cubed as opposed to the radius squared when doing hit-detection. Furthermore it also removes some premature optimisations (hit-box detection).

Author: EvilGuru
Signed-off-by: Dennis Schridde <devurandom@gna.org>

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6498 4a71c877-e1ca-e34f-864e-861f7616d084
2008-12-26 00:46:18 +00:00
Gerard Krol 710e09eb27 Fix scrCheckTemplateExists so that it doesn't try to break out of an outer loop using a break statement.
The function would quite often report an already existing template while there was none.
This fixes bug #186. This fix has already been applied in the lua branch.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6490 4a71c877-e1ca-e34f-864e-861f7616d084
2008-12-25 14:27:19 +00:00
Giel van Schijndel 64f87a0b8e * Make function countAssignedDroids static because it's only used in the file where it's defined
* Code clean up
 * Make countAssignedDroids const correct
 * Make countAssignedDroids return the amount of artillery ''and'' VTOL droids that are assigned to a structure
  * This fixes #90, patch by i-NoD, modified by me

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6464 4a71c877-e1ca-e34f-864e-861f7616d084
2008-12-13 17:58:25 +00:00
Per Inge Mathisen ab0c686df2 Fix bug #12448: crash in hci.c:3101 in TRUNK (r6160) by simply removing the mostly spurious assert.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6457 4a71c877-e1ca-e34f-864e-861f7616d084
2008-12-12 17:07:55 +00:00
Per Inge Mathisen 52dd85264f Improve assert message to help track down bug #12448.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6456 4a71c877-e1ca-e34f-864e-861f7616d084
2008-12-12 16:55:06 +00:00
Gerard Krol abbcda662f Remove some code duplication from the getProduction* functions and a lot of code duplication from the pickATile* functions.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6435 4a71c877-e1ca-e34f-864e-861f7616d084
2008-12-04 22:21:10 +00:00
Gerard Krol 94b7867399 Remove duplicate code responsible for drawing the health and construction progress of buildings.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6434 4a71c877-e1ca-e34f-864e-861f7616d084
2008-12-04 20:56:16 +00:00
Giel van Schijndel f0f937a0aa * Make sure that we use the correct printf formats
* Use ASSERT_HELPER where required (and ASSERT as used)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6433 4a71c877-e1ca-e34f-864e-861f7616d084
2008-12-04 14:19:21 +00:00
Gerard Krol bb7e111e00 Updated CoordInRadar function which somehow did not make it into r6410 (rotating radar). This fixes an assert in CalcRadarPosition.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6418 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-30 22:44:58 +00:00
Gerard Krol 0906040c8b Add an option to rotate the radar when the player rotates the camera. The viewing window on the radar
is thus always facing upwards.  This option is now enabled by default to obtain some feedback.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6410 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-30 15:10:49 +00:00
Freddie Witherden d54a1e8566 Colored => Coloured. We use British spelling by convention.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6397 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-26 21:22:47 +00:00
Giel van Schijndel 0723d7a5b9 Fix compiling on MSVC:
* Use C89 style variable declarations (i.e. at the beginning of scope-blocks)
 * Use a proper set of #include paths

This should fix #160, patch by <i-NoD> slightly modified by me (moved variable declarations to the most local scope where used)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6385 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-25 23:53:44 +00:00
Giel van Schijndel 216cbe8789 * Use a spiral-like search for VTOL landing sites instead of expanding square search
- This will result in smaller travel distances in some cases

This closes #143 ("true distance instead of manhattan distance"), patch by <mfreire> with some modifications by me

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6363 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-22 18:41:39 +00:00
Gerard Krol d2c8082c87 Change the way the edges of the map fade. With fog of war enabled they fade to transparency so that mountains in the distance will fade
in instead of pop in. The transparency did not play well with the distance fog and in that case the tiles fade to the fog color. All 
terrain tiles are now drawn as alpha enabled textures, which could have an impact on the performance for some people. Remember this 
commit when complaints about reduced performance start coming in.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6348 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-17 10:39:44 +00:00
Gerard Krol a5128f0d6d Rename the current skybox texture page to page-25-sky-arizona and use the entire texture, instead of only the bottom half of
it. This will make it easier to change the sky for the different areas.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6345 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-17 08:06:49 +00:00
Giel van Schijndel 5f05dd99e6 Check for Perl in the configure script, rather than just assuming it's installed
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6343 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 19:13:39 +00:00
Giel van Schijndel 67b80c973d Regenerate stats-db2.c to get rid of old field data from a C-only-field (which since r6341 gets ignored properly)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6342 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 18:49:23 +00:00
Giel van Schijndel 25a9402757 Add loading-specifications for enums MOVEMENT_MODEL and WEAPON_EFFECTS
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6340 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 17:25:43 +00:00
Giel van Schijndel 3cc8d0e1a2 * Use the database-meta-language code generator to generate a new stats loading function: loadPropulsionStatsFromDB
* Get rid of the (previous) handcrafted version for loadPropulsionStatsFromDB
 * Get rid of the old (handcrafted) `propulsion` table and replace it with the autogenerated `PROPULSION` table

NOTE: Only src/data.c src/stats-db.[ch] src/stats-db2.tpl got changed manually, the other changes where generated from these

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6337 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 16:28:23 +00:00
Giel van Schijndel 83b2440a3d Don't produce lines filled with only spaces (produce an empty one instead)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6336 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 16:28:20 +00:00
Giel van Schijndel 167510f3e7 * Add the option to specify custom string values for enums (which are * used when processing the database contents)
- New enum-field level qualifier: `%string "<string to use>";`
 * Use this to specify the custom strings for enum SENSOR_TYPE

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6335 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 16:28:17 +00:00
Giel van Schijndel 02183a272a Use the amount of rows instead of the highest ID number to determine the amount of SENSOR_STATS to allocate
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6334 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 16:28:15 +00:00
Giel van Schijndel 9a2788aca8 * structuredef.h depends on basedef.h so make sure to #include it
* Ignore ./src/stats-db2.tpl.sql.c from the Doxygen documentation (as it'll get included in stats-db2.c
 * Generate an alphabetical "compound" index for the Doxygen documentation
 * Make the typedef name of a struct, union and enum the entity's name in Doxygen

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6330 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 14:35:19 +00:00
Giel van Schijndel 5dc4adb8d5 Add Doxygen comments to the produced STATS_(BASE|COMPONENT) macros as well, to give Doxygen a chance to properly document structures that use these macros
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6329 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 14:08:23 +00:00
Giel van Schijndel db0253a0d8 * Use the database-meta-language code generator to generate a new stats loading function: loadSensorStatsFromDB
* Get rid of the previous (handcrafted) version for loadSensorStatsFromDB
 * Get rid of the old `sensor` table in the database and replace it with the autogenerated `SENSOR` table

This addresses #2


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6327 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 03:52:34 +00:00
Giel van Schijndel b918d96671 * Stuff the CONSTRUCT stats in the SQLite database
* Use the database-meta-language code generator to generate a new stats loading function: loadConstructStatsFromDB
 * Add a new resource type, DBCONSTR, which uses loadConstructStatsFromDB to load the construction stats
 * Employ this new type in "base"

This addresses #2


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6326 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 03:43:29 +00:00
Giel van Schijndel 139e643311 Fix a bug where the wrong variable is checked for an IMD filename
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6325 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 03:39:26 +00:00
Giel van Schijndel 1835d9aa04 Add a new code generator to generate a series of INSERT statements from the CSV files to fill a database with
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6322 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 02:20:42 +00:00
Giel van Schijndel 903b23ce7f Store SENSOR->location as "enum LOC" instead of an UDWORD
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6320 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 01:45:44 +00:00
Giel van Schijndel b2602011e6 Use %valsuffix instead of manual suffix appending
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6316 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 01:18:35 +00:00
Giel van Schijndel 5b1c63f31c Mark optional IMD_model fields as such
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6315 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-16 00:34:39 +00:00
Giel van Schijndel d2c8fbc5a8 * Change the database meta language script parser such that it's first parameter has to be a valid relative path to the code generator to use
* Change the make rules for all files produced from the database meta language such that they have the language parser and code generator as dependency as well (i.e. if they change their files will be rebuilt)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6312 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-15 21:39:00 +00:00
Gerard Krol 40c0b26930 Add the possibility to disable God Mode back in, on request from Giel. It should even look nice.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6308 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-15 15:43:18 +00:00
Gerard Krol 624838ea8c Clean up the God Mode ("deity") code. It is reduced to one line in visibility.c, instead of a lot of || godMode terms all over the
source. It looks better now as all effects are shown even for areas you officially can't see. The only disadvantage is that disabling it 
again looks really bad (structures remain visible). As I do not expect a lot of people to disable God Mode, you now can not turn it off 
anymore. 


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6307 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-15 14:28:04 +00:00
Gerard Krol 7f62ffded9 Actually draw the software cursor when enabled & in the main menu. This fixes #146 (no mouse cursor in main menu with coloured cursors enabled).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6304 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-15 09:06:12 +00:00
Per Inge Mathisen ba2163be9d Latest patch from ticket #97 - Smarter Structure Targeting Patch. Both droids and
structures should now be smarter about their automatic targetting.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6299 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-14 19:40:29 +00:00
Giel van Schijndel 7c05598cc1 * Use a for-loop instead of a while-loop to loop over a linked list of droid templates
* Don't constantly maintain a bool (bEqual) to see whether the current template is equal to the given template
  - Instead "continue" and skip to the next one instead when we've determined the current template isn't equal


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6298 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-14 18:56:40 +00:00
Giel van Schijndel 62b65404f1 * Don't loop over asParts and asBits arrays by using DROID_MAXCOMP as limit
- Use ARRAY_SIZE(array) as limit


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6297 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-14 18:47:55 +00:00
Giel van Schijndel 53fa475f5f Fix an out-of-bounds error resulting from using the wrong constant
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6291 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-14 14:34:57 +00:00
Giel van Schijndel b55c28e697 asprintf's return value indicates whether it failed; not it's first parameter -> use the return value instead
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6290 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-14 14:34:32 +00:00
Giel van Schijndel 05a709a3b3 * Make getPlayerName and getPlayerColourName const correct
* Fix a buffer overflow in getPlayerColourName resulting from translations for player colours being larger than the string buffer that was reserved for them
  - Instead just return gettext()'s return value (because "The resulting string is statically allocated and must not be modified or freed.")

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6283 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-13 22:42:05 +00:00
Giel van Schijndel 316335099d * Use ssprintf instead of sprintf to prevent potential buffer overflows
* Use a single call to ssprintf to create a string instead of ssprintf followed by strcat

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6282 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-13 22:42:02 +00:00
Gerard Krol 0e32c90ff5 The tile drawer now properly caps mountains at the edge of the map so you can no longer look through them. This patch also reduces the vertex array in
size. The tile drawer was allocating and using a vertex array the size of the whole map, now it only has one big enough to fit the visible tiles.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6270 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-11 00:05:44 +00:00
Gerard Krol 83beae8abe Add lots of Doxygen comments to display3d.c and clean it up a little.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6269 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-10 22:50:08 +00:00
Gerard Krol 1e39e46869 Allow a droid to pick a new target while auto-repairing. This fixes #35 and gna bug 12217 where droids would just let themselves be shot to
death while repairing themselves slowly.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6267 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-10 22:07:30 +00:00
Giel van Schijndel 57ea72c23d Prevent a potential buffer overflow in function enumerateMultiMaps by altering its interface
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6261 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-09 23:18:18 +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 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 be9e1706cd Do not show the intelligence screen after playing a mission update FMV anymore. This was previously done because the
FMV's were missing. A message "New Intelligence Report" is shown to remind people who abort the movie that they can see 
it again in the intelligence screen.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6253 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-08 22:47:49 +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
Per Inge Mathisen 1e257d38c1 Fix two warnings, reported by forum user jaakan.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6245 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-04 23:09:31 +00:00
Freddie Witherden d7413b0caf Commit the first part of patch #1088 (Gna!), which should fix the out-of-sync issues in multiplayer games.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6230 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-01 11:09:11 +00:00
Per Inge Mathisen 5ae79df9e3 Attempt a fix for recent out of map crashes.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6227 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-29 16:42:20 +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
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
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
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 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 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
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 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 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
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 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 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