Commit Graph

979 Commits (1b0ae0932005a955fc00225ac8f5cf49980bd01f)

Author SHA1 Message Date
Giel van Schijndel 60c55e4009 #undefine NOMINMAX before #defining it
Prevents warnings about #redefining previously #defined macros

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9869 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-19 18:00:09 +01:00
dak180 a3f8200327 Step 1 of X in getting translations working on the mac.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9835 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-16 23:50:09 +01:00
Giel van Schijndel 946c9965f2 Replace ''all'' usage of BOOL in lib/framework with bool instead
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9812 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-15 20:51:08 +01:00
Giel van Schijndel b3ea108cce Replace some BOOL usage with bool
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9811 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-15 20:51:07 +01:00
Giel van Schijndel 40208015e4 string_ext.h doesn't actually use frame.h, so don't #include it
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9774 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-11 20:14:35 +01:00
Cyp 4651724689 Move #includes out of extern "C" blocks, make STATIC_ASSERT work in C++.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9737 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:28:16 +01:00
i-nod cec20aae6a - NSIS changes from 2.3 (#1111).
- Additional fixes to [9642]: remove old-1.10-balance.wz instead of origianl.wz.
- MinGW build system updates.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9727 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:28:16 +01:00
Cyp 238d42c0f8 logical: Use separate pseudorandom number generator for game decisions, which should at some point be made to be synchronised between clients.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9670 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:28:09 +01:00
Buginator 7266552505 Fix for 64bit compilers.
Reported by atis_home  (thanks!)

closes ticket:1523

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9594 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:58 +01:00
Buginator 3a5f7d556b Use #define NOMINMAX to disable the min / max macros in windows.h
instead of r9562
The other option was to use (std::max) as in, you have ( ) around min/max



git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9589 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:57 +01:00
Cyp 8f034fe834 Workaround for Microsoft bugs such as #defining random words such as min and max.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9562 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:55 +01:00
Per Inge Mathisen 8f51743062 Keep bitfields of vision knowledge for faster comparisons. This speeds up map vision updates by almost 15%. (Reviewed by Cyp_.)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9559 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:54 +01:00
Christian Ohm 36acdc554b Add Croatian translation by 13KukYNexus666.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9474 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:43 +01:00
Guangcong Luo 3579209ab4 Fix bug #1466 - release builds shouldn't assert - fixes a ton of "crashes" in Mac OS X and Linux.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9451 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:39 +01:00
Christian Ohm 3ab1a0104d Update Spanish locale names.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9370 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:25 +01:00
Cyp 6ddb1eadb2 cpp: Add extern "C" {} in headers.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9336 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:21 +01:00
Christian Ohm 2b2a187172 Update Windows language table according to MSDN.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9326 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:20 +01:00
Guangcong Luo 3ac9f53bf8 Add support for Cmd/Meta keyboard shortcuts. Make keyboard shortcuts look nicer: "lctrl - f11" to "Ctrl + F11" (Warzone keyboard shortcuts accept both LCtrl and RCtrl)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9306 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:27:15 +01:00
Per Inge Mathisen 9c6b55f2d6 Remove unused definitions.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9187 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:26:59 +01:00
Per Inge Mathisen 93f1d85e2d Add new debug log category for saving whatever was sent to console.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9102 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:29 +01:00
Guangcong Luo 357de2a6cb Apply patch #1330 provided by Cyp - Add unicode support to text boxes and game-chat
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9101 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:29 +01:00
Christian Ohm cd577664ca Add Ukrainian translation.
Closes #947.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9039 4a71c877-e1ca-e34f-864e-861f7616d084
2010-02-09 20:04:22 +01:00
Buginator 1fc98725c8 frontport r7797
"In inputLooseFocus(), we clear the keyboard/mouse to the init state (KEY_UP).

fixes ticket:515 "

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8750 4a71c877-e1ca-e34f-864e-861f7616d084
2010-01-30 20:26:48 +01:00
Buginator 38528c7524 fix typo (r8709)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8738 4a71c877-e1ca-e34f-864e-861f7616d084
2010-01-30 20:26:46 +01:00
Guangcong Luo ad7e87792d Use 32x32 cursors if unknown cursor type given.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8723 4a71c877-e1ca-e34f-864e-861f7616d084
2010-01-30 20:26:44 +01:00
Christian Ohm 55f12a5d52 Hurd build fixes.
Closes #969.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8706 4a71c877-e1ca-e34f-864e-861f7616d084
2010-01-30 20:26:44 +01:00
Per Inge Mathisen e73697495e Forward port r8652 and r8626 (savegame fixing and breaking) from 2.3
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8696 4a71c877-e1ca-e34f-864e-861f7616d084
2010-01-30 20:26:42 +01:00
Giel van Schijndel fbec26f8e1 Improve compile time code checking:
* Use a version of STATIC_ASSERT that can be used as part of expressions
  - Taken from the Linux kernel (<linux/kernel.h>)
 * Add macro WZ_ASSERT_ARRAY which (statically) asserts that the given variable is an array
  - the given array needs to have a compile-time defined size
  - pointers will fail this assertion
 * Verify that the expression given to ARRAY_SIZE is truly an array
  - verify this using WZ_ASSERT_ARRAY_EXPR
 * Catch & fix two coding errors resulting from wrong use of some macros
  - macros: sstrcpy and ARRAY_SIZE

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8654 4a71c877-e1ca-e34f-864e-861f7616d084
2010-01-30 17:12:54 +01:00
Guangcong Luo d91693afb2 Hardware-accelerated cursors work correctly in Mac OS X now.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8610 4a71c877-e1ca-e34f-864e-861f7616d084
2010-01-30 17:12:49 +01:00
Buginator 49f164b23f Fix a out-of-order list
(r8516)

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8530 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-28 19:34:15 +01:00
Buginator 0d2a13a119 Fix a strange issue on some laptops, that have mapped their numpad enter key to the normal "return/enter" key.
Either key can now be used to submit the text your typing.

This fixes ticket:1055
NOTE: We *still need* unicode support!
(Multibyte support, and we should NOT use char, we need to switch to wchar_t)

(r8425)

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8527 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-28 19:34:14 +01:00
Buginator d6e70a3c00 Filter out non-ASCII in our debug line
(r8380)

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8519 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-28 19:34:13 +01:00
Buginator d6261ced17 Add new debug flag "input" to be used for input (keyboard/ mouse) issues.
Add allot more debugging for the input routine(s) to help find keymap issues.
*Change* Add a user friendly (numpad) clarification to the keymap editor, and also color it yellow.
*Change* Rename "Multiplayer Options" to "Multiplayer Options / Alliance dialog" to clarify what this is used for.

(r8376)

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8518 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-28 19:34:13 +01:00
Buginator 11482e4a96 Fix a typo
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8352 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-22 16:19:54 +01:00
Buginator 0aff0b46cf Add a new debug flag type, LOG_FATAL.
This is used to differentiate LOG_ERROR (which is a *non* fatal error, but a error none the less) and fatal errors which result in program termination with no *visible* output (on windows/macs) on our end because of the crappy GUI functions so we usually dump it to stderr.txt and there is no clue that the program had to exit for whatever reason.

Hopefully, this will be helpful to windows people so they can differentiate between *our* exit/abort routines, and crashes that occur in drivers which look exactly the same since they get dumped back to the desktop with no visible clue why.

LOG_FATAL is *always* on in both debug & release builds.

On LOG_FATAL debug lines, on windows, we now throw up a modal dialog box with the current error message.  At this time, this only happens when we have a error, and we use abort() right after the error, which makes it fatal.

That explains why this touches ~60 files :)


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8320 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-22 16:19:51 +01:00
Buginator a86cbc2e3c As was discussed on the ML, removing SQL from trunk.
Please test!!
OS X & mingw builds may be broken!


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8312 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-22 16:19:50 +01:00
Christian Ohm df7f2223d6 Compare locale names before claiming they differ
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8302 4a71c877-e1ca-e34f-864e-861f7616d084
2009-11-22 16:19:48 +01:00
Buginator 6df5783314 Bad editor, bad! (it inserted wrong codes)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8215 4a71c877-e1ca-e34f-864e-861f7616d084
2009-10-06 22:10:00 +02:00
Buginator 9c23caf1b8 SUBLANG_ESTONIAN should have been SUBLANG_DEFAULT.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8214 4a71c877-e1ca-e34f-864e-861f7616d084
2009-10-06 22:10:00 +02:00
Christian Ohm 9edf766645 Estonian uses et_EE for locale, not ee.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8152 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-28 22:21:08 +02:00
Christian Ohm 6010fd1da8 Add Estonian translation by Erlando.
From http://forums.wz2100.net/viewtopic.php?f=6&t=3772

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8150 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-28 22:21:07 +02:00
Christian Ohm 429fb34bfb Check for alloca.h in configure instead of hardcoding it.
Patch from #817.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8132 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-28 22:21:07 +02:00
Buginator 5eff6347d8 Fix cross-compiled builds again, by removing (commenting out) a invalid language option for cross compiled builds, LANG_LATIN.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8029 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-27 19:07:12 +02:00
Christian Ohm 142f9bda38 Disable locales without translation.
Now only those languages in the "map" structs are used, and a new translation
has to be added to those structs to be available. Also remove the ASSERT when a
language is not in the struct and just return the language code instead.
Fixes #813.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7970 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-27 19:07:04 +02:00
Christian Ohm eb7f679ce3 Fix getLanguage to return the full "xx_YY" name, but still cut "xx_XX" to "xx".
Previously it would also cut "xx_YY" to "xx", so sublanguage selection didn't
work. Also fix the spelling of "Portuguese". Fixes #812.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7961 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-27 19:07:02 +02:00
Per Inge Mathisen b549837969 Remove unused include
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7914 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-27 19:06:55 +02:00
Christian Ohm 732a030544 Undef _XOPEN_SOURCE before including config.h in wzglobal.h.
Override the system headers, since autoconf defines this when needed.
Fixes #544.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7874 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-27 19:06:36 +02:00
Christian Ohm 383d8612be Add missing languages for getLanguageName, and if a language is missing, show
it in the assert. Fixes #673.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7869 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-27 19:06:34 +02:00
Per Inge Mathisen edcc7f79a8 Fix erronous description of ASSERT_OR_RETURN.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7821 4a71c877-e1ca-e34f-864e-861f7616d084
2009-09-27 19:06:27 +02:00
Buginator 69dfc7fc36 Change some LOG_ERROR(s) to info (LOG_INFO), since they are not really errors. As you may recall, info() displays in both debug & release builds.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7744 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-16 22:28:35 +02:00
Buginator 11ab9125ad Add new macro, info(), it is shorthand for debug(LOG_INFO,...). This is used to *always* display informational messages on both debug & release builds.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7734 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-16 22:28:34 +02:00
Per Inge Mathisen d93e1751c0 Add new utility function PHYSFS_printf() to easily write text files with PhysicsFS.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7704 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-09 23:44:28 +02:00
Per Inge Mathisen 8c16a47ef0 Fix broken sources after 'make clean' in tarball generated by 'make dist'. Reported by 'JimPansen' in the forums.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7671 4a71c877-e1ca-e34f-864e-861f7616d084
2009-06-09 23:44:11 +02:00
Giel van Schijndel 7bb1474692 FreeBSD #defines alloca() in <stdlib.h>, not <alloc.h> (that's a Linux/glibc thing), so make the #included file platform dependent
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7538 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-28 09:59:29 +02:00
Buginator 8a87d1985e Fix strlcpy() & strlcat() to use ASSERT_OR_RETURN
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7478 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-28 09:59:21 +02:00
Giel van Schijndel 52c8ba24e4 Revert accidentilly committed revisions r7394, r7395 and r7396 (part of a private branch)
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7398 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-15 22:29:31 +02:00
Giel van Schijndel af40e39f77 Move construction/allocation code for JSON structures to json_value.[ch]
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7396 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-15 22:29:30 +02:00
Giel van Schijndel ef5a01eeb9 Add a JSON tokenizer (lexer), parser and serializer
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7395 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-15 22:29:30 +02:00
Giel van Schijndel aaa1efe4bb Add a function for UTF-8 encoding
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7394 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-15 22:29:30 +02:00
Giel van Schijndel 8e57c65386 Use "struct timeval" from winsock2.h instead of our own
On Windows <sys/time.h> doesn't exist (MinGW being an exception) and
"struct timeval" is thus defined in winsock2.h.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7285 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:35 +02:00
Per Inge Mathisen 7bea80efd3 Please use setDroidActionTarget() whenever you change psActionTarget. This helps set dangling pointer debugging information.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7262 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:32 +02:00
Buginator 1f9e48ba86 Fixes compile issue that was broken in r7237.
In this case, 'Remove unnecessary SDL includes.' Removed the #include for C99 types that we use on non C99 compilers.

In case your wondering, using SDL_stdinc.h, since SDL_types.h is Deprecated.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7250 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:30 +02:00
Per Inge Mathisen a9b8a20aa5 Make focusState a static to main.c, instead of a global from frame.c
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7240 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:30 +02:00
Per Inge Mathisen 29a2b2fe35 Change SDL types to stdint.h defined types. Do not depend on SDL.h included system headers.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7238 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:30 +02:00
Per Inge Mathisen 8a0a0af7c0 Remove unnecessary SDL includes.
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7237 4a71c877-e1ca-e34f-864e-861f7616d084
2009-05-06 22:29:29 +02:00
Per Inge Mathisen 0c694a22b0 Introduce ASSERT_OR_RETURN, a macro to assert on an expression, and assert() and then return if it fails,
but only assert() in debug builds.


git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7136 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-23 01:36:45 +02:00
Giel van Schijndel bf4e0e3745 Major cleanup of configfile.[ch]:
* Remove unnecessary "// =====..." and "//~~~~..." comment bars
 * Use "bool" instead of "BOOL"
 * Use ARRAY_SIZE(registry) instead of REGISTRY_HASH_SIZE to get the amount of hash entries

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7068 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-19 23:45:24 +02:00
Giel van Schijndel b92b348c3a In lexer_input.h #include <stdio.h> for FILE*
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7067 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-18 22:39:52 +02:00
Giel van Schijndel e0f65b827c Add support for Full Screen Anti-Aliasing (FSAA):
* Enable, at the user's request, FSAA.
  - The user can specify the amount of samples (should be a power of 2) with the "FSAA" config option.
  - The user can disable FSAA by setting the "FSAA" option to "0" (zero)

This closes #387.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7065 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-18 17:08:19 +02:00
Giel van Schijndel b5fa41ceff Make it possible for the lexers to use data from an STDIO FILE* stream
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@7052 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-18 15:37:53 +02:00
Giel van Schijndel 2bca3018f4 Make sure that WZ_ASSERT_STATIC_STRING works properly in C++ as well
In fact, WZ_ASSERT_STATIC_STRING should now work on ''all'' valid C++ compilers.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6930 4a71c877-e1ca-e34f-864e-861f7616d084
2009-04-03 18:53:11 +02:00
Giel van Schijndel f179b6f092 Allow compiling and linking with lib/framework/stdio_ext.h and src/version.h from C++ code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6920 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-30 16:10:59 +02:00
Per Inge Mathisen 82a97e938e Various fixes to be able to compile (but not yet link) Warzone with g++
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6912 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-30 16:10:58 +02:00
Dennis Schridde 1199b1e03b Possibly uninitialised variable says GCC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6847 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-14 19:49:43 +00:00
Per Inge Mathisen 9271cf015e Oops. Fix blooper while editing framework build system.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6794 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-07 18:19:59 +00:00
Per Inge Mathisen 5da9b30f7d Fix missing files in makefiles so that 'make dist' can be run again.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6792 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-07 18:09:58 +00:00
Dennis Schridde ffcf206972 MSVC supports noreturn as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6780 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-06 14:52:22 +00:00
Dennis Schridde 6c1bafbf77 Use macro to check for MSVC .NET
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6778 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-06 14:40:19 +00:00
Dennis Schridde c0acc342bb Add more documentation to WZ_DECL_*, use __ attribute names as recommended by GNU for headers, reorder defintions logically
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6777 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-06 14:40:08 +00:00
Dennis Schridde 4c3053b3e1 "restrict" is a C99 feature, thus use the appropriate checks
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6776 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-06 14:39:59 +00:00
Dennis Schridde 8aacce716c Provide noreturn declaration macro (useful for exit-on-failure functions)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6775 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-06 14:39:19 +00:00
Freddie Witherden 34323e368a Fix compilation of SQLite under OS X. Stats are still broken.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6758 4a71c877-e1ca-e34f-864e-861f7616d084
2009-03-01 13:06:59 +00:00
Buginator fc8bbc5bd9 Feature fixes & enhancements.
*Adds LOG_FEATURE (--debug feature) so we can keep track of features.

*Disallow VTOLs from being able to poach features.

*Changes feature spawning from instant to a variable time period.

*When feature can't be placed, break out of routine instead of sending invalid data.

*Actually remove features, and notify others that the feature was removed. (AKA, actually sync between machines.)

ASSERT() when numNaybors is invalid.
Fix a spamming debug line mistakenly changed in r6677


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6737 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-28 03:36:26 +00:00
Buginator 9d868d4c0c Adds LOG_LIFE to track when units are created.
(We already had LOG_DEATH)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6694 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-22 17:59:57 +00:00
Gerard Krol 5601741b95 Brace for impact, this is the new terrain renderer!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6682 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-21 23:35:21 +00:00
Buginator e920507134 Change debug() output from gametime to real time.
In MP games, since gametime can vary so much between machines, needed a more reliable time source to sync up messages between them.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6679 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-21 22:24:02 +00:00
Per Inge Mathisen 3e96bd6b1d Clean up mapLoad(), using physfs to read directly from file instead of casting structs to a memory buffer. Closes ticket:274.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6662 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-19 20:35:43 +00:00
Buginator ac9a882f07 Fixes #257
Can compile OK with MSVC once again.

Frame.h must be included before default system header #includes, so we don't have linker redefinitions & conflicts with the non C99 compliant routines that MSVC uses.
Or in other words, we want our C99 compliant routines to override the default routines that MSVC uses.



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6640 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-15 06:09:24 +00:00
Guangcong Luo 1f5ab803ed Updated MinGW32 makefiles; fix "multiple half-tracks" bug.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6639 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-15 05:49:09 +00:00
Buginator 55d3044f15 Updated MSVC project & solution file(s).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6637 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-15 05:42:09 +00:00
Dennis Schridde 9dae6df94c Safen includes
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6623 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-11 12:12:00 +00:00
Dennis Schridde c4e55e49a3 Include frame.h in stdio_ext.c, so that we get debug.h and its declarations
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6620 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-11 11:04:08 +00:00
Dennis Schridde aac41748dc Bump copyright
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6617 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 18:01:48 +00:00
Dennis Schridde 52b07e9cf0 Move piefixedpoint.h and pievector.h out of ivis, since they are quite generic
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6615 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 17:23:18 +00:00
Dennis Schridde 0c5d56b35a Move endian_* functions into a dedicated header and do not include it from frame.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6614 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 17:23:14 +00:00
Dennis Schridde cbbc58d1e9 Move files which extend a c std library header to a filename of similar name
Extension functions dealing with ...
 * strings are in string_ext.h
 * stdio (namely printf variants) are in stdio_ext.h
 * math are in math_ext.h

These headers are no longer included by frame.h

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6613 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 17:23:09 +00:00
Dennis Schridde 8050b17162 Cleanup
Incl: Move MAX_STR_LENGTH out of wzglobal.h, since it is only used in src

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6612 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-10 17:23:03 +00:00
Giel van Schijndel 516067dec0 Alter frandom's API such that it takes no parameters and returns a float ranging from 0.f to 1.f
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6608 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 22:51:41 +00:00
Dennis Schridde b49952ce1e New function: frandom(x,y)
Returns a random floating point number between x and y

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6604 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 21:53:25 +00:00
Dennis Schridde 0b09ace43a More compact versions of fminf() / fmaxf()
Includes a comment on what might appear as magic or
incomplete implementation at first sight.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6603 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 04:07:44 +00:00
Dennis Schridde df6bd00d7e Provide fmaxf() / fminf() for non C99 compilers
Fixes #234.
This is not the patch attached there, since that one was broken.

From the manpage:
DESCRIPTION
       These functions return the larger value of x and y.
RETURN VALUE
       These functions return the maximum of x and y.
       If one argument is a NaN, the other argument is returned.
       If both arguments are NaN, a NaN is returned.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6601 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 03:53:08 +00:00
Dennis Schridde 80e64617b2 Use faster float code for hypotf, instead of falling back to doubles
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6600 4a71c877-e1ca-e34f-864e-861f7616d084
2009-02-09 03:53:05 +00:00
Dennis Schridde ed2a2011f6 Improve preprocessor checks for type definitions
* Check for C99 instead of !MSVC where we deal with C99 stuff
 * C++98 defines bool as well
 * Move BOOL after the bool checks, so we could define it to bool more easily

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6572 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-31 15:51:47 +00:00
Dennis Schridde e88fb88376 Detect C++98 and do not mix feature detection code with platform hacks (!!)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6571 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-31 15:51:43 +00:00
Dennis Schridde 98842001af Use bool instead of BOOL where the latter is not required
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6569 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-31 15:51:35 +00:00
Dennis Schridde f9ef8289a4 Bump SQLite3 to 3.6.10
An change was introduced on sqlite3_vfs which causes an incompatible
 pointer error when mixed with older sqlite versions. Thus bump the
 required version to 3.6.10 as well.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6564 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-30 18:28:21 +00:00
Giel van Schijndel cb22e77099 * Check whether the system itself already provides strlcpy and/or strlcat
- If it does, check whether it's behaviour is consistent with our implementation
   - If behaviour is consistent: use the system's implementation
   - If not, rename our implementation (to prevent symbol clashes) and use our own


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6556 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-24 18:15:19 +00:00
Per Inge Mathisen 0881493713 New cheat "noassert" and new command line option "--noassert" turns off the abort functionality in ASSERT() calls.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6527 4a71c877-e1ca-e34f-864e-861f7616d084
2009-01-02 11:16:40 +00:00
Giel van Schijndel 550efd000a Remove unused functions setMouseDown and setMouseDown
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6429 4a71c877-e1ca-e34f-864e-861f7616d084
2008-12-03 21:16:15 +00:00
Giel van Schijndel fc808a8c89 Only #define va_copy if it isn't #defined yet
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6367 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-23 17:24:48 +00:00
Giel van Schijndel ccc6206247 Add Doxygen documentation for v?asprintf
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6289 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-14 14:30:12 +00:00
Giel van Schijndel 7b37001471 Make v?asprintf return -1 on all errors (similar to GNU's implementation)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6287 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-14 14:28:21 +00:00
Giel van Schijndel 11e378ccce Allow WZ_ASSERT_STATIC_STRING to work when compiled as C++ as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6262 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-09 23:49:39 +00:00
Giel van Schijndel c99a123b50 * Remove unused list macros: LIST_INIT and LIST_ADD
* Rename LIST_ADDEND to LIST_APPEND (because that's what it does: append to a list)
 * Clean up the assertion in LIST_REMOVE
 * Prevent a potential bug in LIST_APPEND by not initialising the psNext pointer to NULL
  - doesn't ever occur right now, for one simple reason: the only place where this macro is used is on a structure that's initialised with memset(0)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6260 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-09 22:58:04 +00:00
Giel van Schijndel 17a0228d18 Remove unused function endian_fract
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6259 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-09 22:58:01 +00:00
Giel van Schijndel 2391ddd622 * Make the endian_*word class of functions/macros inline functions (and the type checking of their parameter) on ''all'' platforms!
* Fix several parameters that got passed wrong and didn't get caught due to the different definitions

Caught by EvilGuru

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6256 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-09 19:21:20 +00:00
Giel van Schijndel 03353e833e Allow the initialisation function of the debug callback to fail and report its failure through its return value:
* If initialisation of the debug callback failed, do ''not'' add it to the list of debug callbacks to use

This fixes ticket:136

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6249 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-08 19:30:18 +00:00
Giel van Schijndel 64910221e7 Fix several warnings that occur on NDEBUG builds:
* Missing returns from function
 * Functions that are defined in both DEBUG and NDEBUG builds but only used in DEBUG builds

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6179 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 14:22:29 +00:00
Giel van Schijndel e5183abb69 Lets at least keep the comment in front of the declaration it applies to... (regardless of C89/C99, see r6162)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6164 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 13:18:51 +00:00
Buginator 2ce52672c7 Declarations *before* statements. (To make a C89 compiler happy.)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6162 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 03:22:18 +00:00
Giel van Schijndel 1df1706440 * Fix several "comparison between signed and unsigned" warnings
* Const correctness
 * Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6158 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 20:42:20 +00:00
Giel van Schijndel ec4867f297 dirtyHypot() cleanup:
* Implement hypot() and hypotf() on non-C99 systems
 * Wherever the parameters to dirtyHypot() are signed: use hypotf() instead
 * Move some variables in to a more local scope
 * Merge the conditions of some nested if-statements
 * Get rid of some stupidly named variables (tempx and tempy are ''not'' good variable names, the names should indicate ''what'' the variables contain, not for how long)
 * Remove some unnecessary casting between float and [SU]DWORD


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6157 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 20:25:41 +00:00
Giel van Schijndel 29d7c7abfd Fix the raw win32 makefile system which got broken in r6144 and r6145:
* The lexers depend on the parser's headers so make sure to compile the parsers first
 * Move a misplaced line-wrapping backslash in src/makefile.win32


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6153 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 18:28:21 +00:00
Giel van Schijndel 810fac209b * Wrap all file lists in the automake and win32 makefiles across lines such that there's only one file on each line
* Alphabetically sort the file lists

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6144 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-13 13:04:37 +00:00
Buginator 6a70a7750d Changes the 'optional file not found' from LOG_WARNING to LOG_WZ, because of too much spam.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6131 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-11 19:15:08 +00:00
Giel van Schijndel d871a85964 Add video playback support:
* Add support for decoding and displaying of OggTheora/Vorbis videos
 * Change all references to *.rpl files to *.ogg files (and lower case them)
 * Add a new menu (and config) option for selecting the size at which to display videos (1x (native), 2x, full screen)

This closes ticket:64 and ticket:46

Code changes are ticket:64 (patch by Gerard Krol, Giel van Schijndel and Buginator)

FMVs can be found at http://download.gna.org/warzone/videos/sequences_ogg.zip (for now at least)
Videos encoded by Angus Lees


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6119 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-08 18:24:19 +00:00
Giel van Schijndel 77d7490ed3 Move all header content of math-help.h inside its header guards
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6111 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 12:34:42 +00:00
Giel van Schijndel a74c27019d Make sure to #define the [SU]BYTE_(MIN|MAX) and [SU]D?WORD_(MIN|MAX) constants in terms of the U?INT(8|16|32)_(MIN|MAX) constants
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6110 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 12:09:58 +00:00
Giel van Schijndel 953a3a998b Allow #including lib/framework/types.h without lib/framework/frame.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6109 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 12:09:53 +00:00
Per Inge Mathisen 4a9c00e469 Revert tagfile changes in r6084, r6080 and r6079. Apparently not ready for the unwashed masses yet.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6102 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-02 21:50:05 +00:00
Per Inge Mathisen b66897f058 Port to trunk the fix for virtual group recursion from tagfile branch. Add unit test to ensure
it never comes back.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6084 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-26 19:14:56 +00:00
Per Inge Mathisen 87bf67480e Also port over the required fixes for tagfile.c, or previous commit will not work.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6080 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-26 17:48:33 +00:00
Per Inge Mathisen 6fc021819c Do a dummy load of basic object data from tagfile to stress test tagfile system. Ported from work in tagfile branch.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6079 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-26 17:45:18 +00:00
Per Inge Mathisen 68ca9bef81 Fix tagfile type definition
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6078 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-26 17:39:10 +00:00
Giel van Schijndel 2cea275cb5 * Fully define struct timeval (not just forward declare)
* Forward declare struct timezone


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6063 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-20 23:42:48 +00:00
http://www.openasthra.com/c-tidbits/gettimeofday-function-for-windows/ 05f7761bab Add a gettimeofday() implementation for Windows
Epoch and hint to use GetSystemTimeAsFileTime taken from: http://www.openasthra.com/c-tidbits/gettimeofday-function-for-windows/

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6062 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-20 23:24:17 +00:00
Giel van Schijndel 10ac89541a Update our SQLite copy from 3.5.9 to 3.6.2
* 3.6.0 introduced an interface change to the VFS layer
 * Updated physfs_vfs.c for the interface change in 3.6.0, breaking compatibility with SQLite < 3.6.0
 * Change the configure script to require sqlite3 >= 3.6

This closes ticket:66

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6034 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-16 20:02:16 +00:00
Giel van Schijndel 043cc9d278 Fix a spelling error in the MSVC project files causing problems with the #include path
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6027 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-14 19:47:56 +00:00
Giel van Schijndel ff507b13f0 * Don't use "if USE_SYSTEM_SQLITE" sections in all Makefiles
* Use the pkg-config variables SQLITE_CFLAGS and SQLITE_LIBS to compile and link with instead


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6021 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-14 14:41:44 +00:00
Giel van Schijndel 140f553d06 * Change the autotools build system such that if the system provides an SQLite version that meets our requirements we use that instead of the one in our own repository
* Require sqlite3 versions >= 3.5.4 and < 3.6 (due to r5984 these versions are possible)
 * Move physfs_vfs.[ch] from lib/sqlite3/ to lib/framework/
 * Update the autotools, raw win32 Makefile, Code::Blocks and MSVC build systems
  - NOTE: Xcode still requires an update

This closes ticket:59


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6018 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-14 13:40:28 +00:00
Per Inge Mathisen 704117f85c Fix various doxygen errors and warnings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5992 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-11 18:25:34 +00:00
Per Inge Mathisen be263e0b8c Fix missing define of WZ_DECL_THREAD on windows
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5991 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-11 18:16:06 +00:00
Buginator 21fdab0117 Modify debug output to specify the 'real' directory that physfs is using for the file in question.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5958 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 20:00:54 +00:00
Giel van Schijndel 01c6ba831c Allow compiling of utf.c outside of framework's debug facilities (i.e. allow it to be used in betawidget)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5942 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-06 16:20:06 +00:00
Giel van Schijndel bdae8ce9ef Only #include types.h in utf.h as we don't depend on the entire framework
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5940 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-06 16:02:26 +00:00
Giel van Schijndel 906f766b8a * When using a va_list multiple times make sure to va_copy it first
* Make sure to call va_end on all instances of va_list when we're done with it

Similar to r5930 (which fixed ticket:50)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5931 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-05 20:10:47 +00:00
Giel van Schijndel 37c6b31651 * When using a va_list multiple times make sure to va_copy it first
* Because va_copy is C99 provide a fallback for it on non-C99 systems (which assumes that va_list is just a pointer to the stack)

This fixes ticket:50, thanks to Buginator for finding the cause (though this solution is different from his suggestion)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5930 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-05 19:38:22 +00:00
Freddie Witherden bef604763f Add an nbytes parameter to UTF8toUTF16 and UTF16toUTF8 which allow for fetching the number of bytes allocated.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5917 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-02 14:37:01 +00:00
Freddie Witherden a8709983e0 Commit the final patch of patch #45; this cleans up utf.[ch].
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5916 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-02 11:21:12 +00:00
Giel van Schijndel 99fe22e0a4 Don't accept out-of-range Unicode codepoints in function unicode_utf8_char_length either
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5915 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-01 19:16:00 +00:00
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