Commit Graph

979 Commits (1b0ae0932005a955fc00225ac8f5cf49980bd01f)

Author SHA1 Message Date
Giel van Schijndel aabf08d6fa Change the UTF-8 encoder and decoder to only accept valid Unicode codepoints, not just every representable 32 bit unsigned integer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5914 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-01 19:10:03 +00:00
Giel van Schijndel 0e88a86b8e Add two new functions: utf(8|16)_char_at_offset, which return a pointer to the index-th character in the given stream
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5911 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-31 20:39:17 +00:00
Giel van Schijndel f0f68e7386 Rename utf8.[ch] to utf.[ch] because it deals with different UTFs (Unicode Transformation Format) but not just specifically with UTF-8
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5910 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-31 20:06:40 +00:00
Giel van Schijndel d3eaf3bbd1 Add several new functions for converting between UTF-8 and UTF-16 to utf8.[ch]
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5902 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 15:15:16 +00:00
Giel van Schijndel a0cdfd44ab Rename utf8_(encode|decode) to utf8_(encode|decode)_utf32 because they convert between UTF-8 and UTF-32
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5901 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 15:15:09 +00:00
Giel van Schijndel dfa9c2bc01 Rename function unicode_strlen to utf32_strlen because it really determines the length of a UTF-32 encoded string
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5900 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 13:49:11 +00:00
Giel van Schijndel 2cb4c71883 * Split out the code that encodes a single Unicode character as UTF-8 into a separate function: encode_utf8_char
* This will allow encoding of Unicode strings to UTF-8 regardless of its current encoding

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5899 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 13:47:15 +00:00
Giel van Schijndel ac08ca70b0 * Seperate out the part that determines a single Unicode character's (codepoint actually) length when encoded as UTF-8 into a separate function: unicode_utf8_char_length
* This will allow determining of the length of a string when encoded as UTF-8 regardless of its current encoding

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5898 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 13:47:06 +00:00
Giel van Schijndel 5222037799 Move the duplicated UTF-8 decoding code out of functions utf8_character_count and utf8_decode and into new function decode_utf8_char, which only decodes a single UTF-8 character sequence
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5897 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 13:24:27 +00:00
Giel van Schijndel b10871a0ab Add utf8.c to the win32 makefile system (which I forgot in r5895)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5896 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 12:38:26 +00:00
Giel van Schijndel d45e64bf55 Reintroduce utf8.{c,h} for encoding and decoding UTF-8 strings
This is meant to be used with betawidget

This is a revert of r2477 (which removed the UTF-8 module)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5895 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 12:34:46 +00:00
Ari Johnson d5b341334d More changes from #ifdef __APPLE__ to #if defined(WZ_OS_MAC)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5880 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-27 15:24:21 +00:00
Freddie Witherden 55be99a19d Add sync-to-vblank support to Warzone; this closes ticket #38.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5871 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 18:01:49 +00:00
Giel van Schijndel 173ee31214 * Split ASSERT out into ASSERT_HELPER:
* ASSERT_HELPER can be used by debug functions that wish to alter the location information attached and printed with ASSERTs
 * Add some missing semi-colons (the previous ASSERT macro had a terminating semi-colon)
 * Change an ASSERT that checks calloc's return value into an if() block (we can also run out of memory on non-debug builds...)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5865 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-24 15:42:59 +00:00
Giel van Schijndel 5e593ad615 Add platform detection code for GNU/kFreeBSD (OS with FreeBSD kernel and GNU utilities and libraries) to allow compiling on this system
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5794 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-11 15:29:44 +00:00
Per Inge Mathisen 6f89f25b80 Attempt fix for bug #12118: Could not find string for ID. Has high risk for creating
more asserts - please report them to me.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5781 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-07 15:40:21 +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 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 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 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 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
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 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 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 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 ef6fa22424 Fix a wrong call to calloc (parameter list was malloc style)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5631 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 01:00:37 +00:00
Giel van Schijndel f6a6179569 * Use calloc instead of malloc followed by memset(0)
* Use an unsigned int instead of UDWORD as we don't depend on the size guarantee
 * Move the definition of aUsage into #ifdef DEBUG_CHECK_FOR_UNUSED_STRINGS, because that's the only place where it's used

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5630 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 00:57:32 +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 a3ecb8a325 Get rid of the custom TREAP* structure and instead use a pointer to a pointer to a TREAP_NODE** structure
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5628 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 00:43:33 +00:00
Giel van Schijndel 7c8789f108 * Don't associate line number and file information with calls to treapAdd, as it is only called once
* Replace use of the forwarding macro TREAP_ADD with a direct call to treapAdd
 * Remove treap debugging code (actually that's what the above changes effectively accomplished)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5627 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 00:30:55 +00:00
Giel van Schijndel b94c297371 * Don't associate line number and file information with calls to treapCreate, as it is only called once
* Replace use of the forwarding macro TREAP_CREATE with a direct call to treapCreate
 * Return the TREAP* pointer directly from treapCreate and use NULL as an indicator for failure

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5626 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 00:23:36 +00:00
Giel van Schijndel d22a2dcf82 Add table entries to the language tables in i18n.c for the newly added translations of r5596:5597
* Basque (eu)
 * Latvian (lv)
 * Norwegian Nynorsk (nn)
 * Slovenian (sl)
 * Swedish Sweden (se_SE)
 * Turkish (tr)
 * Uzbek Cyrillic (uz)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5599 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 22:23:06 +00:00
Giel van Schijndel 3814e5f511 * Update the locale lists for Windows and Unix: add all languages in po/ to them
* Change the Windows locale list to allow specifying sublanguages as well


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5598 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 22:01:20 +00:00
Giel van Schijndel 1b8a62deca Make the treap code specific for string resources
Because the treap management code is only used by the code for string resources, make it specific for these string resources and don't use casting back & forth from void* all over the place. This simplifies the interaction of string resource code with treap code.

This will allow an easier cleanup and eventually a removal of string resource code. As the string resource code can eventually be replaced with gettext code instead.

This closes #18

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5586 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 19:15:02 +00:00
Giel van Schijndel ed3f1508b8 * Remove the dumpLog function and associated code from debug.c
* Add a new function dbgDumpLog to dumpinfo.cpp for dumping the last debug messages
 * Add a debug output callback to dumpinfo.cpp which is used to fetch the debug messages and store them in a ring buffer


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5581 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 01:08:07 +00:00
Giel van Schijndel 859196ed2c Move duplicated code, for printing to ''all'' debug output callbacks, to a function of its own.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5580 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-18 23:13:49 +00:00
Giel van Schijndel 9d77329842 * Add a new statically-sized string macro vssprintf, which allows printing to statically sized strings just like ssprintf, with as difference that this macro function operates similar to vsprintf rather than sprintf
* Replace uses of strncmp, snprintf and vsnprintf with sstrcmp, ssprintf and vssprintf respectively


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5579 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-18 22:47:28 +00:00
Giel van Schijndel 0d670c0409 Don't bother checking whether bitflag ID_ALLOC is set before removing it, the end result is the same anyway: ID_ALLOC being absent from the bitmask/number
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5558 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-15 11:46:12 +00:00
Giel van Schijndel d7a0c2fa9b Don't bother checking whether bitflag ID_ALLOC is set before removing it, the end result is the same anyway: ID_ALLOC being absent from the bitmask/number
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5553 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 23:17:23 +00:00
Giel van Schijndel 0c4b256797 * Out with the (unnecessary! as the size guarantee isn't required) WORDs from treap.[ch]
* Restructure treapStringCmp to be __readable__

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5551 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 22:09:31 +00:00
Giel van Schijndel 8db7c031ff Fix some compile errors that occur when DEBUG_TREAP is #defined
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5550 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 22:09:15 +00:00
Giel van Schijndel 379a905c6c * Move the type definitions of TREAP_NODE and TREAP from treap.h to treap.c (use a forward declaration in the header instead)
* Don't strdup strings retrieved from __FILE__ directives; just store const char* the pointer instead (prevents a memory leak as well)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5549 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 20:41:22 +00:00
Giel van Schijndel 9e70aaf07c Get rid of macro TREAP_NODE_DEBUG and move its contents to the only location where it's used: struct TREAP_NODE
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5548 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 20:25:48 +00:00
Giel van Schijndel 077d4efefe * Remove unused functions treapReset, treapDisplayRec and treapDisplay
* Remove unused macro TREAP_DISPLAY
 * Directly use function treapGetSmallest, treapDel, treapFind and treapDestroy instead of macros TREAP_GETSMALLEST, TREAP_DEL, TREAP_FIND and TREAP_DESTROY respectively

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5547 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 20:22:19 +00:00
Giel van Schijndel 9f3371dc33 Remove macro TREAP_NODE_BASE and move its contents directly into TREAP_NODE as that's the only place where this macro is used.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5546 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 17:53:03 +00:00
Giel van Schijndel 6e9db52984 Get rid of the unused, default comparison function for the values in treap nodes
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5545 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 17:49:10 +00:00
Giel van Schijndel 730188c081 * Get rid of treapint.h which declares prototypes for functions that are only used in treap.c.
* Declare these functions with static linkage instead.
 * Update autotools buildsystem, Code::Blocks project and MSVC project, raw win32 Makefiles don't need an update

NOTE: This may require updating of buildsystems not mentioned above

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5544 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 15:19:08 +00:00
Giel van Schijndel 514d96d72a * Don't #inlcude treap.h in frame.h as only a single file within Warzone depends on the treap code
* Use a forward declaration in strres.h to declare a pointer to a TREAP instead of importing the full treap.h declarations in strres.h and thus large portions of the codebase
 * Rename TREAP's forward declaration name from _treap to TREAP

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5543 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 15:09:00 +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
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 6b8aeb1aaa Add clipf() to clip float values
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5348 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-29 12:07:26 +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
Dennis Schridde 050ec39c11 Use the (also new in this commit) relative variants of the directories almost everywhere.
Exception is when generating the .wz files, where we need the path to the build directory and building a reverse relative path to $(srcdir) will be messy.
Also silence submake.mk a great deal.
Bug #11883 should be fixed now for the most part.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5325 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 23:41:52 +00:00
Dennis Schridde fd2bfb0e0f Prepare for another fix for parts of bug #11883: Issues with the improved raw Makefiles
- Rename Makefile.raw to lowercase


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5321 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 22:48:45 +00:00
Dennis Schridde 73b35ab8d6 Rename top_srcdir/top_builddir to abs_top_srcdir/abs_top_builddir, to make this more obvious.
Their use is currently flawed, since it will not work in directories with spaces in them... (


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5319 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 20:19:54 +00:00
Dennis Schridde 452b737b64 Output gameTime for debug messages. Should make it easier to recognize relevant messages and their relation over time.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5317 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-24 18:07:45 +00:00
Dennis Schridde 9bd8b24921 Boost raw Makefiles
- Use PACKAGE, PACKAGE_VERSION, remove VERSION
- Allow out-of-source-dir builds (mkdir build && cd build && make -f ../Makefile.raw)
- Move config.mk from $(top_srcdir)/makerules/config.mk to $(top_builddir)/config.mk
   When keeping current behaviour (srcdir=builddir), this means: Move it from makerules into the main directory


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5308 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-23 13:54:47 +00:00
Giel van Schijndel 3b4df24942 Use WZ_DECL_UNUSED for the data parameter of debug_callback_win32debug to squelch the warning about it being unused
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5211 4a71c877-e1ca-e34f-864e-861f7616d084
2008-06-04 17:50:40 +00:00
Dennis Schridde 8836ce7a4b warning: converting of negative value `-0x000000001' to `UDWORD'
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5206 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-31 23:17:27 +00:00
Giel van Schijndel 19b80a1a6b Make sure to parse `database` __before__ `file` (i.e. group it with other tokens starting with a `d`) to make sure that it gets recognised at all
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5198 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-28 20:55:49 +00:00
Giel van Schijndel c0296aa371 * Apparently the %destructor feature of Bison is implemented differently for 2.1 than it is for 2.3 (or it is broken in 2.1); so don't use it when compiling with Bison 2.1 (leak memory instead)
* Assume __all__ windows builds use Bison 2.1 (this isn't correct, but it's the best I can currently do, as Bison provides no version macros aside from a string macro)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5196 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-27 21:37:54 +00:00
Giel van Schijndel 1d739ce56b * Pass the table name as well from the .wrf resource file
* "table" will now attempt to load the given resource type from the given table (in the currently opened database)
 * Maintain the current database's name (for error message, etc.)
 * Pass the table name to the database loading functions and use it (in combination with sqlite3_mprintf) to produce the SQL statements


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5189 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-25 19:38:59 +00:00
Giel van Schijndel 452c167e9a * Add a new resource loading function type: RES_TABLELOAD
* Add two new keywords to the .wrf files: "database" and "table"
  * "database" will cause the given filename to be opened as a database file (using SQLite3)
  * "table" will attempt to load the given resource type from the currently opened database
 * Don't open the database in the file loading functions (src/data.c) anymore; turn them in table loading functions instead (which get the current database passed as a paramter)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5188 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-25 19:38:53 +00:00
Giel van Schijndel 855ec725d4 Use sstrcpy|sstrcat instead of strlcpy|strlcat for manipulation of statically sized strings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5176 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-25 13:46:49 +00:00
Per Inge Mathisen 4d845c8067 Fix debug log calls going off when they shouldn't
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5147 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-22 19:33:05 +00:00
Dennis Schridde f94ee4683d *cough*
rad2deg should not look like deg2rad...


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5146 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-22 18:27:48 +00:00
Giel van Schijndel 0118573321 Work around Flex 2.5.33 implicitly defining yyget_extra() (rather than forward declaring it)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5130 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-17 10:49:33 +00:00
Dennis Schridde b77dfdadad Simplification and slight speedup for trigSin/trigCos. Make trigIntSqrt wrap sqrtf, since the old lookup implementation was probably slower than that.
Author: Björn Bredthauer <Bjoern.Bredthauer@gmx.de>
Date: Thu, 15 May 2008 01:28:55 +0200
Signed-off-by: Dennis Schridde <devurandom@gna.org>


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5122 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-15 00:19:47 +00:00
Dennis Schridde 2334f84c84 Remove unneccessary modulo
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5120 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-14 22:59:00 +00:00
Dennis Schridde be2b8a35ab clip() function for integers (Like CLIP macro) and some slightly altered comments/variable names.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5104 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-13 23:19:10 +00:00
Giel van Schijndel 7be6f76ba3 Remove our own custom definition of YYLMAX (give Flex the liberty of determining this itself)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5091 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 19:55:55 +00:00
Giel van Schijndel f8e4607093 Fix an error causing us to use the wrong names for yyget_extra(), yyset_extra(), yyget_lineno() and yyget_text()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5089 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 19:40:53 +00:00
Giel van Schijndel 10f021f279 Fix a syntax error introduced in r5086
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5087 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:58:41 +00:00
Giel van Schijndel 59a1c05037 Cleanup:
* Remove our own strcpy implementation: stringCpy
 * Don't use "d = malloc(strlen(s) + 1); strcpy(d, s);" to copy a string into fresh heap memory, use "d = strdup(s);" instead
 * Fix indentation


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5086 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:56:42 +00:00
Giel van Schijndel 942350278b * Put textual tokens as found by strres_lexer.l in heap memory rather than some crazy stack-like static string buffer
* Make sure that this heap memory __will__ be released regardless of syntax errors during scanning
 * Reduce code duplication in strres_parser.y by reducing a single parsing rule with duplicated code up into two rules


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5085 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:47:25 +00:00
Giel van Schijndel dfaf3cea17 * Use yytext instead of strres_text
* Get rid of lexer function strresGetErrorData and use strres_get_lineno() and strres_get_text() instead
 * Don't call abort() in function strres_error as the parser will return an error anyway (causing strresLoad to return false)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5084 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:35:36 +00:00
Giel van Schijndel fdc48bfc94 * Use the lexer_input framework instead of a custom YY_INPUT implementation for strres_lexer.l
* Don't bother to check whether we're in a comment when reaching the end of a string resource file


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5083 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:22:05 +00:00
Giel van Schijndel fae3c7da53 Don't duplicate code that appears in both branches of an if-statement
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5082 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:16:30 +00:00
Giel van Schijndel 2f98b6e39a Minor cleanup and add Doxygen comments
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5081 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:09:25 +00:00
Giel van Schijndel 251317bd9a Cleanup (behaviour should be unchanged)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5080 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:03:26 +00:00
Giel van Schijndel d73949e336 * Put textual tokens as found by resource_lexer.l in heap memory rather than some crazy stack-like static string buffer
* Make sure that this heap memory __will__ be released regardless of syntax errors during scanning


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5079 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 18:00:09 +00:00
Giel van Schijndel 636bce3996 From resource_parser.y: "No longer static ... lets use this area globally":
* Lets __not__ use very bad practices just because we can!!! Make it static again
 * Give strres_lexer.l such an array of its own (static as well)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5077 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:50:49 +00:00
Giel van Schijndel 7caf01c08f Use yytext instead of res_text
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5075 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:41:00 +00:00
Giel van Schijndel 1aed007c3e Attempt to match an empty string __before__ a non-empty one (otherwise we won't ever match it at all)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5074 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:38:45 +00:00
Giel van Schijndel 6bb4f86529 * Get rid of lexer function resGetErrorData and use res_get_lineno() and res_get_text() instead
* Don't call abort() in function res_error as the parser will return an error anyway (causing resLoad to return false)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5073 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:34:56 +00:00
Giel van Schijndel f7419596e2 * Use the lexer_input framework instead of a custom YY_INPUT implementation for resource_lexer.l
* Don't add the function name to the debug message in openLoadFile as debug() does that itself already


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5072 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:23:33 +00:00
Giel van Schijndel 78f93d3055 Reduce code duplication that occurs in both branches of an if-statement
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5071 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:13:11 +00:00
Giel van Schijndel 6bd36ba163 Don't bother to check whether we're in a comment when reaching the end of a WRF file
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5070 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-12 17:04:32 +00:00
Per Inge Mathisen 36e2ff2517 Update changelog in trunk as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5056 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 22:11:28 +00:00
Roman C fcfae543ba Revert r5043 because of compilation problems on non-MSVC systems.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5049 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 15:25:43 +00:00
Per Inge Mathisen 91727f270b objTrace() no longer requires a debug part parameter, and always outputs the ID
of the traced droid.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5047 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 14:58:20 +00:00
Roman C da83c65c9c Output script call stack on ASSERT.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5043 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 11:51:23 +00:00
Roman C b40f5dd5a3 Get rid of some more compiler warnings on MSVC.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5032 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-11 10:17:49 +00:00
Giel van Schijndel 701f65469c * Provide an abstraction of YY_INPUT so that we have a single definition which we can use in multiple lexers which can read from both in-memory buffers as well as PhysicsFS files
* Utilise this new version of YY_INPUT in script_parser and script_lexer


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5008 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-10 00:35:24 +00:00
Giel van Schijndel b58d508ce6 Doxygenize the parameterlist of frameInitialise
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4943 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-05 23:17:35 +00:00
Giel van Schijndel 01958db9a0 We don't #define HAVE_STRLCPY or HAVE_STRLCAT in the configure script anymore
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4939 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-05 15:12:32 +00:00
Roman C 2c7d52d0c8 Fix MSVC compilation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4914 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 12:55:05 +00:00
Per Inge Mathisen 221a2cb4ee Remove MSVC support for WZ_DECL_CONST since it didn't work.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4913 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 12:34:20 +00:00
Per Inge Mathisen 6e9732a86a WZ_DECL_CONST now implies WZ_DECL_WARN_UNUSED_RESULT and also works on MSVC.
WZ_DECL_RESTRICT now works on MSVC as well.
WZ_DECL_THREAD added, declares variables thread local, support for it made mandatory.
WZ_ASSERT_STATIC_STRING (gcc only) to assert that a string is static added.
The sstr functions now support pointer-length strings again.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4908 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 11:43:28 +00:00
Giel van Schijndel 31fda8026b Don't call function pointers when they're NULL (fixes a segfault bug that occurs when a resource type without release function couldn't be loaded)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4896 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 10:24:36 +00:00
Giel van Schijndel 03bc81c0fb #include "frame.h" in strlfuncs.h; to hopefully fix bug #11609
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4889 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 20:59:35 +00:00
Giel van Schijndel 5154d575da Assert that the pointers to strlcpy & strlcat are not NULL
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4878 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 12:38:44 +00:00
Giel van Schijndel b9857f9bf9 Detect whether the OS already supplies strlcpy and strlcat and don't define our own if it does:
* Add m4 macros AC_STRLCPY_CHECK and AC_STRLCAT_CHECK for use in the autoconf script
 * Don't define our implementation when HAVE_STRLCPY or HAVE_STRLCAT is defined

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4876 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 12:04:20 +00:00
Per Inge Mathisen 5034cedfd4 Rename astrlcpy and astrlcat to sstrcpy and sstrcat. Add ssprintf and sstrcmp also.
Renaming due to name conflict with a gnu extension. Added debug versions of all the
above, that assert if a char* pointer is passed in. This means they cannot be used
with strings shorter than the shortest expected length of void*.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4865 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-30 17:26:38 +00:00
Roman C c3ace2ec9f Redefine __STDC__ to 1, this fixes MSVC compilation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4855 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 15:05:08 +00:00
Giel van Schijndel b047f2c1ef Work around MSVC not #defining __STDC__ (all ISO C89 compliant compiles _should_ #define that macro)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4854 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 14:32:14 +00:00
Giel van Schijndel 61c8bbc4b9 * Don't "Guarantee nul-termination" after snprintf as snprintf does that itself already (per the C99 spec)
* Use strlcpy for copying strings instead of snprintf "%s"
 * Don't cast the return value from vsnprintf to (void)
 * When we use va_start make sure to use va_end as well...
 * Fix indentation


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4785 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-26 14:21:41 +00:00
Per Inge Mathisen 914cf90fb4 Add macros astrlcpy and astrlcat that work like strlcpy and strlcat
but with automatic length detection for fixed size arrays.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4777 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-26 12:08:30 +00:00
Giel van Schijndel 73fcb5eb6a Enable NLS for our parsers when it's enabled for us (using --enable-nls)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4700 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-20 16:38:27 +00:00
Per Inge Mathisen f0226edf93 Add new debug level for messages and new log calls.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4685 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-19 21:41:18 +00:00
Per Inge Mathisen 28669696a4 Clean up debug log. We now print the function name first automatically - no need to
put that into the debug call. Rename some categories to make them line up correctly in log.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4684 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-19 14:52:35 +00:00
Per Inge Mathisen 69a4b6a380 Fix bug #11520: crash when saving the game in campaign mission alpha 4, reported
by Jan Dittberner. If a tagfile group had only default values, it would consume
the group end tag and the rest of the file would be read corrupt.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4681 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-18 20:43:07 +00:00
Giel van Schijndel 1585b7d55a Add a workaround for the X11 headers #defining Status (i.e. #undef it), to prevent problems
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4672 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-17 20:55:46 +00:00
Giel van Schijndel c6a0ad011e restrict is not a keyword to C++, so don't use it when compiling as C++
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4615 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-14 21:39:14 +00:00
Giel van Schijndel ff663196a3 * Forward declare debug_callback_win32debug when compiling for Windows
* Don't define windowsExceptionHandler when compiling with MinGW (as we don't use it on MinGW)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4587 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-13 22:54:58 +00:00
Per Inge Mathisen f64e3a8033 Fix bug in tagfile where we would not skip boolean values properly.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4542 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-07 20:01:56 +00:00
Roman C ab1629285b Fix MSVC compilation. Patch by Buginator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4533 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-06 16:07:36 +00:00
Per Inge Mathisen 0edf5f08e5 Fix erronous handling of skipped group separators in the tagfile code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4527 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-06 13:14:12 +00:00
Per Inge Mathisen 8dca456c24 Fix bug in tagfile code. We would not properly skip groups that we did not intend to read.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4526 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-06 12:13:41 +00:00
Ari Johnson 685948940e Fixed cursors16.c to work again
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4525 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-06 03:20:27 +00:00
Giel van Schijndel 678edfead2 Provide an alternative `dumpLog` implementation:
* one that works with the POSIX write() syscall on an integer file descriptor
 * and one that works with WinAPI's WriteFile() function on a HANDLE

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4513 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 23:37:46 +00:00
Per Inge Mathisen 3dafc4e62a Fix some warnings generated by -Wextra
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4492 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 16:22:05 +00:00
Per Inge Mathisen 274ae7c9a4 Enforce strict function prototypes for autoconf builds, and fix function prototype problems.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4487 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 15:34:55 +00:00
Giel van Schijndel 665e57dc12 Move the exceptionhandler to a directory of its own
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4484 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 15:11:43 +00:00
Per Inge Mathisen b41b7358b7 Add safer, proven versions of strlcpy and strlcat from OpenBSD.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4483 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-05 11:45:29 +00:00
Roman C 0ee1e1b965 Fixed warnings on MSVC.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4469 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-02 17:39:42 +00:00
Roman C 4f0e59e488 Remove ENABLE_NLS, since it breaks compilation on MSVC.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4467 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-01 20:00:47 +00:00
Dennis Schridde b2d8cd5187 ENABLE_NLS for MSVC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4464 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-01 17:14:17 +00:00
Freddie Witherden 59f951b0bc Update the arrayMin[F] functions so that they now return the min value and set the index. Also add arrayMax[F] versions.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4461 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-01 11:26:53 +00:00
Freddie Witherden 4e0c1dbafd arrayMinIndex: now in float form\!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4460 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-31 23:16:01 +00:00
Freddie Witherden 0587cf8674 A the helper arrayMinIndex, which will return the lowest item in an array of ints.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4459 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-31 22:58:34 +00:00
Per Inge Mathisen 3ee8a3ed7f Add beginnings of a game self-test. Start with --selftest command line option.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4433 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-30 14:36:11 +00:00
Giel van Schijndel 9002fb5953 * Rename frameSetCursorFromRes to frameSetCursor
* Make frameSetCursor take a CURSOR (an enum) parameter instead of SWORD


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4432 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-30 14:11:33 +00:00
Giel van Schijndel 39b6c60501 * Change and clean up the cursors API
* Get rid of resource.h which duplicated code and as such was a maintenance hell/burden


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4422 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-30 13:23:11 +00:00
Giel van Schijndel c7b40d8566 Revert r4416
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4417 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-29 18:46:37 +00:00
Giel van Schijndel ad68743327 Temporarily disable -Wmissing-declarations for lib/framework
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4416 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-29 18:33:05 +00:00
Per Inge Mathisen be566a7d6d Add -Wcast-align and -Wmissing-declarations to autoconf debug builds, and fix warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4403 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-28 23:28:44 +00:00
Giel van Schijndel db7f049617 Const correctness
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4401 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-28 22:21:37 +00:00
Dennis Schridde e28cf1ce77 Using the kludge for GNU Flex < 2.5.30 was slightly incorrect. Correct way is present in 2.5.9 already.
Additionaly use the kludge found on http://flex.sourceforge.net/manual/faq_002dmemory_002dleak.html


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4384 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-28 11:05:19 +00:00
Dennis Schridde 89d1ea6a3d Old versions of GNU Flex (i.e. 2.5.4) dont provide yylex_destroy
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4376 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 17:09:16 +00:00
Dennis Schridde 65b9f9b204 r4351: Port memleak fixes from 2.1
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4353 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 12:49:51 +00:00
Dennis Schridde c7a9f0f166 Give the bool2string function back...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4337 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-25 23:54:28 +00:00
Dennis Schridde dddbb92429 Move bool2string() conversion function from tagfile.c to frame.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4331 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-25 14:41:04 +00:00
Dennis Schridde 927c82aed0 C89 requires NULL
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4315 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 17:19:47 +00:00
Dennis Schridde 10f2ccfd56 TRUE->true, FALSE->false (except in scripts)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4311 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 16:51:17 +00:00
Dennis Schridde 9b94b011bb Better definition of a NULL pointer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4310 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 16:44:59 +00:00
Giel van Schijndel ad67fb8533 Revert the disabling of the exceptionhandler in r4304
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4305 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 15:41:34 +00:00
Giel van Schijndel dcc1536f58 Backport r4221 from the 2.1 branch to trunk:
* Fix warning regarding array bounds


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4304 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 15:40:13 +00:00
Roman C a1008c093d Reduce amount of junk in the MSVC compilation output by about 70%.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4279 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 22:15:28 +00:00
Dennis Schridde 1e26e33fc4 Make it look *exactly* how it looked before my commit... Maybe that finally fixes MSVC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4274 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 20:16:13 +00:00
Dennis Schridde 5beaf745bf Fix missing identifier LC_MESSAGES for MSVC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4269 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 19:29:41 +00:00
Dennis Schridde f8b62a6e77 Simplify i18n handling by moving all system dependend stuff into lowlevel functions.
Support changing the language via the menu on Windows.
Don't save the language name to the config file. Use the ISO639 style identifier instead.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4268 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 19:22:09 +00:00
Giel van Schijndel 535e12a5ef When failing to load a resource (WRF), generate a debug message about what file failed
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4252 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 15:55:36 +00:00
Per Inge Mathisen f698bf5fa7 Set LANG environment variable when changing languages. Attempt to fix
the i18n menu option for Windows users.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4246 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 14:18:23 +00:00
Dennis Schridde 2ba55d14a8 Record the time of compilation, too.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4233 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-23 00:05:41 +00:00
Dennis Schridde 6e89ffe22b Forgot to include physfs
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4231 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-22 19:11:29 +00:00
Per Inge Mathisen 6185741b66 patch #1018: Experimental language selection menu option.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4230 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-22 18:30:08 +00:00
Roman C 3b1c952de1 Speed up script execution when "--debug script" is not enabled.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4228 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-22 17:42:07 +00:00
Giel van Schijndel 57389641e7 Remove the last content of deliverance.h (#define MAX_STR_LENGTH 256) to wzglobal.h and remove it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4219 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-21 23:02:22 +00:00
Dennis Schridde 9ca4445189 We always only have either config.h or config-macosx.h, but not both.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4207 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-21 16:38:57 +00:00
Dennis Schridde 0c5ecc0efb Fix bug #11277: Strings containing non-ascii characters missing
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4118 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-17 07:23:48 +00:00
Christian Ohm 3dbd10b277 Add newlines to two files to shut up gcc.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4109 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 14:23:44 +00:00
Dennis Schridde 81f54bdbfd We should add those files we #include...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4108 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 12:56:45 +00:00
Dennis Schridde 2537bfc61c Cleanup #includes a bit
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4107 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 12:39:08 +00:00
Dennis Schridde a3d8cdbdb2 New include order in frame.h. This should fix msvc problems hopefully.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4096 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 03:10:05 +00:00
Dennis Schridde 9e38b3c9f0 Port r4093 and r4094 from 2.1: Cleanup frame.c headers
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4095 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 02:46:03 +00:00
Giel van Schijndel cc0c897d47 Add i18n.[ch] to the raw makefile system and the Code::Blocks projectfile
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4084 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-16 00:20:35 +00:00
Dennis Schridde fe1a470ca1 Actually add the i18n.[ch] files...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4073 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-15 17:53:10 +00:00
Dennis Schridde a5643b359c Move i18n stuff into i18n.[ch] and cleanup headers
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4068 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-15 17:36:50 +00:00
Dennis Schridde 9f5168e9dd Some generic cleanup-style things
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4066 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-15 17:05:15 +00:00
Dennis Schridde 74bb1a185b Revert r4061 (accidential commit)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4062 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-15 15:04:27 +00:00
Dennis Schridde 7e93a664b8 Move packaging -> pkg
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4061 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-15 14:57:35 +00:00
Dennis Schridde e32e928c38 Remove missing ftol() and add some docs
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4055 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-15 11:40:35 +00:00
Dennis Schridde cb2f0a30df Patch MSVC Solution file to depend on SQLite and change eol-style to native for them, since otherwise patches will not apply.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4044 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-14 18:16:04 +00:00
Dennis Schridde 303895e5fb Mark all BASE_OBJECT "derived" types as WZ_DECL_MAY_ALIAS (they may alias with any type).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4011 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-11 15:53:45 +00:00
Giel van Schijndel 33216b2e9d Move all stuff that actually belongs in CPPFLAGS (but is called CFLAGS) to AM_CPPFLAGS
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3988 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-10 10:50:58 +00:00
Dennis Schridde d8409c9819 - Don't define CFLAGS anymore, export WZ_CFLAGS instead, which can be overridden by make commandlines
- Set -DYY_NO_INPUT only in those places where needed
- Add some previously forgotten CFLAGS where needed
- Remove extranous -lintl from WIN32_LIBS
- Remove apparently unnecessary directory from Mac include (png_util doesn't need it either)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3986 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-10 02:01:46 +00:00
Dennis Schridde 9f44219b1c Move addition of CFLAGS from configure.ac to the places they are actually needed.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3983 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-09 20:08:42 +00:00
Per Inge Mathisen 916435094f Add message to MSVC users about disabled warnings. Patch #995 from Buginator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3967 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-09 10:06:05 +00:00
Dennis Schridde 3858daf4a1 Reset MSVC version from 9 to 8, since otherwise MSVC8 will refuse to load the project files. (bug #11219)
Does MS provide some kind of templating system? Like autotools generate Makefiles from Makefile.am.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3950 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-08 11:28:40 +00:00
Dennis Schridde d3455b699a Properly set include/library directories for MSVC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3949 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-08 01:45:45 +00:00
Dennis Schridde 056147b16d Oh my beauty...
Please don't clutter the detection code with platform specific fixes... That's what the /* ---- Platform specific setup ---- */ section is for...


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3948 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 21:51:53 +00:00
Per Inge Mathisen dfad738d65 Fix most MSVC warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3947 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 19:26:19 +00:00
Dennis Schridde 0c79f4b551 Simplify roundf() guards
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3946 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 18:45:56 +00:00
Per Inge Mathisen d8787a14e9 Allow for non-GNU C99 compilers
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3945 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 18:37:59 +00:00
Per Inge Mathisen 51ca960ed5 Add -Wmissing-field-initializers, fix missing field initializers, and make source
compile even if GCC is not C99 compatible.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3944 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 18:27:43 +00:00
Dennis Schridde da462b4511 More float specialisation and generic cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3937 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 12:42:42 +00:00
Dennis Schridde 8fc819377a Move generic math functions from trig.h to math-help.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3935 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-07 12:17:11 +00:00
This file is free software, distributed under the terms of the GNU 90f0c23fc9 Port r3878 and r3879 from trunk/
Update gettext.h to 0.17. This changes its license from LGPL2+ to GPL2+ !

Update gettext files to versions found in 0.17

Deleted:
m4/ulonglong.m4 - Superceeded by longlong.m4
m4/signed.m4 - Had no users
m4/isc-posix.m4 - Superceeded by autoconf-2.53
m4/inttypes.m4 - Had no users
m4/longdouble.m4 - Also unneeded

m4/intmax.m4, m4/lib-prefix.m4, m4/lib-link.m4, m4/printf-posix.m4, m4/xsize.m4, m4/lib-ld.m4, m4/lcmessage.m4, m4/wint_t.m4, m4/inttypes-pri.m4, m4/progtest.m4, m4/uintmax_t.m4, m4/stdint_h.m4, m4/intdiv0.m4, m4/iconv.m4, m4/po.m4, m4/longlong.m4, m4/size_max.m4, m4/glibc21.m4, m4/inttypes_h.m4, m4/codeset.m4, m4/wchar_t.m4, m4/nls.m4
change in license from:
 This file is free software, distributed under the terms of the GNU
 General Public License.  As a special exception to the GNU General
 Public License, this file may be distributed as part of a program
 that contains a configuration script generated by Autoconf, under
 the same distribution terms as the rest of that program.
to:
 This file is free software; the Free Software Foundation
 gives unlimited permission to copy and/or distribute it,
 with or without modifications, as long as this notice is preserved.

This removes any GPL licensed files from m4/

po/Makefile.in.in recieved my MSGMERGE_OPTIONS again after update.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3882 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-01 13:04:16 +00:00
Dennis Schridde 1c979f5fd9 Make lex/yacc rules terminals, since lexer/parser files cannot be autogenerated.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3847 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-20 12:06:26 +00:00
Giel van Schijndel 23230caf2a * Revert r3804 (replaces usage of strnlen with strnlen with the unsafe strlen)"
* Finish r3795 where I nicely #included the correct files but forgot to replace strnlen with strnlen1 - 1


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3805 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-16 17:57:43 +00:00
Ari Johnson 66f662e16a Removed usage of GNU extension strnlen()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3804 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-16 17:48:13 +00:00
Per Inge Mathisen ce473ed9fe Add some more doxygen comments.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3796 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-16 13:05:34 +00:00
Giel van Schijndel 33759c07c4 Don't use `strnlen` in debug.c as it's a GNU extension (and as such isn't always available), instead use `strnlen1 - 1`
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3795 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-16 11:53:25 +00:00
Giel van Schijndel 22844d16a6 Undo the (accidental) exceptionhandler disabling of r3784
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3785 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-15 19:44:40 +00:00
Giel van Schijndel 2322fe0920 Undo my "fix" in r3782, as it wasn't a fix but a breakage
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3784 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-15 19:43:53 +00:00
Per Inge Mathisen b92c8c5a33 Dumpt the last two log message calls into the exception handler report.
This way we get to see the message given by asserts in the dump file.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3781 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-14 22:07:53 +00:00
Per Inge Mathisen 79d13e4d14 Fix typo in exceptionhandler giving noise (at best) in exception output.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3778 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-14 20:50:39 +00:00
Per Inge Mathisen 917187ca7d Clean out some excess global defines.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3753 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-11 16:23:20 +00:00
Dennis Schridde b7e36a5b77 Require devpkg to be in ./devpkg/ for msvc.
This saves the trouble of having to edit the paths for lib/include dirs and enables us to have the FlexBison.rules there, too.
Thus FlexBison.rules is removed and to be found in the msvc devpkg from now on.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3657 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-02 18:17:58 +00:00
Giel van Schijndel 6e74be4df9 Use C linkage for frameresource.h and debug.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3629 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-01 21:26:37 +00:00
Giel van Schijndel 07359499ab Don't define our own custom implementation when compiling with g++ either
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3628 4a71c877-e1ca-e34f-864e-861f7616d084
2008-02-01 21:01:23 +00:00
Giel van Schijndel f558eb0d61 Revert unintentional part of r3612
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3613 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-30 23:39:31 +00:00
Giel van Schijndel 4f93b03142 Make function-pointer array pLoadFunction a local (but still static) array instead of global
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3612 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-30 23:38:05 +00:00
Giel van Schijndel ef3d1f5c92 Fix compiling on MSVC; patch #955 by Buginator, slightly modified by me
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3607 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-30 21:44:12 +00:00
Dennis Schridde 06a3b11a62 Revert r3588. I already did that in r3586.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3591 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-28 00:51:21 +00:00
Giel van Schijndel 7cf72b6fea #include <math.h> and "lib/framework/math-help.h" where required
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3588 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-28 00:29:19 +00:00
Dennis Schridde 9f9c417240 Include lots of forgotten math.h and roundf() is included in C99.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3586 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-28 00:22:02 +00:00
Giel van Schijndel b3a3cecaed Rename fractions.h to math-help.h and remove most junk from it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3584 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-28 00:01:37 +00:00
Giel van Schijndel 301c7f64f5 Assume G++ has a proper vsnprintf and snprintf implementation
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3566 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-27 16:34:39 +00:00
Dennis Schridde 2d29dc2191 Replace runtime code_part_names size checking by counting with a STATIC_ASSERT on its size.
Additionaly:
- Introduce ARRAY_SIZE macro
- Use code_part instead of int where applicable


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3539 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-22 16:03:58 +00:00
Dennis Schridde cbccd3336c Revert r3537, as it may not be safe on all compilers...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3538 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-22 15:47:20 +00:00
Dennis Schridde d2370600d8 Replace code_part_names() with code_part2string(), which gets us rid of having to check that the array size matches the enum on runtime.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3537 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-22 15:41:21 +00:00
Dennis Schridde 2ff72516fd idx -> index
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3534 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-21 23:08:17 +00:00
Dennis Schridde 86be7e0389 PRINT_B macro -> bool2string function
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3533 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-21 23:03:04 +00:00
Dennis Schridde 664507be0d Minor beautification of error messages.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3532 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-21 22:44:24 +00:00
Dennis Schridde 463aaf53d1 Make TF_ERROR into a readable function.
- tagGetErrorString is not provided anymore, all output goes directly to LOG_ERROR.
- The trace contains some more information.
- ASSERT()s in the unit test were removed. The output is already done by TF_ERROR where needed.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3531 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-21 22:33:41 +00:00
Dennis Schridde f3296ee96b struct define -> struct _define and define_t
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3530 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-21 22:19:15 +00:00
Dennis Schridde 17b7ffa3f9 Remove dbghelp.h. And update version (wine-0.9.53) is now included in the mingw32 devpkg.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3527 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-21 00:23:14 +00:00
Per Inge Mathisen df19674baf Save gateways and zones in tagfile format.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3513 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-20 16:52:51 +00:00
Per Inge Mathisen 579e2e428e String code cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3498 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-16 19:07:15 +00:00
Dennis Schridde b422209c9a Rename range() to wrap() and warn about unused results.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3484 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-15 18:15:13 +00:00
Dennis Schridde ff34e1fb68 Introduce new functions range() and rangef() to clip a value into a certain range.
Use that to cleanup some code.
Because of the lack of a local "math.h", it went into trig.h.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3483 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-15 18:02:54 +00:00
Dennis Schridde 31a863a90b Setup eol-style CRLF for vcproj files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3473 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-14 20:49:48 +00:00
Dennis Schridde 1c44cf8568 path #938 by Bugginator: MSVC projectfile updates. You need the static libraries from http://download.gna.org/warzone/development/devpkg/2.1/msvc80/ now.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3472 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-14 19:57:50 +00:00
Dennis Schridde d7bbab46af Set eol-style and mime-type for vcproj files
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3471 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-14 19:55:59 +00:00
Giel van Schijndel d938ed3946 * Check wether we're compiling as C99
* if not #error about requiring a C99-compliant snprintf & vsnprintf implementation

NOTE: This doesn't affect MSVC as I've already provided a C99-compliant implementation for it


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3449 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-13 13:53:00 +00:00
Giel van Schijndel 6c886470ad * Rename the MSVC snprintf and vsnprintf replacements to wz_snprintf and wz_vsnprintf respectively to prevent conflicting definitions
* #define snprintf and vsnprintf to wz_snprintf and wz_vsnprintf respectively
Thanks to Buginator for pointing out the issue in patch #937; the solution is different than his though


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3447 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-13 11:14:15 +00:00
Per Inge Mathisen 5b1ec5cfc1 Add new debug mechanic: objTrace(). It works like debug(), but also takes an object parameter.
Debugging info given with it will only be displayed for the enabled game object. Default key
to enable debugging info for a game object is CTRL+L. Converted LOG_MOVEMENT to use it.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3432 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-11 22:45:04 +00:00
Per Inge Mathisen 5657b38ef0 Hopefully fix bug that would lock fps setting to defaults.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3403 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-07 20:48:29 +00:00
Giel van Schijndel a2fe74852b * Fix some errors in the Doxygen documentation
* Parameter descriptions for non-existing parameters removed
  * Wrong parameter names renamed/fixed
  * Syntax errors in passing the a parameter to a Doxygen command at the wrong location
  * Prevent HTML interpretation of some comments

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3373 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-05 23:42:54 +00:00
Per Inge Mathisen ae19f5bd54 Move PHYSFS_APPEND and PHYSFS_PREPEND macros to lib/framework/
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3354 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-05 14:50:16 +00:00
Per Inge Mathisen eddebc7f81 Move some initialization code from src/ into lib/framework
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3353 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-05 13:50:34 +00:00
Ari Johnson 55ecef381b Fixed error message
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3350 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-05 00:22:23 +00:00
Ari Johnson e424aed624 Added /* */ around a comment to permit Warzone to compile again
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3349 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-05 00:06:40 +00:00
Giel van Schijndel d249ac2188 * By default perform truncation detection in strlcat and strlcpy (i.e. return the length that would be the resulting length if no truncation occurred)
* Add a Doxygen comment for strlcpy & strlcat

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3348 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-04 23:16:29 +00:00
Giel van Schijndel 65961cbb45 * Use a variable to store the tagfile unittest definition files' names in (rather than copy-pasting those in the tagOpenRead & tagOpenWrite calls)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3347 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-04 20:01:54 +00:00
Giel van Schijndel 34d26a6719 * Don't do "if (ptr != NULL) { ... } if (ptr == NULL) { ... }" instead use an if-else construction: "if (ptr != NULL) { ... } else { ... }"
* Use slcatprintf instead of snprintf into a local buffer (on the stack) followed by concatenating to our target string

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3345 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-04 19:11:16 +00:00
Giel van Schijndel 87a55581f0 * Move the tag definition files over to data/tagdefinitions and move the savegame definitions into data/tagdefinitions/savegame
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3343 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-04 16:10:51 +00:00
Giel van Schijndel e722d7ec39 Add some more comments
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3340 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-04 15:12:01 +00:00
Giel van Schijndel f3499cc232 Replace asserts on invalid tags with CHECK_TAG_INVALID
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3339 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-04 14:59:19 +00:00
Giel van Schijndel 1d83be8064 * s/tagWriteSeparator/tagWriteNext/g for consistency's sake (to match the tagReadNext function, which is the reading equivalent)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3334 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-04 13:37:42 +00:00
Giel van Schijndel 48f32faccf * Add function resGetNamefromData which complements resGetNamefromData and allows you to retrieve the resource ID (usually filename) for a resource (IMD, IMG, TEXPAGE, WAV, etc.)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3324 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-03 00:35:57 +00:00
Giel van Schijndel b60b1b121c * Use const-correct functions for the tagWrite.* stuff
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3322 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-03 00:30:17 +00:00
Giel van Schijndel 785eb69c8b * Add a forward declaration for tagReads32v into tagfile.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3321 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-03 00:29:10 +00:00
Per Inge Mathisen dc7a84da62 Log droid death and packet source. Beware: This will make net games incompatible
between before and after this commit.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3311 4a71c877-e1ca-e34f-864e-861f7616d084
2008-01-02 17:08:29 +00:00
Per Inge Mathisen 37260b7c2e tagfile: Allow the specification of an undefined length string in a definition file by
making the defined length zero.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3281 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-31 17:38:04 +00:00
Dennis Schridde 9d82dae196 Reduce doubleclick interval from 500 to 250.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3261 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-30 23:42:44 +00:00
Per Inge Mathisen b4ef4d4349 Add new function attribute WZ_DECL_WARN_UNUSED_RETURN and use it on IdToDroid,
whose return must be checked, and fix one bug already detected by it.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3260 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-30 21:44:14 +00:00
Dennis Schridde 5143e3e165 Add MKID macro for dummy symbols.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3232 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-29 23:21:20 +00:00
Per Inge Mathisen 877ac6456c Add lots of doxygenized comments.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3230 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-29 22:34:41 +00:00
Per Inge Mathisen 5cca5e2893 Make droid experience a floating point in tagfile format, and add better
error reporting for user errors when they forget to update definition file.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3229 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-29 19:53:14 +00:00
Per Inge Mathisen 52aa90d200 Fix a few spelling errors, and add a new debug category 'multisync'.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3227 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-29 17:55:20 +00:00
Ari Johnson 47816967a7 Updated Xcode project and some endian fixes; also changed endian_*() calls
to expand to ((void) (x)) on little-endian systems, so that the compiler
will catch little-endian developers who forget to update the endian_*()
calls when they change the names of structure fields.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3205 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-27 23:55:34 +00:00
Per Inge Mathisen 0c10287938 Add some doxygen documentation for tagfile code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3196 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-27 15:37:15 +00:00
Per Inge Mathisen f7e7e44329 Add new tagfile method tagRead8vDup which reads an unsigned byte array of unknown
length, allocates a memory buffer for it, and returns it. Not recommended for
general usage.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3193 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-27 14:57:22 +00:00
Dennis Schridde 248a8cb510 Minor indent
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3170 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-24 22:05:15 +00:00
Giel van Schijndel fbf03af195 * Remove macros:
* ROUND: replace by a static inline function (math_round) instead
  * FRACTCONST: this macro just cast both of its arguments to float and then divide the first by the second
  * MAKEFRACT_D: this macro would cast to FRACT_D (which was typedef'd as float but should have been typedef'd as double); so cast to double instead (where required)
  * FRACTmul_D: would cast both of its arguments to FRACT_D and multiply them
  * FRACTdiv_D: would cast both of its arguments to FRACT_D and divide the first by the second
  * MAKEINT & MAKEINT_D (where #defined the same); this macro would just cast to SDWORD (aka "int" or "signed int")

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3152 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-24 13:57:19 +00:00
Dennis Schridde 09a8e33f61 Rename PACKAGE_MAINTAINER to PACKAGE_DISTRIBUTOR to clarify.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3144 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-23 21:14:02 +00:00
Giel van Schijndel 798d10c6d8 * Guarantee that PATH_MAX is large enough to use as the size for Windows API calls (since with MinGW it is 159 bytes while it should be 160)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3136 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-23 16:44:36 +00:00
Giel van Schijndel 9fe5736f41 * Remove macro FRACTdiv and all places where it was used (all it did was casting both of its parameters to (float) and dividing the first by the second)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3133 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-22 23:37:30 +00:00
Giel van Schijndel ae90bd9c0c * Remove macro FRACTmul and all places where it was used (all it did was casting both of its parameters to (float) and multiply them)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3132 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-22 23:29:25 +00:00
Giel van Schijndel aeecc95088 * Remove macro MAKEFRACT and all places where it was used (all it did was casting to (float))
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3131 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-22 23:13:05 +00:00
Giel van Schijndel 5c4384623e * Use WZ_DECL_FORMAT for some functions which take printf-like strings
* This enables GCC to check the formatting strings and the types and number of the variable list of arguments passed


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3087 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-17 19:37:40 +00:00
Giel van Schijndel 456208fcc3 * Update MSVC project files (part of patch #884 by Buginator)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3051 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-14 12:12:36 +00:00
Giel van Schijndel 99c55dbf74 * Try to encapsulate knowledge about AUDIO_SAMPLE's internal representation in openal_track.c (i.e. don't use it in client code!)
* Look at sound_StopSample specifically
 * Use a function to manipulate the linked list of audio samples (i.e. get rid of duplicated code)
 * Allow printing of OpenAL vendor, version, renderer and extensions data on multiple debug "channels" to reduce code duplication
 * Add openal_error.[ch] for error detection (and producing debug messages for them!)
 * Add TOSTRING and AT_MACRO macros to macros.h
 * Get rid of some super-nested if-branches where one of them would return (so we don't actually need an else-branch because the function is left anyway)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3047 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-13 23:16:03 +00:00
Giel van Schijndel 5f1977c7f6 * Remove #undef WZ_NOMP3 and #define VERSION from config-macosx.h as they're both not needed anymore...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3041 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-12 21:19:29 +00:00
Dennis Schridde 20050d2a3e Add some more output do debug dumps: The maintainer who created the package.
PACKAGE_MAINTAINER and PACKAGE_VERSION should probably also make their way into the logfile...


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3040 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-12 18:34:30 +00:00
Giel van Schijndel c51bd8ae10 * Get rid of a large quantity of unused parameters
* Turn some signed integers ("int" or "SDWORD") into unsigned integers where it made more sence (and signed integers caused warnings about comparing signed with unsigned integers)
 * At some places cast to an unsigned integer (where the type of the expression is a signed integer but the result of it logically _always_ is an absolute value)
 * Remove unused struct-type EVENT_INIT
 * Convert use of malloc->memcpy->free to one single realloc call (and now make sure to actually check realloc's return value, which wasn't done with the malloc call)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3037 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-10 23:15:46 +00:00
Per Inge Mathisen 6118371c0e Add methods to read/write byte arrays to tagfile format.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3036 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-10 21:48:27 +00:00
Freddie Witherden 2506b69e1f Add a CLIP macro for culling a value between a min and max value.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3029 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-10 18:36:07 +00:00
Dennis Schridde c64b565f14 Patch #872 by Buginator. Untested by me since in Bugs we trust. ;)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3020 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-09 19:10:34 +00:00
Giel van Schijndel 9a0eecb753 * Revert accidental commit of exceptionhandler in r2952
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2953 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-02 00:03:52 +00:00
Giel van Schijndel 55526401be * Copy over the cross compile scripts from the 2.0 branch to trunk (with necessary modifications)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2952 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-02 00:02:45 +00:00
Giel van Schijndel ae79833367 * In vasprintf when we have to produce a zero-length string:
* Assign the resulting pointer to the char** strp pointer
  * Return zero (instead of the pointer)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2948 4a71c877-e1ca-e34f-864e-861f7616d084
2007-12-01 23:44:29 +00:00
Freddie Witherden b73b28f191 Revert dodgy removal of trig functions. More testing required
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2904 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-29 23:10:54 +00:00
Freddie Witherden dbcb55414d Remove the pre-computed trig tables system
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2903 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-29 22:50:25 +00:00
Per Inge Mathisen 0d7d6dee26 Extend tagfile saves to cover droid movement information. Improve tagfile error reporting somewhat.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2868 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-24 22:23:40 +00:00
Per Inge Mathisen bacb7975b1 Add new tagfile method to read and write 32bit signed arrays. Fix error that
would interpret floating point arrays as 16bit.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2867 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-24 21:05:19 +00:00
Dennis Schridde 9cc0a628c1 Do parts of the proposed changes in "[Warzone-dev] build issues in FreeBSD system" by Yaroslav Kolomiyets from 24.10.2006:
- SDL header includes don't use SDL/ anymore (raw Makefiles and MSVC Project adapted).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2863 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-24 11:49:51 +00:00
Per Inge Mathisen 8ad6ff9dc1 Remove double click for keyboard and mouse wheel. Patch by buginator in patch #851.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2854 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-22 18:51:54 +00:00
Giel van Schijndel 6083c030bf * revert (unnecessary r2843)
* make sure to #define _GNU_SOURCE when compiling on Unix systems with Code::Blocks


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2845 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-20 21:36:36 +00:00
Giel van Schijndel 027b9218a9 * Fix a potential compile error when using asprintf on non-Windows systems
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2843 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-20 21:18:33 +00:00
Per Inge Mathisen 647ae8810c Improve comments and documentation of tagfile code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2835 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-19 19:16:21 +00:00
Giel van Schijndel 1f2d5cbddf * Add a new debugging level LOG_SAVEGAME or "savegame"
* Add a large quantity of debug() calls to game.c
 * Correct some spelling errors in comments

Part of patch #853 by Buginator


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2826 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-15 18:32:07 +00:00
Giel van Schijndel 73307a762e * Lets use valid syntax shall we... (introduced in r2817)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2818 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-13 19:23:04 +00:00
Giel van Schijndel 714d117c71 * Add a concatenating variant of snprintf and vsnprintf, slcatprintf and vslcatprintf respectively
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2817 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-13 19:14:27 +00:00
Per Inge Mathisen 66cee9b2d5 Add more sanity checking and error description to tagfile format at the
cost of even less sanity for whichever poor soul who reads this code.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2816 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-13 18:47:48 +00:00
Giel van Schijndel b285cdea7d * Use vsnprintf instead of snprintf!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2809 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-12 19:03:30 +00:00
Giel van Schijndel 1bd1483944 * Use snprintf (in vasprintf) to determine the size of the string we're about to construct
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2807 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-11 22:09:20 +00:00
Giel van Schijndel be25c4901b * Modify sasprintf to take this signature instead: "void sasprintf(char**, const char* fmt, ...)" (take in mind though that it is a macro!)
* Add some comments to sasprintf
 * Utilize sasprintf and asprintf in src/version.c to drastically cut back in code size and duplication


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2806 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-11 22:01:05 +00:00
Freddie Witherden 1b9b69048c Add a stack allocating version of sprintf
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2805 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-11 21:29:56 +00:00
Giel van Schijndel 6486b5270b * Add implementations of vasprintf and asprintf for Windows (GNU extensions to the C library that malloc the memory they need)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2804 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-11 21:12:13 +00:00
Giel van Schijndel 7711572f0a * Add a new module (printf_ext.c) to contain some printf extensions (C99 printf variants for MSVC)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2803 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-11 20:58:10 +00:00
Giel van Schijndel a08e6f07f8 * Provide alloca() on GCC, MinGW and MSVC (and all other WZ_OS_UNIX compilers that provide <alloca.h>
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2801 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-11 20:04:50 +00:00
Dennis Schridde 1dd2b54431 wzglobal.h never belonged to Eidos. Instead large parts of the code are copied from Qt and thus belong to Trolltech.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2776 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-10 13:25:02 +00:00
Dennis Schridde 5ccaa17971 Correct WZ_CC_TINYC check. (Note the namechange!)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2775 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-10 12:10:54 +00:00
Dennis Schridde 3a56a479b3 - Extend compiler detection with TinyCC
- Add window system detection
- Remove MSDOS from supported OSes


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2771 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-10 00:31:43 +00:00
Giel van Schijndel 96d5054729 * Make sure to #include <stdio.h> when compiling on MSVC so that those inline replacements for snprintf and vsnprintf will actually compile....
* Lets terminate statements with a semi-colon!!


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2745 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-06 18:36:37 +00:00
Giel van Schijndel 7b2530306c * On MSVC make sure to #define inline __before__ using it!!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2744 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-06 18:30:19 +00:00
Giel van Schijndel 92e013e406 * Add static inline functions vsnprintf and snprintf when compiling with MSVC
* These functions comply to the C99 specification and return the amount of characters they would have written if no truncation occurred
Slightly modified form of patch file #3146 attached to bug #10269 by Buginator; applied the changes of this patch to wzglobal.h instead of version.c


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2742 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-06 14:07:50 +00:00
Dennis Schridde 94136efe24 Revert to the non-global static_assert, since MSVC is not ready for the global one, yet.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2697 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-03 21:42:55 +00:00
Per Inge Mathisen ccd725073e Add extra sanity checking to tagfile code to make it fail earlier rather than later.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2673 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-30 18:51:44 +00:00
Per Inge Mathisen 5567ae6e4b Add debug log call for tagfile errors.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2672 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-30 16:58:35 +00:00
Giel van Schijndel dcbef6f398 * Don't use variable array, structure members in RES_DATA
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2658 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 17:53:37 +00:00
Giel van Schijndel 0374c67a12 * Add a doxygen comment to source:trunk/lib/framework/strlfuncs.h describing macro STR_L_FUNC_TRUNCATION_DETECT
* Replace (the last) strncpy() call in nettyps.c with a strlcpy() call


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2647 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 20:20:35 +00:00
Per Inge Mathisen 9609cb0005 Use full path to frame.h. Patch in bug #10208 by unknown.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2642 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 17:30:49 +00:00
Giel van Schijndel f5602b4778 * Replace a large amount of strncpy() calls with the safer strlcpy()
* Fix an error in src/game.c where we would use the wrong size as parameter to strlcpy()


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2640 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 16:18:52 +00:00
Giel van Schijndel 613a38364e * Make resSetBaseDir const correct (char* -> const char*)
* Document the "fileName" parameter of makeLocaleFile in the Doxygen comment


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2639 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 16:12:00 +00:00
Per Inge Mathisen 1811aa0cdb Use secure version of snprintf on Windows (_snprintf_s).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2638 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 15:50:45 +00:00
Giel van Schijndel bd37e62cb2 * Replace a lot of strncat(dst, src, sizeof(dst) - strlen(dst) - 1) calls with the less bloated strlcat(dst, src, sizeof(dst)) form
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2637 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 15:47:17 +00:00
Giel van Schijndel 6b4cba1700 * Rename pLevelName to aLevelName (hungarian notation is a pain. Especially when it's wrong!)
* Get rid of several magic numbers
 * Some const correctness
 * Replace a huge amount of strcpy(), strcat(), strncpy() and strncat() calls with a strlcpy() and strlcat() calls respectively


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2635 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 14:35:35 +00:00
Giel van Schijndel 673812b2a4 * Add file strlfuncs.h; this file contains an inline implementation of strlcpy and strlcat (safer variants of strncpy and strncat respectively)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2627 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-26 17:05:29 +00:00
Dennis Schridde 20bc25c107 Windows MiniDumper: resultMessage is always null-terminated and MessageBox is always shown. => Move out of ifs.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2626 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-25 23:32:20 +00:00
Dennis Schridde a923b6a000 Dump used compiler and version, too.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2625 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-25 23:23:21 +00:00
Giel van Schijndel e06c186bd6 * Replace a _lot_ of strcpy(), strcat() and sprintf() calls with the safer strncpy(), strncat() and snprintf() respectively
* Refactor NETlogEntry() to use the array of strings (packetname[]) instead of a large switch-statement with a lot of copy & pasted code


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2617 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-24 21:11:29 +00:00
Giel van Schijndel 3446fb2b87 * Remove __FILE__ prefix in debug() call as debug() apparently adds __FILE__ already (noted by Per)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2616 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-24 19:40:39 +00:00
Giel van Schijndel 329c6637d8 * Check malloc's return value
* Don't perform assertions on the content of uninitialized memory, it's useless and annoying when they fail


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2615 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-24 17:20:29 +00:00
Giel van Schijndel e6827605e2 * Fix a rather large memory leak as reported in bug #10190
* In this bug-report calling free() twice (once on psRes->aID then on psRes) was proposed
   * Instead just ''over allocate'' the memory for psRes so that a single free() call on psRes will suffice

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2614 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-24 16:54:53 +00:00
Per Inge Mathisen 6cf0e01f0b Add write and read methods for bools to tagfile framework. Remove enum write macro.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2599 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-23 20:21:18 +00:00
Per Inge Mathisen 9ec705bd9c Add new debug tag LOG_MAP
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2597 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-23 18:18:48 +00:00
Dennis Schridde d5601ebc91 Found a version of the STATIC_ASSERT which also works in global scope.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2592 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-22 20:53:27 +00:00
Per Inge Mathisen ffc1f75aac Silence asserts going off on working separator tags in tagfile code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2589 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-22 20:09:55 +00:00
Per Inge Mathisen 3bd357ed08 Fix some mistakes and remove debug printfs from tagfile code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2587 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-22 19:33:47 +00:00
Per Inge Mathisen c9b25c5738 Add the tagfile framework that we will use for our new savegame format, and related
unit tests. First sketch of new defined savegame format in tagfile_map.def.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2586 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-22 18:40:34 +00:00
Dennis Schridde eff43d1fa1 Spelling mistake
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2556 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-16 21:07:10 +00:00
Dennis Schridde 8151788f14 Giel wants this to be commented...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2555 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-16 20:57:55 +00:00
Dennis Schridde ceb1a432bc Proper fix for ICC warning "argument is incompatible with corresponding format string conversion".
The fix which silenced the warning in r2550 was wrong.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2553 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-16 20:51:34 +00:00
Dennis Schridde c7b00fadaf More work on the ICC front:
- Less strict warnings in debug-mode (still unusable, because ICC warns about _a lot_)
- Explicit conversions
- Clarify parameter evaluation order


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2550 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-15 18:09:18 +00:00
Dennis Schridde 87d55b978b Basic buildfile support for ICC and silence one warning.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2524 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-02 21:43:43 +00:00
Giel van Schijndel 470ea85417 * Remove lib/framework/utf8.c[ch] as we don't need it just right now (we can always revert this commit later on if necessary)
* This commit removes utf8.[ch] from all build systems (manual text-editing for the most of them)
 * For the removal from the XCode project I just reverted r2288

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2477 4a71c877-e1ca-e34f-864e-861f7616d084
2007-09-25 19:46:10 +00:00
Dennis Schridde 6627ecbc6a Fix "incompatible declarations" found by batched compiling.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2460 4a71c877-e1ca-e34f-864e-861f7616d084
2007-09-16 14:05:01 +00:00
Giel van Schijndel 9db9ca51ea * Add Doxygen comments to lib/framework/strnlen1.h
* Fix some errors in lib/framework/utf8.h comments


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2459 4a71c877-e1ca-e34f-864e-861f7616d084
2007-09-15 23:37:32 +00:00
Dennis Schridde 274abd14ca Fix WZ_DECL_FORMAT for non >=gcc-2.5
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2430 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-22 18:04:07 +00:00
Dennis Schridde 63a38d0da9 Include unistd.h for MinGW as well.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2428 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 14:52:50 +00:00
Dennis Schridde 20fe87c0f4 AM: Add lexers to BUILT_SOURCES and CLEAN_FILES as well.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2427 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 13:16:09 +00:00
Dennis Schridde e232e9a6b5 Yacc warning fixes by Pseudonym404 (http://forums.wz2100.net/index.php?topic=148.msg7837#msg7837):
- adding *.tab.c to BUILD_SOURCES and CLEANFILES before *.tab.h in applicable Makefile.am files causes *.tab.c to be the file that triggers the %.tab.h %.tab.c: %.y rule, resulting in the command run being "bison -y  -d -o[...].tab.c [...].y", not "bison -y  -d -o[...].tab.h [...].y", which (aside from being correct syntax Wink ) stops "warning: conflicting outputs to file `[...].tab.h'"
- chat_parser.y had %token _T_A declared twice, second instance removed
- audp_parser.y had trailing | signs (presumably from when NULL wasn't commented out)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2426 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 13:03:09 +00:00
Dennis Schridde fbd3a9c394 Use Unix PATH_MAX as default and thus move all "fixes" to Windows.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2425 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 12:59:05 +00:00
Dennis Schridde 08a43494fd - Clean up macros a bit more
- Use WZ_CC_GNU_PREREQ (copied from glibc's features.h) instead of custom code
- Move platform.h into wzglobal.h


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2424 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 12:30:00 +00:00
Dennis Schridde 3d6d40f5dd - Update WZ_OS_/WZ_CC_ definitions from Qt 4.3.1 and don't strip OS detection them anymore.
- Fix attribute prerequisites.
- Remove wz__attribute and add WZ_DECL_FORMAT.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2423 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 11:21:20 +00:00
Dennis Schridde 51a467d649 Remove CHAR_BIT check which is not needed anymore.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2422 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-21 10:43:16 +00:00
Giel van Schijndel b5e548e800 * Use a union instead of first casting to void* before casting to uint32_t* from float* (prevents type punning of pointers)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2412 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-17 22:17:16 +00:00
Giel van Schijndel 551aa55cb9 * Use SDL_EnableKeyRepeat to enable the repeation of key press events (this enables you to press your 'A' key once and get multiple 'A's if your in a textbox)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2380 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-16 09:30:50 +00:00
Giel van Schijndel 29c1229322 * Prevent a warning about "dereferencing type-punned pointer will break strict-aliasing rules" by casting a &float through a void* before casting it to uint32_t*
* Add an explanation about floats (that they're basically the same as 32bit integers as far as endianness conversions are concerned)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2379 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-16 09:09:30 +00:00
Giel van Schijndel 1ee0356036 * Adapt the writeFXData and readFXData functions to use the PHYSFS big endian swapping write and read functions
* Don't write directly from the memory of the EFFECTs (since this memory doesn't always have the same size on 32vs64bit systems)
 * Guarantee to always write the IMD's hash number as if it's a uint32_t (this fixes 64bit compatibility of these functions)
 * Add functions openLoadFile and openSaveFile which perform the file opening for loadFile2 and saveFile and now readFXData and writeFXData as well

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2378 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-15 21:26:05 +00:00
Dennis Schridde 0cf8a9af36 Update dbghelp.h to Wine 0.9.43.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2370 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-12 01:03:38 +00:00
Giel van Schijndel 74e64738fa * Add network primitives by Freddie Witherden <EvilGuru>
* Modify them slighly to use get/set functions for the package direction (instead of a global accessable to all files which forward declare it)
 * Add a NETfloat to the set of primitives
 * Modify NETstring to use strnlen1 instead of strnlen which is a GNU extension to the C library (strnlen1 has been copied from gettext 0.16.1 which is GPLv2+)
NB: rerun your buildsystems
NB2: Xcode requires an update

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2358 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-08 18:50:28 +00:00
Giel van Schijndel 76057072e0 * remove function stringLen and replace all instances where it was used with strlen (can't see why anyone would want a custom string length function there in the first place)
* make strresStoreString const correct ("char*" -> "const char*")

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2345 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-05 12:06:56 +00:00
Per Inge Mathisen 0266477bd9 Add new debug category: gui
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2338 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-03 16:24:17 +00:00
Per Inge Mathisen 8879d5151e Fix bug #9644, slow response from building queues. Patch by Watermelon:
Makes doubleclick state a condition for mousePressed, so that widget 
can recognize the 'down' state in a double click state correctly.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2325 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-02 22:41:18 +00:00
Per Inge Mathisen 3834067f15 Cleanup of visibility code. Added new debug category: "sensor".
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2320 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-02 20:23:09 +00:00
Per Inge Mathisen 4b45e8e2e1 Some misc cleanup
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2306 4a71c877-e1ca-e34f-864e-861f7616d084
2007-08-01 15:04:16 +00:00
Giel van Schijndel 0832e1f5eb * Fix warning about suggested parentheses
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2297 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-31 14:20:28 +00:00
Giel van Schijndel e9d8948939 * Just use uint32_t to store UTF-32 (or UCS-4) characters in rather than uint_fast32_t which probably falls into the category premature optimization
* Fix macro ASSERT_START_OCTET (I used a logical and there instead of logical or)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2296 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-31 14:17:35 +00:00
Giel van Schijndel 17ac519765 * Assert that the starting octect of a UTF-8 codepoint sequence is correct
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2293 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-31 12:07:12 +00:00
Giel van Schijndel ed18068ec8 * Forgot to return the determined length value of unicode_strlen: doh!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2286 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 16:28:38 +00:00
Giel van Schijndel 7c73b0a9e1 * Add function "size_t unicode_strlen(const utf_32_char* unicode_string)" which determines the amount of characters in a UTF-32 encoded string
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2285 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 16:27:39 +00:00
Giel van Schijndel f78bb18a5b * Use a typedef utf_32_char in the UTF-8 code to store UTF-32 characters in
* This way it should be easy to change the type of utf_32_char if ever needed (currently it is uint_fast32_t)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2284 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 15:34:44 +00:00
Giel van Schijndel 100309f547 * Provide implementation of function "uint_fast32_t* utf8_decode(const char* utf8_string)" which decodes a UTF-8 encoded string into a UTF-32 (native endianess) encoded Unicode string (UTF-32 is the "native" unicode encoding)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2283 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 15:15:02 +00:00
Giel van Schijndel 8bbe10a748 * Provide implementation of function "size_t utf8_character_count(const char* utf8_string)" which counts the amount of characters (not bytes/octects!) in a UTF-8 encoded string
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2282 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 14:46:15 +00:00
Giel van Schijndel 38a82a2ada * Add UTF-8 encoder (the decoder is a WIP)
* Add files lib/framework/utf8.[ch] to autoconf/automake, raw makefiles, Code::Blocks and MSVC
NOTE: this may require updating of some additionaly buildsystems (e.g. OSX)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2281 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-30 14:02:05 +00:00
Dennis Schridde 2fbaec50c4 Fix unused function getLanguage.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2275 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-29 23:33:21 +00:00
Dennis Schridde 8939a96d21 Better debuging of not found data.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2270 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-29 17:17:38 +00:00
Dennis Schridde f612678624 Backport r2265,2266,2268 from branches/2.0
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2269 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-29 16:58:16 +00:00
Dennis Schridde 2c7fcf0cc8 inputdoubleclick.patch by Watermelon. (I merged his comments from the email into the patch.)
This patch fixes the following tempting features: ;)
1. Doubleclick to select all droids of the same template.
2. Doubleclick construct droid to open up build menu.
3. Double pressing numeric keys '1,2,3,4,5,6,7,8,9' to center view/align camera to the group 1-9 you assigned.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2242 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-28 11:54:20 +00:00
Dennis Schridde ebb1d7a918 Translate3.patch by Martin Koller. Had to Wiggle names.txt, but it seems to have cleanly applied.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2241 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-28 11:35:26 +00:00
Dennis Schridde 6b8e636fc3 Revisit data loading (image/texture related) and remove unecessary fVertex pietype.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2195 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-25 22:37:48 +00:00
Dennis Schridde 84f1d476e4 strings.txt removal by Martin Koller.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2124 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-16 17:44:42 +00:00
Dennis Schridde d9529e9d1c Localised data, patch by Martin Koller, slightly modified by me.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2123 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-16 17:19:47 +00:00
Per Inge Mathisen d1b82698ce Fix bug introduced in r2086 which would give droids trouble avoiding obstacles.
Thanks to Troman for pointing out the problem.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2094 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 13:48:11 +00:00
Dennis Schridde c08c2ba7eb Fix MSVC to have C99 isfinite().
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2092 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-14 12:49:20 +00:00
Per Inge Mathisen 99cf7adee0 Overwrite, instead of append, debug logfiles.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2071 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-13 18:31:37 +00:00
Dennis Schridde e80e0d4ca6 FILE_MAXCHAR -> MAX_PATH
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2058 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-12 17:17:16 +00:00
Per Inge Mathisen cbada4698b Remove two excessive logging calls
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2017 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-03 20:39:34 +00:00
Per Inge Mathisen 64c9ca9ecd Optimize non-enabled calls to debug() by moving the if test before we do a function call.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1994 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-01 11:54:09 +00:00
Dennis Schridde 714bcc5924 displayBuffer -> fileLoadBuffer, original patch by vs2k5. displayBuffer was abused to load nearly everything.
Reuse FILE_LOAD_BUFFER_SIZE macro, which was abandoned before. (That's also why fileLoadBuffer is now defined in src/init.c, even though the place is probably inappropriate.)
Make fileLoadBuffer static instead of malloced.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1992 4a71c877-e1ca-e34f-864e-861f7616d084
2007-07-01 00:28:49 +00:00
Dennis Schridde 28358cb9e3 Backport r1973: Verbose problem report for not found gdb or program.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1974 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-25 18:17:43 +00:00
Dennis Schridde d301fd3a82 Enhance POSIX crashdump with time of execution (not crash!)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1971 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-25 18:04:39 +00:00
Dennis Schridde 0c46dfdea3 - Get full path to warzone binary, so gdb can actually find it. (It runs in an empty env, so it doesn't even have PATH.)
- Add some debug output (which will never get shown, since we setup the crashhandler before the debughandler).


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1968 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-25 17:35:09 +00:00
Dennis Schridde 428c893226 Revert to the old implementation of STATIC_ASSERT. Beware: This does not work in global context (outside of a function).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1965 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-25 12:34:39 +00:00
Dennis Schridde e5ff965bbc Remove unused "altVal"(disp3d) and macros(fract), make macro safer(map)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1902 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-19 23:32:17 +00:00
Dennis Schridde e40c830278 Remove more unused code. This includes iV_GetMouseFrame, which returned an undefined value before. scriptextern.c might want to be adapted.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1865 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 21:56:36 +00:00
Giel van Schijndel 05156439fd * Task #5192: Audit some files for failure to set global pointers to NULL after having called free(global pointer)
* Mark some global pointers/vars for static linkage (the less global, and more local they are, the better!)
 * Add include guards to some files
 * Some code cleanup: braces on their own line
 * loadFile2 now doesn't free memory it didn't allocate itself anymore
 * Use decent assertion expressions for some asserts (e.g. !"string", so that debuggers actually display something more interesting than 'FALSE')
 * Don't assert(pointed_to_data != 0xdddddddd) since that method of detecting usage of dangling pointers only works with MSVC, while MSVC's free() probably (i.e. if it is sane) implementation does this check itself already

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1855 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-14 19:21:52 +00:00
Giel van Schijndel cc5de7ec37 * Refactor HashString and HashStringIgnoreCase to be a (very tiny) bit more readable
* Create a dedicated function for conversion of ASCII characters into upper case: upcaseASCII
 * Make HashStringIgnoreCase use upcaseASCII instead of an ugly bitmask hack which won't even work as expected on all strings!!

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1830 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-06 13:22:21 +00:00
Giel van Schijndel 12f21d0b0c * Replace usage of uint8_t with char for C-strings; while (u)int8_t works perfectly nice for numbers it isn't nice for text (char-array)
* To make sure we still have the guarantee that a char is 8bit I've inserted a static assertion for this (CHAR_BIT == 8)
 * Use exact length types for lobbyserver

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1821 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 12:01:59 +00:00
Giel van Schijndel ed73e62898 Leave the memory management up to the memory management functions!
That is:
 * Don't use a custom memory heap implementation anymore
 * Remove all usages of HEAP code and replace it with malloc/free

NOTE: MacOSX projectfile probably requires an update

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1820 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-05 11:46:00 +00:00
Giel van Schijndel d65f88beb5 * Replace a lot of heap usage with malloc/free usage
* Use decent assertion expressions for some asserts (e.g. !"string", so that debuggers actually display something more interesting than 'FALSE')

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1815 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-04 20:46:30 +00:00
Dennis Schridde 6fa36aa0e9 + const, - unused
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1795 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-03 13:46:50 +00:00
Dennis Schridde 68e56823e1 - Constification
- POINT -> Vector2i
- changed internalformat = getPixelFormat() to GL_RGBA in one place
- removed unused variables/functions
- proper intialisation


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1792 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-02 23:01:29 +00:00
Giel van Schijndel 1faab1bc89 * Fix compiling with MSVC (variable declarations at the start of the function)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1774 4a71c877-e1ca-e34f-864e-861f7616d084
2007-05-30 07:17:43 +00:00