* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
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
* 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
* 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
* 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
* 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
* 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
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
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
- 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
* 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
* "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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* 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
* Utilise this new version of YY_INPUT in script_parser and script_lexer
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5008 4a71c877-e1ca-e34f-864e-861f7616d084
WZ_DECL_RESTRICT now works on MSVC as well.
WZ_DECL_THREAD added, declares variables thread local, support for it made mandatory.
WZ_ASSERT_STATIC_STRING (gcc only) to assert that a string is static added.
The sstr functions now support pointer-length strings again.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4908 4a71c877-e1ca-e34f-864e-861f7616d084