Commit Graph

2111 Commits (ba36ac6cfd69466d2b36b5cba82fedb2fa6513da)

Author SHA1 Message Date
Giel van Schijndel e63189b4f9 * Add libtool version information to betawidget
- Use 0:0:0 as current version (API=0, API_IMPLEMENTATION=0, IMPLEMENTATION_AGE=0)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6375 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-23 21:38:25 +00:00
Giel van Schijndel 0e80daf989 * Don't bother trying to get at the libtool libraries (.la)
- We currently do this for Lua
  - Libtool is apparently smart enough to find out about libtool libraries on its own (so we don't need to "hack" our way to finding those)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6374 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-23 21:32:26 +00:00
Giel van Schijndel 11f4f2df83 Lets generate a pkg-config .pc-file for betawidget.
This allows easy detection of betawidget by means of pkg-config


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6373 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-23 20:58:30 +00:00
Giel van Schijndel 2c1e2e282c Include tools/sdl-testapp.lua, src/betawidget.i and src/lua-wrap.h as part of "make dist" (i.e. they're required at build time)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6372 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-23 20:26:26 +00:00
Giel van Schijndel 0505129930 Lets build table.[ch] along with the rest of betawidget
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6371 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-23 20:24:16 +00:00
Giel van Schijndel 97931f21eb Move the actual library code of betawidget from lib/betawidget/ into lib/betawidget/src/
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6370 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-23 19:49:36 +00:00
Giel van Schijndel b48b300697 * Use "recursive make" to build the test apps in lib/betawidget/tools/
- Make sure to build libbetawidget.la in lib/betawidget/ first though (because tools/ depends on that)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6369 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-23 19:32:54 +00:00
Giel van Schijndel d719e9977b Betawidget:
* Use plain "cairo" instead of "cairo-svg" because "cairo-svg" is an ''output'' backend in which we're not interested
 * When re-running aclocal make sure to pass `-I m4` to it
 * For lack of -Werror lets compile with -Werror-implicit-function-declaration to die at implicit function declarations (rather than getting stranger errors)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6368 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-23 17:57:23 +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
Freddie Witherden 2b11839902 Fix an indentation error in table.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6361 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-22 13:55:01 +00:00
Freddie Witherden 5bca9c8df9 Add support for setting the horizontal/vertical padding of a table and fix a bug in the padding alignment code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6360 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-21 18:51:34 +00:00
Freddie Witherden 4d163dd309 Provide a complete, mostly working, table widget implementation. Unit tests are still required.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6357 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-21 18:10:56 +00:00
Freddie Witherden b278bbb4ee Add the concept of a NUL size to betawidget which is needed to allow widgets to be added to a parent-less container.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6356 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-21 17:52:21 +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
Gerard Krol 03c11abefb Hide the mouse cursor during loading screens and movies.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6252 4a71c877-e1ca-e34f-864e-861f7616d084
2008-11-08 21:37:32 +00:00
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
Buginator c5c02052d6 Add Hack from ticket:115
Forces window XP users to also use a software device for openAL.  (already the default for the other platforms & vista).  This allows 256 sources, instead of 16.
Note: *this is windows specific* and will not affect the other platforms.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6223 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-26 17:10:42 +00:00
Giel van Schijndel a47f0e94a7 Oops, need to copy filename template into template buffer (see r6214, r6217)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6218 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 22:16:13 +00:00
Giel van Schijndel a5c5328609 Make sure we take sizeof(array), not sizeof(pointer)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6217 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 22:11:43 +00:00
Giel van Schijndel 0269d11d16 In the exception handler:
* use mkstemp(3) to create a temporary file that's guaranteed not to exist already

Prevents a potential symlink attack (e.g. where /tmp/warzone2100.gdmp is symlinked by user A to a file owned by user B, then having user B crash warzone)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6214 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 21:47:00 +00:00
Buginator 6f3419da73 Modify scrOutputCallTrace() to dump the stack on script errors, and act normally whenever it is called normally.
(Normally, it dumps only when LOG_SCRIPT is defined, but we can't determine where the script errors are when LOG_SCRIPT isn't used)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6212 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-25 17:56:43 +00:00
Giel van Schijndel ceeb8780c7 Explain the "funny" iteration used to iterate over OpenAL devices
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6199 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-22 17:19:43 +00:00
Buginator 48eacfbc3d Dump out available devices available for openAL in the PrintOpenALVersion() function.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6196 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-21 18:40:05 +00:00
Giel van Schijndel cb2ec762e2 * Change animObj_Remove such that it doesn't set the passed in ANIM_OBJECT* pointer to NULL (i.e. a ** pointer was passed)
* Instead rely on setting that pointer to NULL in the client code that calls animObj_Remove in the first place
  - This was already done in all but one case where animObj_Remove was called

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

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6179 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 14:22:29 +00:00
Freddie Witherden 19f1175c04 Making padding a const int, as opposed to accessing it directly, in the hBox class.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6175 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 12:34:19 +00:00
Freddie Witherden c12227b453 Simplify the fitting algorithm for the hBox class.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6174 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 11:36:38 +00:00
Freddie Witherden f42ce71599 Fix a nasty typo in the hBox class which caused hBoxGetMinSize to be called for widgetGetMaxSize.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6173 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 11:33:49 +00:00
Freddie Witherden 3a4b246ff7 Add padding support to the hBox class; also, ensure that we set the default alignment/padding in the constructor; finally, improve the Doxygen documentation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6172 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-16 10:38:50 +00:00
Freddie Witherden 96509127b1 Add table.[ch] which is a partially completed table container implementation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6171 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 20:06:18 +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
Freddie Witherden ec00337b6c Use alloca as opposed to malloc for allocating temporary storage in hBox.c.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6163 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-15 11:38:09 +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 71ddbdc5e4 Cleanup:
* Mark several parameters that aren't being used (but shouldn't be removed) with WZ_DECL_UNUSED
 * Use "(unsigned )?int" instead of "[SU](D?WORD|BYTE)" where the size guarantee is not required
 * Instead of "(X - Y) >= 0" use the logically equivalent and more readable "X >= Y"
 * Remove redundant function prototypes
 * Move variables into a more local scope where possible
 * Assign the result of an expression to a variable once so that the expression doesn't have to be duplicated several times
 * Move constant UNALLOCATED_OBJECT out of the header and into the only source file where it's ever used

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6160 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 21:03:23 +00:00
Giel van Schijndel 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 55aaffac40 Construct programPath from the iterators of "buf" not from a char* pointer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6152 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 13:00:36 +00:00
Giel van Schijndel 5f5489b650 * Stuff SESSIONDESC.dwUser[1-4] in an array: SESSIONDESC.dwUserFlags\[4]
* Rewrite NETgetGameFlagsUnjoined such that it's not hardcoded for its `flag` parameter anymore

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6150 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-14 12:58:59 +00:00
Giel van Schijndel 0c1a577ee7 * Use GlobalAlloc and GlobalFree instead of malloc() and free() respectively
Do this because we cannot trust malloc()'s heaps to be intact at the time an exception handler gets called.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6146 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-13 15:41:50 +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
Freddie Witherden aa447545b2 Outlaw the use of SDL_SetGamma (patch #83). This closes ticket #83. Approved by Giel.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6129 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-11 10:51:53 +00:00
Buginator 31b3895caf Closes & fixes ticket:99
Using --nosound is handled correctly for the FMVs now.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6125 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-11 03:21:03 +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 58117a87c0 * Remove duplicate sound effect pcv483.ogg
* Rename pcv483.ogg to power-transferred.ogg


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6117 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 21:49:58 +00:00
Giel van Schijndel df801f1b08 * Make seq_Play const correct
* Use "bool" instead of "BOOL" for the return types of lib/sequence functions

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6112 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 18:45:18 +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
Buginator 4971f0cdcd Adds a message to the console when screenshot key is hit.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6108 4a71c877-e1ca-e34f-864e-861f7616d084
2008-10-04 03:31:18 +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 becaf21060 Revert r6058: I stupidly used "git svn dcommit" instead of "git stash pop" (yes I know they don't even look the same...)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6059 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-20 15:54:41 +00:00
Giel van Schijndel 53d6990a55 Initial FMV support
patch: http://developer.wz2100.net/attachment/ticket/64/FMV5c.patch

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6058 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-20 15:52:01 +00:00
Freddie Witherden 784b40d2a0 Slight cosmetic improvement to the window alignment code (factoring out a / 2).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6049 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-18 22:56:36 +00:00
Freddie Witherden ba9c453857 Make sure we correctly enable double buffering for SDL.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6048 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-18 22:21:08 +00:00
Freddie Witherden 6e3ff77160 Vsync for the win, also enable double-buffering.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6047 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-18 22:10:40 +00:00
Freddie Witherden f499f08a49 Use glPushMatrix and glPopMatrix when compositing as opposed to manually restoring it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6046 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-18 21:56:02 +00:00
Freddie Witherden 994e2d3938 Fix radar corruption under nVidia/Intel cards. This closes ticket #72.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6042 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-18 17:45:16 +00:00
Freddie Witherden dc878823c2 Fix the inclusion of GLEE in betawidget; this fixes the blending problems under nVidia Linux. Plus some minor indentation fixes.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6037 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-18 11:24:36 +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 73bd4b81f9 Don't #define DATADIR when compiling SQLite as it causes conflicts with some Windows headers (objidl.h:95)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6029 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-15 06:06:59 +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
Freddie Witherden 26444e8e07 Switch from a virtal method to an event handler for re-generating the window's pattern.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6020 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-14 13:49:37 +00:00
Giel van Schijndel 9d7a8e8d43 Update our SQLite copy from 3.5.4 to 3.5.9
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6019 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-14 13:48:22 +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
Giel van Schijndel e2fa071a02 Replace the custom crafted Lua interface code for the addEventHandler and addTimerEventHandler methods of class widget with a SWIG typemap
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6017 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-14 13:27:03 +00:00
Giel van Schijndel 4d79c24838 * Add Lua support for widget animations
* These can be defined using Lua tables; see the example code in sdl-testapp.lua

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6016 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-14 13:26:48 +00:00
Giel van Schijndel 8681483c7d Make sure to translate before scaling in widgetCompositeImpl as that yields in-place scaling as opposed to scaled translating
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6015 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-14 13:16:49 +00:00
Giel van Schijndel e3c884a249 When resizing windows make sure to resize their gradient as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6011 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-14 01:34:16 +00:00
Giel van Schijndel e766b2f605 Allow Lua event handlers to remove themselves (i.e. don't segfault in that case)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6010 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-14 01:32:59 +00:00
Giel van Schijndel 41e74888ef Make sure to use "destroy" as the method name in lua_widget_destroy for error message generation
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6009 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-14 00:48:29 +00:00
Giel van Schijndel ee7cfc1ac5 * Add enum spacerDirection and its contents to the Lua betawidget module
* Add method `destroy` to the Lua class `widget` and its children in the betawidget module
 * Add some code that demonstrates the usage of widget:destroy() and its current flaws (i.e. segfaults ''will'' occur when using widget after calling the destroy() method on it, garbage collection is included in "using")


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6008 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-14 00:37:20 +00:00
Giel van Schijndel c661cb9bc4 * Don't use a single cairo_pattern to store the window gradient for ''all'' windows
* Use a separate cairo_pattern for each window to store the window gradient in


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6007 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-13 23:15:44 +00:00
Giel van Schijndel a2a22b3804 Check both the `lua5.1` and `lua` pkg-config package in betawidget's ./configure script
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6006 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-13 22:36:47 +00:00
Giel van Schijndel 123551b6b6 Initialise the network buffer to send GAMESTRUCTs from across to zero
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6004 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-13 20:39:26 +00:00
Giel van Schijndel 07e8a802f9 Remove the last remnants from platform selection in betawidget/Makefile.am
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6003 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-13 18:36:33 +00:00
Giel van Schijndel ea446b8653 * Use recursive make (through SUBDIRS) to build the `platform` portion of betawidget
* Compile the utility part we use from Warzone (framework/utf.c and ivis_opengl/GLee.c) separately


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@6002 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-13 18:35:26 +00:00
Elio Gubser 2395064bc8 outsourced the pathing function from windowDoDrawMaskImpl and windowDoDrawImpl, corrected some obvious nasty bugs
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5998 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-12 18:58:18 +00:00
Elio Gubser 413cc540a9 outsourced the pathing function from windowDoDrawMaskImpl and windowDoDrawImpl, corrected some obvious nasty bugs
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5997 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-12 18:52:23 +00:00
Elio Gubser 426f09cf9b nicer window design implemented
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5996 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-12 18:05: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
Giel van Schijndel 50c974f74b Install all betawidget headers into $(pkgincludedir)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5988 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-11 07:56:28 +00:00
Giel van Schijndel 6088fca5af * Make xGetTempname (from the PhysicsFS VFS for SQLite) return a bogus filename to keep SQLite happy
- We can safely catch the only one case where this filename is used (see comment in diff for an explanation)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5984 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-09 20:07:16 +00:00
Freddie Witherden 4bb879d64c Make sure we fill out the event structure for EVT_DESTRUCT events.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5983 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-09 18:10:06 +00:00
Giel van Schijndel 6061eb40d9 Add an example of window/widget destruction by means of employing the garbage collector (this should be improved to something like widget:destroy())
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5980 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-09 11:33:40 +00:00
Giel van Schijndel 9177d9cf2f * Register widgetGetTime() as betawidget.getTime() in Lua
* In the Lua test app use betawidget.getTime() to determine the *true* amount of time passed since registering of the timer event


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5979 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-09 11:17:38 +00:00
Giel van Schijndel 0d3b868de7 * After calling the Lua event handler function make sure to pop the return value from the stack
* If the Lua event handler function didn't return a value, assume it was successful (and leave the stack as is)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5978 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-09 11:04:56 +00:00
Freddie Witherden 75d615d134 Update the Doxygen documentation for clipboardX11.c.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5977 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-09 10:18:15 +00:00
Giel van Schijndel ce8d315645 Fix a bug where we would fire timer events `interval` milli-seconds since program start up instead of `interval` milli-seconds since registering the event
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5976 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-09 09:35:59 +00:00
Giel van Schijndel 4ca3f73cbb Print an empty string when the clipboard contains nothing (i.e. betawidget.getClipboardText() returned nil)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5973 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-08 21:34:31 +00:00
Giel van Schijndel 5184c015e4 * Don't store a Lua reference to the widget itself in the callback struct
- This struct is only destroyed when the callback is destroyed, which (by default) only happens when the widget is destroyed.
  - Keeping a reference to the widget prevents Lua's garbage collector from ever destroying the widget
  - Thus store a reference to the widget in a Lua "weak table"
  - Also store the callback function in this table
 * Thus we now only keep a reference to a Lua table referring to the widget (weakly) and the function (normally/strongly)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5972 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-08 21:34:17 +00:00
Freddie Witherden 5bdf883268 Add GPLv2 or above licensing cruft to the SDL betawidget test application; remove the erroneous call to SDL_Quit which was added in r5964.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5970 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-08 17:45:51 +00:00
Giel van Schijndel 574a74ab35 Extend the betawidget Lua testapp:
* Be more interesting when clicking the first window
 * Add a timer event handler
 * Add a clipboard usage example


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5968 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-08 00:32:22 +00:00
Giel van Schijndel 966e1bfedc Add an example of how to use a closure in Lua in order to bind user data to an event handler
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5966 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-08 00:06:04 +00:00
Giel van Schijndel f81ac77f91 Rewrite the SDL betawidget testapp to set up its GUI using Lua and betawidget's Lua bindings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5965 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 23:56:00 +00:00
Giel van Schijndel 75b4e523bd Fix a memory leak which resulted from neglecting to call SDL_Quit()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5964 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 23:51:21 +00:00
Giel van Schijndel b033817fc4 * Add a Lua interface to (parts of) betawidget
* Partially generated by SWIG
  * Partially handcrafted
 * Already supports registering Lua functions as event handlers of `widget` derivatives
 * Slight change in betawidget headers because the struct typedef's somehow confused the compiler
 * Use libtool for linking with Lua


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5963 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 23:47:53 +00:00
Giel van Schijndel 5802bba3ae Add a small SDL test application for betawidget (committed for EvilGuru)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5962 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 22:50:25 +00:00
Per Inge Mathisen 4def288387 Remove requirement on texture rectangle extension for minimap code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5960 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 21:41:50 +00:00
Freddie Witherden c174efd0c7 Fix a typo in the doxygen documentation for widget.h.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5959 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 21:10:31 +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
Freddie Witherden a7eee1378d Pass the ID of an event handler to destruct events the same way as we would to regular events.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5953 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 16:58:46 +00:00
Freddie Witherden 50747b6e53 Fix compilation of betawidget/platform/sdl/event.c.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5952 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 15:31:34 +00:00
Freddie Witherden b827f0b7d6 Add support for text events to betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5951 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 14:05:55 +00:00
Freddie Witherden c670477709 Fix the include paths for clipboardWin32.c
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5950 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 13:57:01 +00:00
Freddie Witherden 19345a8d2e Fix the X11 clipboard code so that it now waits for a response before attempting to fetch the data; also make it request a UFT-8 string.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5949 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-07 13:35:39 +00:00
Giel van Schijndel d4923de07a Conditionally compile in one of platform/sdl/clipboard* depending on the host platform we're compiling for
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5946 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-06 22:39:43 +00:00
Giel van Schijndel d40084dadc Take care of #including utf.h and the content of <stdbool.h> and <stdint.h>
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5943 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-06 17:20:34 +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 330d599916 Apparently betawidget depends on GLee and utf.[ch], so make sure to compile those along
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5941 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-06 16:11:30 +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 e9ea1df8d9 * Move the addition of SDL's stuff to CPPFLAGS and LIBS to the "platform selection" part
* Make sure to also check for and link against OpenGL


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5939 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-06 15:50:48 +00:00
Giel van Schijndel 6150e58b45 * Make sure that we only have a compile and link time dependency on Cairo when compiling and linking betawidget, not when using it
* When only compiling and linking against betawidget just forward declare cairo_t


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5938 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-06 15:38:31 +00:00
Giel van Schijndel a8aa84dec4 Use libtool for compiling and linking of betawidget
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5937 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-06 15:05:55 +00:00
Giel van Schijndel 5ce8de3abe Add a perliminary buildsystem for betawidget (autotools buildsystem)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5936 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-06 13:26:03 +00:00
Freddie Witherden 2547bdcf29 Revert the changes to window.[ch] which were committed by accident in r5931.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5933 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-06 12:31:44 +00:00
Freddie Witherden 04e2f5f82b Update the widget animation callback to use widgetReposition as opposed to setting the position directly.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5932 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-06 12:26:27 +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 548c43e6e3 Add support for resize and reposition events to betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5929 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-05 17:05:56 +00:00
Freddie Witherden 9deaad010d Simplify event creation by adding a helper function to generate the base structure.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5927 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-05 15:03:21 +00:00
Freddie Witherden 4c70b5eb7a Fix a bug similar in ilk to that fixed in r5925, except for vertical as opposed to horizontal window alignment.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5926 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-03 21:36:28 +00:00
Freddie Witherden ad1a6db74e Fix a bug in the window alignment code, thanks to Elio for reporting it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5925 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-03 19:05:29 +00:00
Freddie Witherden 79df709d5b Improve the Doxygen documentation for widget.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5924 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-03 19:02:39 +00:00
Freddie Witherden 7453cee5bb Add textEntry class (warning: unfinished) to betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5920 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-02 17:53:34 +00:00
Freddie Witherden a31fbb4561 Minor indentation fix to clipboardWin32.c.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5919 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-02 16:31:42 +00:00
Freddie Witherden 2a8cee26b5 Re-write the Windows clipboard support; Unicode is now supported; add support for setting clipboard text.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5918 4a71c877-e1ca-e34f-864e-861f7616d084
2008-09-02 16:27:00 +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
Freddie Witherden de59586edf Fix compilation of betawidget on OS X; ensure we correctly restore the layout if a child could not be added.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5905 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-31 10:17:09 +00:00
Freddie Witherden 8114b1e71f Fix a bug in the window alignment code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5904 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 18:14:58 +00:00
Freddie Witherden 2f1cb8dcdc Add widgetSDLInit and widgetSDLQuit to initialise and uninitialise the widget system under SDL.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5903 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 17:15:43 +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
Freddie Witherden 0d58106de3 Make tool-tip events irrelevant for child widgets.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5894 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 10:36:52 +00:00
Freddie Witherden cef3ce8060 Improve the Doxygen documentation for clipboard.h; make the return value of widgetSetClipboardText on OS X mean something.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5893 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-30 10:02:28 +00:00
Freddie Witherden d5b0c12182 Slight refactoring of X11 clipboard code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5892 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-29 22:38:26 +00:00
Freddie Witherden e952b616c2 Remove a printline from the X11 clipboard code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5891 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-29 18:59:29 +00:00
Freddie Witherden 0f46539a45 Add clipboard support for X11.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5890 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-29 18:42:54 +00:00
Giel van Schijndel 37c6aa9fd6 Make sure to clean up the sound streams as well in function sound_ShutdownLibrary()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5884 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-28 20:12:47 +00:00
Freddie Witherden a06bb014df Add partially-finished SDL wrapper code to betawidfet.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5881 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-28 15:34:21 +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 94bbbf4250 Re-organise betawidget as proposed on the mailing list; add paste support for Win32 (needs testing).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5876 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-26 11:01:17 +00:00
Freddie Witherden 2ea48df684 Fix some more typos in widget.h and correct the indentation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5875 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 20:37:41 +00:00
Freddie Witherden 9e605318d9 Add font.[ch] which abstract Cairo's internal font setting routines.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5874 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 18:25:13 +00:00
Freddie Witherden 125dc19e04 Fix a typo in clipboard.h.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5873 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 18:19:38 +00:00
Freddie Witherden c699aca070 Include <stdbool.h> in clipboard.h as opposed to clipboardOSX.m; fixing a potential compiler error.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5872 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 18:04: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
Freddie Witherden 4266827565 Add copy/paste (clipboard) interface to betawidget, along with an OS X implementation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5870 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 17:30:09 +00:00
Freddie Witherden e48b37f6c0 Add tool-tip support to betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5869 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-25 15:56:58 +00:00
Freddie Witherden cc94bc2818 Allow for event handlers to have separate (optional) destructors.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5868 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-24 16:58:27 +00:00
Giel van Schijndel fd0084951e Prevent some infinite recursion
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5867 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-24 16:13:20 +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 19b72f1ce5 * Use alGetError() instead of sound_GetError() to clear error codes (the latter will also dump a debug message to LOG_SOUND)
* Remove some redundant debug(LOG_NEVER calls (they're preceded by a sound_GetError() call which will already dump that info)
 * Improve some comments
 * Log sound errors to LOG_SOUND, not to LOG_NEVER
 * In sound_DestroyStream make sure to bail out when we fail to retrieve the buffer count (as that could cause memory over-allocation)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5860 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-24 12:41:10 +00:00
Buginator 82966293ad Fixes a openAL case where we didn't check if a openAL call failed or not.
(NOTE, this is really a temp fix, so it don't crash/cause more openAL errors. The sound code need a rewrite to correctly fix this problem)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5853 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-23 19:44:00 +00:00
Freddie Witherden 30712505f1 Add the ability to check if an id is a valid event handler or not.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5844 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-21 16:19:51 +00:00
Freddie Witherden 45ba680eb6 Convert a warning in betawidget to an assert; ensure that when adding a child that it has no parent.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5843 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-21 13:46:12 +00:00
Per Inge Mathisen cf7c584399 patch #1095: Make font configurable
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5841 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-20 21:23:58 +00:00
Freddie Witherden 34e4246bd4 Fix a couple of typos and a compiler warning in betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5840 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-20 13:05:44 +00:00
Freddie Witherden d3881835d0 Make the id of a widget a const char*.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5837 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-17 20:51:59 +00:00
Buginator ebecb854b1 Add a fallback for the map preview when drivers report they have FBO, but we detect a FBO error.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5835 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-17 18:35:22 +00:00
Freddie Witherden 077cfee020 Add widgetGetCurrentlyMousedOver to return the widget that currently has the mouse over it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5834 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-17 18:22:38 +00:00
Freddie Witherden dd5a740143 Update the Doxygen comments for betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5830 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-16 17:49:52 +00:00
Freddie Witherden 38cef47896 Fix some compiler warnings for window.c.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5824 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-15 23:28:03 +00:00
Per Inge Mathisen 4cfdec7d58 Remove some dead code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5822 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-15 20:40:38 +00:00
Giel van Schijndel 535c97354f Add Doxygen comments to functions screenDoDumpToDiskIfRequired and screenDumpToDisk
"Poked" by ticket:23 to add these API-level comments, but the comments themselves are completely different.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5821 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-15 20:27:18 +00:00
Giel van Schijndel b8e75ddfbe Make sure to use a `\` (back slash) when breaking lines in Makefiles
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5820 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-15 19:37:46 +00:00
Freddie Witherden 237fbd2514 Add more granular window positioning functions to Betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5819 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-15 19:29:57 +00:00
Freddie Witherden c51ae395ce Fix a potential memory leak in hBox.c, plus some minor cleanup.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5818 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-15 10:28:48 +00:00
Freddie Witherden d8aca5b13f Add animation support to betawidget (#27), improvements to follow.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5817 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-15 09:59:11 +00:00
Freddie Witherden 4718a24ede Add a preliminary window class. Todo:
* More granular control over window position (relative offsets &c);
 * frame drawing code.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5816 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-14 22:04:10 +00:00
Freddie Witherden d6da0800f9 Redo the layout for the entire window when a child widget is added or removed.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5808 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-13 22:19:44 +00:00
Freddie Witherden 96e327b46c Add GPLv2 or above licensing cruft to betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5807 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-13 22:00:17 +00:00
Freddie Witherden ab0ba130de Use a triangle strip as opposed to quads for widget compositing.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5802 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-13 16:25:36 +00:00
Freddie Witherden a0384da56a Do not allow setting of widget->offset directly, instead use a setter method.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5801 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-13 11:21:58 +00:00
Freddie Witherden f66a96b560 Add drag support to betawidget. This closes ticket #30.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5800 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-12 13:00:40 +00:00
Freddie Witherden fb6b8d30b6 Clean up the mouse motion event handling code somewhat.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5799 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-12 11:27:54 +00:00
Freddie Witherden 2d54d1b25b Update the doxygen documentation for betawidget some more.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5798 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-11 19:03:48 +00:00
Freddie Witherden c6c9aeb0c6 Extend the mouseEvent structure so that it also contains the location of the previous mouse event.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5797 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-11 17:18:26 +00:00
Giel van Schijndel 2b572a9492 Work around the fact that on FreeBSD POLL_ERR and POLL_HUP are defined to the same value
This problem is similar to DebianBug:492786

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5795 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-11 15:29:51 +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
Freddie Witherden dd3944c26c More const-correctness for betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5792 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-11 10:27:11 +00:00
Freddie Witherden 421335008a Improve const-correctness in betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5791 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-10 22:51:12 +00:00
Freddie Witherden b752595aae Add the implementation-defined widgetGetTime() function (which returns the current time in ms).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5789 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-10 12:43:45 +00:00
Freddie Witherden 0c527f5c38 Update the doxygen documentation for betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5788 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-10 11:12:42 +00:00
Freddie Witherden 7403707e37 Ensure that we set the event type correctly for timer events.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5787 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-09 20:52:51 +00:00
Freddie Witherden 0440da3f48 Make it possible to get and set the user-data of event handlers.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5786 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-08 18:15:50 +00:00
Freddie Witherden b8d25a33e2 Fix another (and with any luck the last) bug in vector.c.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5785 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-08 17:16:00 +00:00
Giel van Schijndel 9fb5fd1718 * Add a new function `Vector2f_To2i` to convert float vectors to integer vectors
* Add 4 new functions `Vector[23][fi]_LinearInterpolate` which linearly interpolate the position between to points at a certain distance from the starting point

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5784 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-08 15:49:24 +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 81005f3605 Remove the status check for GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT as it was removed from the GL_EXT_framebuffer_object extension and Mac OSX doesn't provide it
Deletion suggested by Buginator. This should fix bug #12136

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5777 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-04 20:58:28 +00:00
Giel van Schijndel 7980737e77 * Use ssprintf instead of snprintf to print into a statically sized string
* Reduce the nesting inside Init_FBO
 * Bail out of Init_FBO as soon as we discovered that FBOs are unavailable

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5771 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-03 22:56:38 +00:00
Giel van Schijndel ef72bf0a43 * "Upgrade" the function comments for NETsendGAMESTRUCT and NETrecvGAMESTRUCT to Doxygen comments
* Restore the empty lines removed in r5732
 * Add a note to GAMESTRUCT containing a list of elements that need to be updated when GAMESTRUCT's definition changes

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5770 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-03 21:34:18 +00:00
Giel van Schijndel 83159f335d Coding style:
* Fix indentation
 * Don't repeat function prototypes in their pre-leading comments
 * "Upgrade" some function comments to Doxygen comments
 * Remove whitespace from the end of lines
 * Reintroduce empty lines removed in r5733

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5769 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-03 21:06:39 +00:00
Buginator 38c54928d3 Delete the FBO (if we are using it) when done with it, and also fix a whitespace issue. :S
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5765 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-03 19:36:02 +00:00
Giel van Schijndel a293a90e76 * Rename audio_Get3DPlayerPos to audio_GetPlayerPos and change it to return a Vector3f instead
* Rename audio_Get3DPlayerRotAboutVerticalAxis to audio_GetPlayerOrientation and change it to return two Vector3f's with a forward and upward pointing vector in it (which can be directly used by OpenAL)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5763 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-03 17:51:43 +00:00
Giel van Schijndel 9b8b577bff * Use deg2radf for degree to radian conversion instead of doing the multiplication ourself
* Use Vector3f_Mult to multiply all members with some number instead of doing it manually

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5762 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-03 17:51:30 +00:00
Giel van Schijndel 4c19888cba * Move the fixed point cruft used for representation of degrees and some matrix math into a seperate header: piefixedpoint.h
* Update the autotools, win32 makefiles, Code::Blocks and MSVC build systems

NOTE: Xcode will need an update for this


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5761 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-03 16:04:41 +00:00
Buginator 8aabfd23b2 If we are going to check for a extension, we should do it correctly.
In this case, check GLEE_EXT_framebuffer_object.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5758 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-03 02:37:02 +00:00
Freddie Witherden 54df5e1b9e Add a special EVT_DESTRUCT event to give event handlers a chance to clean-up/free any resources they have allocated.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5757 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 22:56:14 +00:00
Per Inge Mathisen 9699a5080f Improve logging from assert when number of context variables don't match.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5748 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 20:54:45 +00:00
Per Inge Mathisen 98bd943cc3 patch #1092: Remove some warnings reported by gcc when compiling lib/netplay/netplay.c by Bertrand Coconnier
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5747 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 20:23:37 +00:00
Giel van Schijndel 12612cefc4 Add two new functions:
* Vector3f_ToRadians to convert a rotation vector (Euler angles) from degrees to radians
 * Vector3iPSX_To3fDegree to convert the PSX "wannabe-float" degree vectors into a vector of ''real'' floats, with ''real'' degrees (i.e. 360 is completely round, instead of 65536 representing that)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5745 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 17:48:14 +00:00
Giel van Schijndel 5265103c2d Add two new functions Vector3f_EulerToForwardVector and Vector3f_EulerToUpVector which compute a forward and up vector from a rotation vector in Euler angles (pitch, yaw and roll)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5744 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 17:30:25 +00:00
Freddie Witherden ed5b269cbd Some cosmetic changes to widget.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5740 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 15:47:41 +00:00
Freddie Witherden bfa3f7173c Fix yet another bug in vector.c.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5739 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 15:38:11 +00:00
Freddie Witherden 81ba4bec25 Switch to a floating point co-ordinate system which better reflects the underlying APIs (Cairo and OpenGL).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5736 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 14:47:12 +00:00
Buginator 6ccaa10f16 Enhances 'map preview' screen with map maker's ordering of the players position.
This allows players to get to the correct starting position on the map they picked, much easier.

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

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


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5733 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 04:28:58 +00:00
Buginator 1578d9ade8 *no code changes* Just adding a note to some functions that can use the master server to transfer the data to/from.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5732 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-02 03:58:26 +00:00
Freddie Witherden 977bc5e327 Add support for showing and hiding widgets; update how events are handled when a widget is hidden or disabled.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5731 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-01 21:24:19 +00:00
Freddie Witherden f7f5d309a7 Move the glTranslatef calls in the widgetCompositeImpl function to outside of the for loop,
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5729 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-01 18:55:42 +00:00
Freddie Witherden 2c20b8e0e7 Fix a minor indentation issue in widget.c
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5727 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-01 17:51:07 +00:00
Freddie Witherden b45fad3ee0 Update the documentation for vector.h and fix a bug in vector.c.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5723 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-01 12:02:18 +00:00
Freddie Witherden 415f4555dc Remove some empty doc-blocks from betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5722 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-01 11:31:12 +00:00
Freddie Witherden b854f5bcb0 Remove some dodgy forward declarations from betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5721 4a71c877-e1ca-e34f-864e-861f7616d084
2008-08-01 09:15:43 +00:00
Freddie Witherden 7aef59ad0d Allow Betawidget to compile under OS X (OpenGL header location is different).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5720 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-31 19:30:36 +00:00
Freddie Witherden 30b0cfac27 Update the documentation for vectorCreate.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5719 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-31 18:39:59 +00:00
Giel van Schijndel b2e83cabc1 Add some ASSERTs to check for dodgy pointers
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5715 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-30 20:42:02 +00:00
Giel van Schijndel 11cd7ac69f Fix the MSVC project for compiling lib/exceptionhandler
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5712 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-29 21:27:17 +00:00
Giel van Schijndel 231866a510 Allow compiling with Flex < 2.5.9, r5679 and patch #1089 broke this
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5692 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-28 13:34:00 +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
Roman C f1c2eacb00 Fix release build on MSVC. Patch by Buginator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5676 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 20:41:16 +00:00
Roman C a412bf4b17 An attempt to fix "interpRunScript: max instruction count exceeded - infinite loop ?" error.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5669 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 11:28:54 +00:00
Giel van Schijndel 0340c2d9c3 Make it possible for the ST_GROUP loading code in function scrValDefLoad to accept higher savegame event data versions than 3
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5668 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-26 00:55:23 +00:00
Giel van Schijndel f2bc3c056f Change the debug message about a string that couldn't be found from an error message into a warning message because it seems to occur quite often
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5667 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-25 22:14:47 +00:00
Giel van Schijndel b40e7a6a90 Further hardcode the treap management code to the string resource system:
* Don't maintain a secondary linked list of strings in strres.c
 * Add the string that's tracked and it's ID number to the TREAP_NODE structure
 * Let the treap code manage its own memory
 * Have the treap code perform reverse lookups using either the resource string (i.e. not the "key" string) or associated ID number

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

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

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5647 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-23 13:59:12 +00:00
Giel van Schijndel cf374ee5e1 * Move the definitions of the datatypes used by the string resource system from strres.h to strres.c
* Add a forward declaration for STR_RES to strres.h (so that we can still declare pointers to this type)

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

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5644 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-22 22:33:10 +00:00
Giel van Schijndel 4f3c6d39a4 * Return the resulting STR_BLOCK* from strresAllocBlock and return NULL on failure
* Use calloc instead of a malloc followed by memset(0)
 * Check the return value from malloc&calloc for ''all'' invocations of it

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

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5641 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-22 20:23:24 +00:00
Giel van Schijndel 38f5b64c91 Add a new command line option: --flush-debug-stderr which causes the debug output to be flushed when used
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5636 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-21 19:49:36 +00:00
Giel van Schijndel 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 1feee6ea95 Replace uses of "\n" and std::endl with uses of constant `endl`, which is defined to the platform's native line ending.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5620 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 22:46:50 +00:00
Giel van Schijndel d451b3f5a1 Remove the terminating newline ('\n') from ctime's output to allow different newline styles (e.g. "\r\n" on Windows)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5619 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 22:46:46 +00:00
Giel van Schijndel e029c11bb4 In the MinGW stack dumper, use dbgDumpHeader to dump a generic debug info header, instead of custom crafted (and duplicated) code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5618 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 22:46:26 +00:00
Giel van Schijndel 461c6f1002 Don't #include debug.h as we depend on dumpinfo.h instead (thus #include that file instead)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5612 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-20 15:27:17 +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
Freddie Witherden 4c2fedaff6 Save the current state of the cairo context before drawing and restore once finished.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5588 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 19:34:51 +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 34b73dcdb5 Invert logically wrong assertion (i.e. assert a pointer to be non-null rather than null)
This fixes bug #12047 (assert failure as soon as you open one of the design/manufacture/construct/research windows)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5583 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-19 14:28:36 +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
Freddie Witherden 36a4191818 Switch to an OpenGL compositing mode; some clean-up still required.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5578 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-18 22:21:54 +00:00
Giel van Schijndel 5554dbe695 * Move duplicated code to fetch a tabbed widget form by ID to a function of its own: widgGetTabbedFormById
* In widgSetTabs depend on functions widgGetNumTabMajor and widgGetNumTabMinor respectively instead of duplicating their code


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5573 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-18 15:17:29 +00:00
Freddie Witherden 5bb3421545 Prototype and document widgetAddTimerEventHandler.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5572 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-18 12:10:47 +00:00
Freddie Witherden 7458d5b499 Fix some more compiler warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5571 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-16 21:19:33 +00:00
Freddie Witherden 2f254ade34 Make sure variables are defined before anything else.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5570 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-16 19:14:35 +00:00
Per Inge Mathisen 94aca87927 Fix bug #12016: radar is broker on trunk, reported by Michael Strobel. We now
use the texture rectangle extension to draw the radar window, which should be
supported on even the oldest OpenGL-capable hardware out there.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5562 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-15 20:06:09 +00:00
Giel van Schijndel ac5c52031b Get rid of unnecessary assignment of `volume` to `music_volume`; just utilize clipf right away on `volume`
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5559 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-15 13:01:22 +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
Freddie Witherden b48b8058e8 Add support for timer events and fix a bug in event id generation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5557 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-15 10:12:03 +00:00
Freddie Witherden 355d0c0760 Make it so that the event-removal system in betawidget actually works.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5555 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 23:41:53 +00:00
Freddie Witherden 86dd924881 Minor cosmetic improvements to betawidget.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5554 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 23:19:51 +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
Freddie Witherden fede6c6e51 Fix a bug in vectorAt which could cause a segfault; add vectorHead which returns the last element added to the vector.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5552 4a71c877-e1ca-e34f-864e-861f7616d084
2008-07-14 23:08:37 +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