Commit Graph

2120 Commits (75d615d1344a5904d06fbd42cd5a957b0351256d)

Author SHA1 Message Date
Per Inge Mathisen eb01bc2b64 patch #1064: Multi-threaded path-finding, this merges in the path-finding branch.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5735 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 14:37:53 +00:00
Per Inge Mathisen f6bf526248 Mostly cosmetic cleanup of naybor functions. Inline a macro that is only used once,
and break out of loop as soon as possible.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5734 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 12:32:30 +00:00
Buginator 6ccaa10f16 Enhances 'map preview' screen with map maker's ordering of the players position.
This allows players to get to the correct starting position on the map they picked, much easier.

Note, this uses a FBO.  If your card doesn't support it, then you will basically notice nothing different.  A fallback routine is done (but not in this patch), it is just waiting for a decent font *bitmap* that we can use.

Please see http://forums.wz2100.net/viewtopic.php?f=19&t=1953 for more discussion on the matter.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5733 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 04:28:58 +00:00
Giel van Schijndel 1f0410aeb5 * Slight refactoring of viewDataShutDown to reduce nesting
* Make the linked list manipulation actually ''work''

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5711 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-29 21:20:44 +00:00
Giel van Schijndel 164b02f4f0 Get rid of the `numFrames' fields that are only used by PSX code (it's only read in, but not used anywhere)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5710 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-29 21:20:31 +00:00
Giel van Schijndel 4ddff7023c Explicitly cast away constness in the script gettext functions
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5706 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-29 11:26:13 +00:00
Giel van Schijndel b5bfd1d8eb Win32 raw Makefile system:
* Compile message_parser.y ''before'' message_lexer.l and message.c, so that message_parser.tab.h is already generated when the former two start compiling

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5705 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-29 11:25:31 +00:00
Giel van Schijndel 763bc7bbd8 Add a new parser: message_parser which parses research message data in a significantly different format from the current CSV message format as "parsed" by loadViewData (this allows for easier gettext translation)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5695 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-28 21:01:05 +00:00
Giel van Schijndel 8eaf3bfa8b * Move constant MAX_DATA to messagedef.h
* Use strdup() instead of malloc() + strcpy()
 * Remove unused enmurant VIEW_TYPES

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5694 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-28 20:53:54 +00:00
Per Inge Mathisen 7f768ba83e Add naval propulsion, appropriating the unused 'Propellor'
propulsion for this purpose. To test, use 'give all' cheat
before design, and the ctrl+o menu to place.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5691 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-28 09:15:20 +00:00
Giel van Schijndel f7a433bf51 Add these gettext "macros" to the scripting engine: N_, P_, PE_, NP_, gettext_noop and pgettext, which work just like their C counterparts
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5689 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-28 02:12:59 +00:00
Giel van Schijndel 121a3fad11 * Add '_' and 'gettext' function, for gettext translation, to the script engine
* Include all *.slo files when parsing for translatable strings with xgettext

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5686 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-28 02:12:12 +00:00
Giel van Schijndel 3eabf084ad Get rid of the ID number cruft in the string resource system:
* At the only place where these ID numbers where used (scrValDefSave and scrValDefLoad), use the key-string instead (e.g. "ZNULLBODY" instead of 17)
 * Rename function strresGetStringByID to strresGetString
 * Increment event save file version to 4 (version of savegame.es files)
 * Reject loading of savegames that need to load non-NULL ST_TEXTSTRING variables from version < 4

NOTE: This may break current savegames of games that use scripts with variables of type TEXTSTRING in them (AFAIK currently only ''some'' campaign and tutorial savegames have these).

This closes ticket:19

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5685 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-27 23:58:49 +00:00
Giel van Schijndel 54ae7cda3a Remove useless wrapper function scrvGetString, which does nothing more than to forward its call to strresGetStringByID
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5684 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-27 23:51:56 +00:00
Per Inge Mathisen 599923b4a4 Remove unused code and fix some indentation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5683 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-27 20:13:41 +00:00
Per Inge Mathisen 0582c22c94 Allow the placement of droids from ctrl+o cheat menu on water when
they can drive on it. Also move a variable into more local scope.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5682 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-27 19:57:56 +00:00
Giel van Schijndel 45dc51512b * Add a new function transporterIsEmpty to determine whether a transporter holds no droids
* Allow sending of transporter droids when they're empty

Addresses ticket:5

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5681 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-27 13:38:17 +00:00
Giel van Schijndel 5f496b5b33 Allow (warning-less) compilation with Flex 2.5.33
Patch #1089 by Bertrand Coconnier <bcoconni>

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5679 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-27 13:34:58 +00:00
Giel van Schijndel 72d29fc343 Make function isDead const correct
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5677 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 21:48:02 +00:00
Giel van Schijndel 77b16be151 Fix a typo introduced in r5665
Patch by Buginator


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5672 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 17:12:58 +00:00
Roman C 35ed66a847 Restore the true Heightmap radar mode: ignore terrain type. The difference between the current one and 2 terrain radar modes is almost non-existent.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5670 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 11:42:37 +00:00
Giel van Schijndel 0340c2d9c3 Make it possible for the ST_GROUP loading code in function scrValDefLoad to accept higher savegame event data versions than 3
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5668 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 00:55:23 +00:00
Giel van Schijndel b40e7a6a90 Further hardcode the treap management code to the string resource system:
* Don't maintain a secondary linked list of strings in strres.c
 * Add the string that's tracked and it's ID number to the TREAP_NODE structure
 * Let the treap code manage its own memory
 * Have the treap code perform reverse lookups using either the resource string (i.e. not the "key" string) or associated ID number

NOTE: Searching a treap for anything else than the key is O(n), but that's no worse than a linked list, which is O(n) as well. Walking a treap has O(log n) as memory requirement, whereas walking a linked list has O(1) as memory requirement (stack size). So the only disadvantage is that searching the treap has a (highly remote!) possibility of stack overflows.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5666 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-25 20:27:54 +00:00
Giel van Schijndel dda033b53e Small refactoring and indentation fix to increase readability of gridIntersect
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5665 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-25 16:23:09 +00:00
Giel van Schijndel 88f428e37d * Make gridObjRange const correct
* Move commented out code into an #if 0 section (instead of /**/ comment)
 * Use function world_coord instead of manual multiplication by TILE_UNITS
 * Use the MAX macro to get the largest of two values (instead of manual comparison and selection of values)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5664 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-25 16:10:20 +00:00
Giel van Schijndel e8e664f85a * Get rid of function strresGetIDString who's only purpose is to determine whether the given ID string has a string resource associated with it, and if so return a string that's equal (according to strcmp) to the passed in ID string
* Replace the only use of strresGetIDString with a call to function strresGetStringByID, which will also return NULL on failure to find the given ID string

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5663 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 21:12:43 +00:00
Giel van Schijndel a0e779ceb8 * Add a new function strresGetStringByID which combines the functionality of strresGetIDNum and strresGetString
* Get rid of function strresGetIDNum with its inconvenient API and use strresGetStringByID instead

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5661 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 20:10:16 +00:00
Giel van Schijndel 12e5120e69 Replace the linked list of arrays of string pointers (premature) optimisation with just a linked list of strings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5660 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 18:57:09 +00:00
Giel van Schijndel 032b630b22 * Make the ppTextMsg string arrays of VIEWDATA and SEQ_DISPLAY hold there strings as const references
* Don't use strdup() to assign the strings to ppTextMsg's message array
 * Make seq_AddTextForVideo const correct

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5659 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 18:42:45 +00:00
Giel van Schijndel 47d02a31da * Change strresGetString to return its string as const (to prevent potential double-free problems)
* Instead use strdup() where a non-const reference to these strings is used
  * NOTE: This may introduce memory leaks, but I'd rather have memory leaks than double-frees, of which I'm frankly surprised that they don't occur ''much'' more often
 * Change FindDroidTemplate to take its parameter as const
 * Don't multi-purpose the parameters of FindDroidTemplate as local variables
 * Store string variables in getName as const
 * scrvGetString:
  * Directly return the string it retrieved and use NULL to indicate failure
  * Return the string as `const'

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5658 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 18:18:07 +00:00
Giel van Schijndel 8101f3bf5b * Change strresGetIDString to return its ID string const
* Change allocateName to do as the name suggests and actually ''allocate'' a string!

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5656 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 16:13:08 +00:00
Giel van Schijndel e3a7f0cab8 Return the retrieved string from strresGetIDString and allocateName and use NULL to indicate failure.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5655 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 16:13:03 +00:00
Freddie Witherden d9baa8d8b7 Break out of the droid sync loop early if there are no more droids to sync.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5653 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 14:11:14 +00:00
Giel van Schijndel 39d34b1880 Compiler warns about an uninitialized variable, `distanceExtensionFactor`, being used.
So initialize this variable with an "uninitialized marker" and assert that it doesn't occur in the places where this variable is used.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5651 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 13:59:07 +00:00
Freddie Witherden 6a94667dba Remove some dead #ifdef'ed code (#ifdef ARROWS).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5650 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 10:13:22 +00:00
Giel van Schijndel cf374ee5e1 * Move the definitions of the datatypes used by the string resource system from strres.h to strres.c
* Add a forward declaration for STR_RES to strres.h (so that we can still declare pointers to this type)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5645 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-22 22:36:23 +00:00
Giel van Schijndel d430c4b44d * Initialize global psStringRes to NULL
* Return the STR_RES* pointer from strresCreate and use NULL to indicate failure
 * Use size_t to store memory sizes in instead of UDWORD

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5644 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-22 22:33:10 +00:00
Giel van Schijndel 7125ab811c Access OpenGL headers on Mac OSX through OpenGL/<header> instead of opengl/<header> (lower case)
This fixes a compile error reported by <ruud> on IRC

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5641 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-22 20:23:24 +00:00
Giel van Schijndel 38f5b64c91 Add a new command line option: --flush-debug-stderr which causes the debug output to be flushed when used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5636 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 19:49:36 +00:00
Giel van Schijndel 7d42778f80 Don't #define DEBUG_GROUP0 in places where it cannot possibly be used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5629 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 00:52:33 +00:00
Giel van Schijndel d71055a5e0 * Replace uses of strcpy, strcat and sprintf with sstrcpy, sstrcat and ssprintf where possible
* Merge a translation string into it's printf formatting string (i.e. make the format string the translated string)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5621 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 22:46:55 +00:00
Giel van Schijndel a76577d94e Add some more informative debug messages to the ASSERTs of CHECK_OBJECT
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5582 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 01:23:16 +00:00
Per Inge Mathisen 3fb1c3e234 Add debug log calls to repair structure code to help debug
repair structure problems.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5569 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-16 15:47:33 +00:00
Per Inge Mathisen eb3ac2e356 Fix bug #11911: two patrol buttons. Patrol now has a new icon, drawn by
elio. Circle now has correct tooltip and uses old patrol icon. Some
spelling issues also fixed.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5565 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-16 12:06:26 +00:00
Per Inge Mathisen d98f300696 Show all buildings in radar window. This makes the building under attack
colour change feature work correctly, too.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5563 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-16 11:13:36 +00:00
Giel van Schijndel cb1db1ff61 #include stats-db2.h in stats-db.h, as the former is intended to eventually replace the latter
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5537 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 21:30:15 +00:00
Giel van Schijndel ec4784973e Add the used command line to crash dump reports
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5536 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 21:26:09 +00:00
Giel van Schijndel 7749b59280 Don't remove stats-db2.h when using "make clean"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5534 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 19:36:58 +00:00
Giel van Schijndel 5526f2c61a * Move type OBJECT_POSITION (and macro POSITION_OBJ to declare it) from structuredef.h to the new file positiondef.h
* Update build systems: autotools, raw win32 makefiles, Code::Blocks project and MSVC project
 * Rename _droid and _base_object forward declaration types to DROID and BASE_OBJECT respectively
 * Add two forward declarations for BASE_OBJECT and DROID to scriptfuncs.h so that it can declare pointers to these types
 * src/messagedef.h depends on lib/ivis_common/ivisdef.h and src/positiondef.h so #include those
 * Don't #include stuff from src/ in lib/script/chat_processing.h
 * Remove all unnecessary #inlucdes from src/ from lib/script/chat_lexer.l

NOTE: Build systems not mentioned above might need updating.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5531 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 18:15:03 +00:00
Giel van Schijndel 77f6e2e90c Print the dpid on NET_LEAVE messages as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5529 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 17:36:29 +00:00
Per Inge Mathisen 96f1ad47af Make CHECK_DROID() call a new function checkDroid() to make it more obvious
which check fails. You can still see in which file and line it failed, as before.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5526 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-13 11:54:41 +00:00
Giel van Schijndel 13c4c559c5 * Move the definition of struct BRAIN_STATS from statsdef.h to stats-db2.tpl
* Make it possible to declare "references" to struct WEAPON by adding a %fetchRowById code block


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5525 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-12 21:45:42 +00:00
Giel van Schijndel 1a17b936c9 Move the definition of struct WEAPON_STATS from statsdef.h to stats-db2.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5512 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 22:03:38 +00:00
Giel van Schijndel 859be18724 Move the definitions of structs SENSOR_STATS, ECM_STATS, REPAIR_STATS and CONSTRUCT_STATS from statsdef.h into a single definition in stats-db2.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5509 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 19:40:49 +00:00
Per Inge Mathisen ef7a4044e9 Fix bug that made droids seemingly explode randomly during the game. The cause
was that they would pursue the enemy on another person's computer, but not on
yours. Now your droids only decide to pursue on your computer, and sends updates
to other people about such decisions over the network. WARNING: Increases network
usage by unknown amount. Network sync rates could be lowered.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5507 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 17:57:25 +00:00
Giel van Schijndel 52255c0ee0 Move the definition of struct PROPULSION_STATS from statsdef.h into a single definition in stats-db2.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5506 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 17:53:41 +00:00
Per Inge Mathisen 6114b01fee Sanity check that structure production by droids have a target in unitUpdateBuild().
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5504 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 16:30:06 +00:00
Giel van Schijndel 14a6655690 * Rename macro COMPONENT_STATS and struct COMP_BASE_STATS to STATS_COMPONENT and COMPONENT_STATS respectively
* Move the definition of macro STATS_COMPONENT and the struct COMPONENT_STATS (which was created using the contents of the macro) from statsdef.h into a single definition in stats-db2.tpl


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5503 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 15:37:46 +00:00
Giel van Schijndel 8ea7e2c54c Move the definition of macro STATS_BASE and the struct BASE_STATS (which was created using the contents of the macro) from statsdef.h into a single definition in stats-db2.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5500 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 14:52:45 +00:00
Giel van Schijndel 44e01c2274 Move enums HIT_SIDE, PROP_SIDE and SENSOR_TYPE from statsdef.h to stats-db2.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5496 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 13:07:37 +00:00
Giel van Schijndel 72d3aac053 * Get rid of enumerators INVALID_MOVEMENT and INVALID_WEAPON_EFFECT from enums MOVEMENT_MODEL and WEAPON_EFFECT respectively
* Modify getMovementModel's and getWeaponEffect's API so that we don't need to depend on enums MOVEMENT_MODEL and WEAPON_EFFECT containing an "invalid" enumerator
 * Move enums MOVEMENT_MODEL and WEAPON_EFFECT from statsdef.h to stats-db2.tpl


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5494 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 12:56:22 +00:00
Giel van Schijndel 2f7cb15a81 The *real* meaning of HCI
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5493 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 12:41:42 +00:00
Giel van Schijndel 3ca7c41f58 Don't add %valprefix to %max
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5490 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 11:13:01 +00:00
Per Inge Mathisen 9e57d0b4ce Cosmetic improvement
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5489 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-11 09:42:00 +00:00
Giel van Schijndel 2ae0d61f00 * Get rid of enumerator INVALID_SUBCLASS from WEAPON_SUBCLASS
* Modify getWeaponSubClass's API so that we don't need to depend on enum WEAPON_SUBCLASS containing an "invalid" enumerator
 * Move enums WEAPON_CLASS and WEAPON_SUBCLASS from statsdef.h to stats-db2.tpl
 * Rename NUM_WEAPON_CLASS and NUM_WEAPON_SUBCLASS to WC_NUM_WEAPON_CLASSES and WSC_NUM_WEAPON_SUBCLASSES respectively


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5488 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 22:50:23 +00:00
Giel van Schijndel 136c2b245e Move enums FIREONMOVE and TRAVEL_MEDIUM from statsdef.h to stats-db2.tpl
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5487 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 22:27:41 +00:00
Giel van Schijndel 4b850382ab Add a new template file to automatically generate enum definitions (currently in statsdef.h) from. This template will eventually be used by the SQLite code generator to generate S
QLite stats-loading code from.
 * Move 4 enums from statsdef.h to stats-db2.tpl: COMPONENT_TYPE, LOC, BODY_SIZE and PROPULSION_TYPE
 * #include stats-db2.h (generated from stats-db2.tpl) in statsdef.h

NOTE: The automatically generated file (stats-db2.h) is included in the repository so that no changes in the buildsystems are required. The autotools build system is updated to be able to update stats-db2.h if required.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5485 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 22:02:48 +00:00
Dennis Schridde 022315eef0 Hardcode top_srcdir to make building from non-topdir possible, dont depend on the touch command, fix LDFLAGS to not depend on the removed TARGET variable
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5476 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 20:10:16 +00:00
Giel van Schijndel 66bfab9dcf Prefix all propulsion types (from enum PROPULSION_TYPE) with `PROPULSION_TYPE_` to qualify these names more fully
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5474 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 17:59:35 +00:00
Giel van Schijndel 26a9168ca9 Add a new configuration option "music_enabled" which can be used to disable the ingame music with
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5468 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 16:05:19 +00:00
Giel van Schijndel f6853ed368 * Get rid of enumerator INVALID_PROP_TYPE from PROPULSION_TYPE
* Modify getPropulsionType's API so that we don't need to depend on enum PROPULSION_TYPE containing an "invalid" enumerator

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5466 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-10 15:47:21 +00:00
Giel van Schijndel b3c43881a8 Don't #include "stats-db2.h" as it doesn't exist (is a testing file in my working copy)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5462 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 21:02:13 +00:00
Giel van Schijndel af9a1c2a18 Declare propulsionType as PROPULSION_TYPE (enum) instead of UBYTE in PROPULSION_STATS (struct)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5461 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 21:00:09 +00:00
Giel van Schijndel 2d6958306e Fix a compile error; forgot to declare variable "dummyVal" in r5454
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5459 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 20:43:24 +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
Giel van Schijndel 47e7107aea Remove `systemPoints` from the code as it's never used.
It's loaded in from the stats files but unused throughout the rest of the code.

Read into a temporary dummy variable when loading stats.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5455 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 19:07:20 +00:00
Giel van Schijndel 0d997d617f Remove `hitPoints` from the code as it's never used.
It's loaded in from the stats files and copied all over a dozen places, but never actually __used__.

NOTE: This __shouldn't__ break savegames, I've checked it quite thoroughly, but game.c is evil & large enough that the chance exists I made a mistake in this department.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5454 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 19:02:19 +00:00
Giel van Schijndel c6c5c981e6 Remove all TECH_LEVEL related cruft from the code as it's read from the stats files but unused throughout the rest of the code.
Read into a temporary dummy variable when loading stats.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5453 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-09 18:28:37 +00:00
Per Inge Mathisen ba1df9e976 Fix bug #11979: Distorted terrain tiles after savegame r5399, caused by r5399.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5429 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-08 19:20:00 +00:00
Dennis Schridde f77542e2f8 Move config dir on Windows back to My Documents
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5427 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-08 17:46:45 +00:00
Per Inge Mathisen 9bc09663f0 Prettify debug output from rebuildSearchPath
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5421 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-08 13:01:09 +00:00
Freddie Witherden dd86c02f97 Make it possible to translate Video Options
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5412 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 15:36:55 +00:00
Giel van Schijndel c135ae175f * ASSERT that VTOL weapon droids have more than zero weapons
* Allow non-weapon VTOL droids to be passed into vtolHappy (e.g. sensor, construction, etc.): this should fix bug #11865

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5411 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 13:11:27 +00:00
Giel van Schijndel 01108419db Did I say vtolHappy was somewhat error prone?
* Fix a bug in r5409 where I accidentily reversed the weapon-reloaded logic
 * Merge two nested if-statements


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5410 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 12:58:18 +00:00
Giel van Schijndel 81c8aa657c Further cleanup/refactor vtolHappy:
* Trash the bool-array (previously bitmask) code
 * Simply return false as soon as we've determined a VTOL isn't "happy" (i.e. marked as fully armed and healed)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5409 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 12:51:57 +00:00
Giel van Schijndel 316eae3a37 Improve readability/maintainability of function vtolHappy by using an array of bools instead of abusing a bitmask
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5408 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 12:47:04 +00:00
Giel van Schijndel 336656a0a8 Fix a bug introduced in r5406:
* VTOLs didn't ever become "happy" again (i.e. where marked as fully armed and healed)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5407 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 12:44:00 +00:00
Giel van Schijndel 9c501e4641 vtolHappy: move the body-health check outside of the weapon check
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5406 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 12:31:06 +00:00
Giel van Schijndel 7db47c827e vtolHappy (what IDIOT wrote this btw??): only construct a bitmask once to increase readability/maintainability
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5405 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 12:21:26 +00:00
Giel van Schijndel e8c9f8a0ec Rename function vtolDroid to isVtolDroid:
* This name more clearly describes what it does: determine whether the given droid has VTOL propulsion

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5404 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 10:15:00 +00:00
Giel van Schijndel 1a5277de1d Proper constness: make vtolDroid and vtolHappy take their DROID* parameter as const
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5403 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-07 09:38:55 +00:00
Dennis Schridde 302a557478 Rename "raw" Makefiles to "win32" Makefiles
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5402 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 14:29:04 +00:00
Dennis Schridde ec5aeaf3c7 Make "SCRIPT" release function just indirectly point to scriptFreeCode, so the function types are strictly compatible.
Clean scriptFreeCode's formating and remove unnecessary checks for ptr!=NULL before freeing.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5400 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 14:02:46 +00:00
Dennis Schridde 547ec7d49e TILE_NOTBLOCKING -> BITS_NOTBLOCKING, and store it in tileInfoBits instead of texture
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5399 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 13:57:03 +00:00
Giel van Schijndel 409bafbdf5 Turn the assert()s in the CHECK_STRUCTURE macro into ASSERTs so that we can see *which* assert failed
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5395 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-06 11:28:01 +00:00
Giel van Schijndel 693c8292ff Provide a more useful error message than "Weirdy action on keymap processing".
Instead print the enum-number which we used to switch on.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5356 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-03 14:57:18 +00:00
Dennis Schridde 45b8413abf Improve readability of renderFeature by returning early, adding some comments, etc
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5350 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-30 17:07:41 +00:00
Dennis Schridde 45f23a4926 Merge commit 'HEAD@{3}'
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5347 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-28 22:32:44 +00:00
Per Inge Mathisen aed2a94cd0 Move two vars into more local scope, and improve two asserts, then add a
fallback fix for non-debug builds. This to improve tracing of bug #11908:
crash - some assertion failed.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5345 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-28 19:44:23 +00:00
Per Inge Mathisen 5ea6c60eee Do not initialize music sound system when --nosound option given.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5343 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-28 15:32:06 +00:00