Commit Graph

4559 Commits (7f768ba83ee37aad96b5c33a16577bd2dbd841e9)

Author SHA1 Message Date
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 49944c6e3b * Remove several unused strings
* Move some strings to scripts

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5690 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-28 02:46:36 +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 40a8a0c1ff Remove several unused strings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5688 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-28 02:12:52 +00:00
Giel van Schijndel 8175833f5b * Move all translatable strings used by the tutorial into the tutorial's script file and out of the string resource file (`tutstrings.txt`)
* make -C po update-po

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5687 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-28 02:12:42 +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 04f5392dd2 Fix stock AI's `takeover` trigger:
* Called upon receiving a CALL_UNITTAKEOVER event, which is sent when handing over droids or "stealing" them using the NEXUS turret
 * Prevent it from trying to add command or transporter droids to any groups, as these droids cannot be added to a group

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5678 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 21:48:15 +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
Roman C f1c2eacb00 Fix release build on MSVC. Patch by Buginator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5676 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 20:41:16 +00:00
Giel van Schijndel 0da42eeaff Link ''with'' all symbols exported to the dynamic symbol table
* This option is needed to allow retrieving of decent back traces using backtrace_symbols_fd (GNU raw back trace extension) has some symbols to work  with

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5675 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 18:50:29 +00:00
Giel van Schijndel 45539212bf Change the download location of the Popt sources to http://rpm5.org/files/popt/popt-1.10.4.tar.gz
Patch by Tim Baumgartner <baum> (file #4615 attached to bug #11940)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5673 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 18:30:55 +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 2eba906351 Aivolution AI builds bunker buster tanks again.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5671 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 16:09:55 +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
Roman C a412bf4b17 An attempt to fix "interpRunScript: max instruction count exceeded - infinite loop ?" error.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5669 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 11:28:54 +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 f2bc3c056f Change the debug message about a string that couldn't be found from an error message into a warning message because it seems to occur quite often
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5667 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-25 22:14:47 +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 8a41fb89d3 Make function strresStoreString const correct
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5662 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 21:12:39 +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 da3c28efa2 * Move the allocation and initialisation of STR_ID structures to a function of its own: strresAllocIDStr
* Allocate STR_ID structures in such a way that a single free() call on it will suffice as cleanup

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5657 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 16:13:14 +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
Giel van Schijndel e8efe132f8 * Get rid of global variable *psCurrRes, which is used by the strres_parser to operate on
* Instead pass the current STR_RES* pointer to work on to the parser function

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5654 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 14:16:27 +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 16e5fd8764 Get rid of the ID_ALLOC bitflag (marks strings allocated by the string resource system), as ''all'' strings are allocated by the string resource system anyway.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5652 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-24 13:59:16 +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 8eb2ed2827 Add some ASSERTs which I think should always hold true for the purpose of ''understanding'' the string resource code. As it's difficult to understand, due to it multi-purposing one variable to hold two semantically different values (at the same time!).
In any case I ''think'' these ASSERTs always hold true, (and for the testing I've done so far they do). But I'd like some more certainty and confirmation, hence why I'm committing this (before I make changes that rely on that assertion holding true), so other people get a chance to test this and prove my assertion wrong.

Thus, ''if'', these ASSERTs are triggered, please open a bugreport or otherwise notify me of it (e-mail, IRC, text message, postal mail, phone call, etc.)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5649 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-23 23:42:18 +00:00
Giel van Schijndel 0651625733 * Remove unused variable `line_num`
* win32 Makefile system:
  * Compile with debug symbols and all warnings enabled on both debug ''and'' non-debug builds
  * Only use -Werror-implicit-function-declaration when compiling C sources, as for C++ implicit function declarations are illegal anyway (and g++ thus doesn't like this compiler option)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5647 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-23 13:59:12 +00:00
Giel van Schijndel c1fb0af729 * -mwindows is a linker flag, so move it from CFLAGS and CXXFLAGS to LDFLAGS
* autorevision is a command line utility, not a GUI program, so strip the -mwindows flag from its linker flags

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5646 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-23 13:48:50 +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 4f3c6d39a4 * Return the resulting STR_BLOCK* from strresAllocBlock and return NULL on failure
* Use calloc instead of a malloc followed by memset(0)
 * Check the return value from malloc&calloc for ''all'' invocations of it

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5643 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-22 22:14:48 +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 de70b9ceb8 Add all translations in po/ to the NSIS installer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5633 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 19:29:49 +00:00
Giel van Schijndel cce9e1d768 Include the "Bold" face of DejaVu Sans Mono as well in the NSIS installer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5632 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 19:19:56 +00:00