* Finish r3795 where I nicely #included the correct files but forgot to replace strnlen with strnlen1 - 1
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3805 4a71c877-e1ca-e34f-864e-861f7616d084
This way we get to see the message given by asserts in the dump file.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3781 4a71c877-e1ca-e34f-864e-861f7616d084
This saves the trouble of having to edit the paths for lib/include dirs and enables us to have the FlexBison.rules there, too.
Thus FlexBison.rules is removed and to be found in the msvc devpkg from now on.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3657 4a71c877-e1ca-e34f-864e-861f7616d084
Additionaly:
- Introduce ARRAY_SIZE macro
- Use code_part instead of int where applicable
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3539 4a71c877-e1ca-e34f-864e-861f7616d084
- tagGetErrorString is not provided anymore, all output goes directly to LOG_ERROR.
- The trace contains some more information.
- ASSERT()s in the unit test were removed. The output is already done by TF_ERROR where needed.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3531 4a71c877-e1ca-e34f-864e-861f7616d084
Use that to cleanup some code.
Because of the lack of a local "math.h", it went into trig.h.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3483 4a71c877-e1ca-e34f-864e-861f7616d084
* if not #error about requiring a C99-compliant snprintf & vsnprintf implementation
NOTE: This doesn't affect MSVC as I've already provided a C99-compliant implementation for it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3449 4a71c877-e1ca-e34f-864e-861f7616d084
* #define snprintf and vsnprintf to wz_snprintf and wz_vsnprintf respectively
Thanks to Buginator for pointing out the issue in patch #937; the solution is different than his though
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3447 4a71c877-e1ca-e34f-864e-861f7616d084
Debugging info given with it will only be displayed for the enabled game object. Default key
to enable debugging info for a game object is CTRL+L. Converted LOG_MOVEMENT to use it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3432 4a71c877-e1ca-e34f-864e-861f7616d084
* Parameter descriptions for non-existing parameters removed
* Wrong parameter names renamed/fixed
* Syntax errors in passing the a parameter to a Doxygen command at the wrong location
* Prevent HTML interpretation of some comments
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3373 4a71c877-e1ca-e34f-864e-861f7616d084
* Use slcatprintf instead of snprintf into a local buffer (on the stack) followed by concatenating to our target string
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3345 4a71c877-e1ca-e34f-864e-861f7616d084
whose return must be checked, and fix one bug already detected by it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3260 4a71c877-e1ca-e34f-864e-861f7616d084
error reporting for user errors when they forget to update definition file.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3229 4a71c877-e1ca-e34f-864e-861f7616d084
to expand to ((void) (x)) on little-endian systems, so that the compiler
will catch little-endian developers who forget to update the endian_*()
calls when they change the names of structure fields.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3205 4a71c877-e1ca-e34f-864e-861f7616d084
length, allocates a memory buffer for it, and returns it. Not recommended for
general usage.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3193 4a71c877-e1ca-e34f-864e-861f7616d084
* ROUND: replace by a static inline function (math_round) instead
* FRACTCONST: this macro just cast both of its arguments to float and then divide the first by the second
* MAKEFRACT_D: this macro would cast to FRACT_D (which was typedef'd as float but should have been typedef'd as double); so cast to double instead (where required)
* FRACTmul_D: would cast both of its arguments to FRACT_D and multiply them
* FRACTdiv_D: would cast both of its arguments to FRACT_D and divide the first by the second
* MAKEINT & MAKEINT_D (where #defined the same); this macro would just cast to SDWORD (aka "int" or "signed int")
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3152 4a71c877-e1ca-e34f-864e-861f7616d084
* This enables GCC to check the formatting strings and the types and number of the variable list of arguments passed
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3087 4a71c877-e1ca-e34f-864e-861f7616d084
* Look at sound_StopSample specifically
* Use a function to manipulate the linked list of audio samples (i.e. get rid of duplicated code)
* Allow printing of OpenAL vendor, version, renderer and extensions data on multiple debug "channels" to reduce code duplication
* Add openal_error.[ch] for error detection (and producing debug messages for them!)
* Add TOSTRING and AT_MACRO macros to macros.h
* Get rid of some super-nested if-branches where one of them would return (so we don't actually need an else-branch because the function is left anyway)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3047 4a71c877-e1ca-e34f-864e-861f7616d084
PACKAGE_MAINTAINER and PACKAGE_VERSION should probably also make their way into the logfile...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3040 4a71c877-e1ca-e34f-864e-861f7616d084
* Turn some signed integers ("int" or "SDWORD") into unsigned integers where it made more sence (and signed integers caused warnings about comparing signed with unsigned integers)
* At some places cast to an unsigned integer (where the type of the expression is a signed integer but the result of it logically _always_ is an absolute value)
* Remove unused struct-type EVENT_INIT
* Convert use of malloc->memcpy->free to one single realloc call (and now make sure to actually check realloc's return value, which wasn't done with the malloc call)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3037 4a71c877-e1ca-e34f-864e-861f7616d084
* Assign the resulting pointer to the char** strp pointer
* Return zero (instead of the pointer)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2948 4a71c877-e1ca-e34f-864e-861f7616d084
* make sure to #define _GNU_SOURCE when compiling on Unix systems with Code::Blocks
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2845 4a71c877-e1ca-e34f-864e-861f7616d084
* Add a large quantity of debug() calls to game.c
* Correct some spelling errors in comments
Part of patch #853 by Buginator
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2826 4a71c877-e1ca-e34f-864e-861f7616d084
cost of even less sanity for whichever poor soul who reads this code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2816 4a71c877-e1ca-e34f-864e-861f7616d084
* Add some comments to sasprintf
* Utilize sasprintf and asprintf in src/version.c to drastically cut back in code size and duplication
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2806 4a71c877-e1ca-e34f-864e-861f7616d084
* These functions comply to the C99 specification and return the amount of characters they would have written if no truncation occurred
Slightly modified form of patch file #3146 attached to bug #10269 by Buginator; applied the changes of this patch to wzglobal.h instead of version.c
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2742 4a71c877-e1ca-e34f-864e-861f7616d084
* Replace (the last) strncpy() call in nettyps.c with a strlcpy() call
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2647 4a71c877-e1ca-e34f-864e-861f7616d084
* Fix an error in src/game.c where we would use the wrong size as parameter to strlcpy()
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2640 4a71c877-e1ca-e34f-864e-861f7616d084
* Document the "fileName" parameter of makeLocaleFile in the Doxygen comment
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2639 4a71c877-e1ca-e34f-864e-861f7616d084
* Get rid of several magic numbers
* Some const correctness
* Replace a huge amount of strcpy(), strcat(), strncpy() and strncat() calls with a strlcpy() and strlcat() calls respectively
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2635 4a71c877-e1ca-e34f-864e-861f7616d084
* Refactor NETlogEntry() to use the array of strings (packetname[]) instead of a large switch-statement with a lot of copy & pasted code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2617 4a71c877-e1ca-e34f-864e-861f7616d084
* Don't perform assertions on the content of uninitialized memory, it's useless and annoying when they fail
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2615 4a71c877-e1ca-e34f-864e-861f7616d084
* In this bug-report calling free() twice (once on psRes->aID then on psRes) was proposed
* Instead just ''over allocate'' the memory for psRes so that a single free() call on psRes will suffice
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2614 4a71c877-e1ca-e34f-864e-861f7616d084
unit tests. First sketch of new defined savegame format in tagfile_map.def.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2586 4a71c877-e1ca-e34f-864e-861f7616d084
- Less strict warnings in debug-mode (still unusable, because ICC warns about _a lot_)
- Explicit conversions
- Clarify parameter evaluation order
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2550 4a71c877-e1ca-e34f-864e-861f7616d084
* This commit removes utf8.[ch] from all build systems (manual text-editing for the most of them)
* For the removal from the XCode project I just reverted r2288
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2477 4a71c877-e1ca-e34f-864e-861f7616d084
- adding *.tab.c to BUILD_SOURCES and CLEANFILES before *.tab.h in applicable Makefile.am files causes *.tab.c to be the file that triggers the %.tab.h %.tab.c: %.y rule, resulting in the command run being "bison -y -d -o[...].tab.c [...].y", not "bison -y -d -o[...].tab.h [...].y", which (aside from being correct syntax Wink ) stops "warning: conflicting outputs to file `[...].tab.h'"
- chat_parser.y had %token _T_A declared twice, second instance removed
- audp_parser.y had trailing | signs (presumably from when NULL wasn't commented out)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2426 4a71c877-e1ca-e34f-864e-861f7616d084
- Use WZ_CC_GNU_PREREQ (copied from glibc's features.h) instead of custom code
- Move platform.h into wzglobal.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2424 4a71c877-e1ca-e34f-864e-861f7616d084
* Add an explanation about floats (that they're basically the same as 32bit integers as far as endianness conversions are concerned)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2379 4a71c877-e1ca-e34f-864e-861f7616d084
* Don't write directly from the memory of the EFFECTs (since this memory doesn't always have the same size on 32vs64bit systems)
* Guarantee to always write the IMD's hash number as if it's a uint32_t (this fixes 64bit compatibility of these functions)
* Add functions openLoadFile and openSaveFile which perform the file opening for loadFile2 and saveFile and now readFXData and writeFXData as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2378 4a71c877-e1ca-e34f-864e-861f7616d084
* Modify them slighly to use get/set functions for the package direction (instead of a global accessable to all files which forward declare it)
* Add a NETfloat to the set of primitives
* Modify NETstring to use strnlen1 instead of strnlen which is a GNU extension to the C library (strnlen1 has been copied from gettext 0.16.1 which is GPLv2+)
NB: rerun your buildsystems
NB2: Xcode requires an update
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2358 4a71c877-e1ca-e34f-864e-861f7616d084
Makes doubleclick state a condition for mousePressed, so that widget
can recognize the 'down' state in a double click state correctly.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2325 4a71c877-e1ca-e34f-864e-861f7616d084
* Fix macro ASSERT_START_OCTET (I used a logical and there instead of logical or)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2296 4a71c877-e1ca-e34f-864e-861f7616d084
* This way it should be easy to change the type of utf_32_char if ever needed (currently it is uint_fast32_t)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2284 4a71c877-e1ca-e34f-864e-861f7616d084
* Add files lib/framework/utf8.[ch] to autoconf/automake, raw makefiles, Code::Blocks and MSVC
NOTE: this may require updating of some additionaly buildsystems (e.g. OSX)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2281 4a71c877-e1ca-e34f-864e-861f7616d084
This patch fixes the following tempting features: ;)
1. Doubleclick to select all droids of the same template.
2. Doubleclick construct droid to open up build menu.
3. Double pressing numeric keys '1,2,3,4,5,6,7,8,9' to center view/align camera to the group 1-9 you assigned.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2242 4a71c877-e1ca-e34f-864e-861f7616d084
Reuse FILE_LOAD_BUFFER_SIZE macro, which was abandoned before. (That's also why fileLoadBuffer is now defined in src/init.c, even though the place is probably inappropriate.)
Make fileLoadBuffer static instead of malloced.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1992 4a71c877-e1ca-e34f-864e-861f7616d084
- Add some debug output (which will never get shown, since we setup the crashhandler before the debughandler).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1968 4a71c877-e1ca-e34f-864e-861f7616d084
* Mark some global pointers/vars for static linkage (the less global, and more local they are, the better!)
* Add include guards to some files
* Some code cleanup: braces on their own line
* loadFile2 now doesn't free memory it didn't allocate itself anymore
* Use decent assertion expressions for some asserts (e.g. !"string", so that debuggers actually display something more interesting than 'FALSE')
* Don't assert(pointed_to_data != 0xdddddddd) since that method of detecting usage of dangling pointers only works with MSVC, while MSVC's free() probably (i.e. if it is sane) implementation does this check itself already
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1855 4a71c877-e1ca-e34f-864e-861f7616d084
* Create a dedicated function for conversion of ASCII characters into upper case: upcaseASCII
* Make HashStringIgnoreCase use upcaseASCII instead of an ugly bitmask hack which won't even work as expected on all strings!!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1830 4a71c877-e1ca-e34f-864e-861f7616d084
* To make sure we still have the guarantee that a char is 8bit I've inserted a static assertion for this (CHAR_BIT == 8)
* Use exact length types for lobbyserver
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1821 4a71c877-e1ca-e34f-864e-861f7616d084
That is:
* Don't use a custom memory heap implementation anymore
* Remove all usages of HEAP code and replace it with malloc/free
NOTE: MacOSX projectfile probably requires an update
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1820 4a71c877-e1ca-e34f-864e-861f7616d084
* Use decent assertion expressions for some asserts (e.g. !"string", so that debuggers actually display something more interesting than 'FALSE')
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1815 4a71c877-e1ca-e34f-864e-861f7616d084
- POINT -> Vector2i
- changed internalformat = getPixelFormat() to GL_RGBA in one place
- removed unused variables/functions
- proper intialisation
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1792 4a71c877-e1ca-e34f-864e-861f7616d084
Also rename "count" to "i", since it really only is a loop iterator.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1769 4a71c877-e1ca-e34f-864e-861f7616d084
- Tune lighting and enable by default (This doesn't seem to affect the terrain)
- Declaration updates (Trolltech says that attributes need to go after the "static inline", the GCC manual is a bit unspecific about this)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1744 4a71c877-e1ca-e34f-864e-861f7616d084
NOTE: MSVC users don't get scared since SDL defines the C99 types for MSVC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1671 4a71c877-e1ca-e34f-864e-861f7616d084
r1638. Exception handler still removed if WZ_OS_MAC is set.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1640 4a71c877-e1ca-e34f-864e-861f7616d084
- WZ_OS_MAC && DEBUG implies --debug all so that Console.app can be used
to view debugging output on debug builds when launching from Finder
- DEBUG flag re-added to Debug builds in Xcode project; was removed
accidentally at some point
- WZ_OS_MAC no longer implies WZ_OS_UNIX; handled separately where
necessary
- Do not use Warzone's crash handler since Mac OS X provides a good
crash reporter already that just saves the crash log, with lots of
useful information, to ~/Library/Logs/CrashReporter/Warzone.crash.log
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1635 4a71c877-e1ca-e34f-864e-861f7616d084
- Move wzFPSmanager over to main.c, so the delay can be dealt with directly in the mainloop instead of the detour through frameUpdate
- Adding the functions directly to main.c is probably not the wisest idea, but may be fixed later
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1623 4a71c877-e1ca-e34f-864e-861f7616d084
- Split the mainloop into several (run) subfunctions
- start/stop functions for (de)initialization. This replaces the !Restart part
- removed necessity of several variables
- This is the last step before the event based mainloop
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1622 4a71c877-e1ca-e34f-864e-861f7616d084
* When receiving an SDL_ACTIVEEVENT also check for SDL_APPMOUSEFOCUS, but don't loose focus because of it, only gain focus when receiving this
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1605 4a71c877-e1ca-e34f-864e-861f7616d084
defined in <sys/signal.h> for _POSIX_C_SOURCE or _ANSI_SOURCE.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1599 4a71c877-e1ca-e34f-864e-861f7616d084
- Removed a 20ms delay from the mainloop
- Added ASSERT_STATIC macro to check assumptions on compiletime
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1582 4a71c877-e1ca-e34f-864e-861f7616d084
more. Remove unused GetLastHashName() and SetLastHashName().
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1544 4a71c877-e1ca-e34f-864e-861f7616d084
- Make trigonometry tables static and remove usage of FRACT macros (trig.c)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1542 4a71c877-e1ca-e34f-864e-861f7616d084
This patch will create crashes where the code expects FREE to set the pointer to NULL! (Those problems should be fixed anyway.)
The only occassion where I saw this is when quiting a game, so it is not too much of an issue.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1459 4a71c877-e1ca-e34f-864e-861f7616d084
* remove ptrlist.c from lib/gamelib/Makefile.raw
* some modifications of char* -> const char*
* modify typedef of audio callback function to take a parameter of `void *psObj` rather than `AUDIO_SAMPLE *psSample` to minimize exposure (psSample->psObj was the only thing used by all callback functions anyway)
* modify all callback functions to match the new typedef's signature
* modify all functions calling callbacks to match the new signature (I think I've got them all, but since passing a pointer to a void* parameter doesn't generate any compiler errors/warnings I might have missed one, which would lead to undefined behaviour)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1442 4a71c877-e1ca-e34f-864e-861f7616d084
- Remove "-%token <sval> TEXT" from audp_parser.y since it clashed with declarations in MinGW's Windows headers. It does still compile and run, but this may have harmed something anyway. Please check!
- Hack around DATADIR being defined by objbase.h in MinGW by undefining it before the inclusion of shlobj.h (incl. in main.c) This only works since the case that DATADIR is actually used on Windows is extremely rare.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1437 4a71c877-e1ca-e34f-864e-861f7616d084
* since gettext_noop is always defined, remove the conditional definition of N_ which checks whether it is or is not defined
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1420 4a71c877-e1ca-e34f-864e-861f7616d084
_GNU_SOURCE can take effect first, to silence stpcpy() warnings from
bison generated code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1416 4a71c877-e1ca-e34f-864e-861f7616d084
* use it in src/droid.c
* throw some hardcoded strings (in a switch statement) in an array of strings instead (using N_ there as well)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1414 4a71c877-e1ca-e34f-864e-861f7616d084
* use proper constness:
* make some functions take arguments of `const char*` rather than just `char*` (also modified some functions' return values to return `const char*` where appropiate)
* modify rank retrieval functions to use a central array instead; currently ranklimits (i.e. the amount of kills required to promote) is hardcoded in switch statements, as is the case with the names of those ranks
* `make -C po update-po`
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1409 4a71c877-e1ca-e34f-864e-861f7616d084
* turn a one-statement function into an inline (resDoResLoadCallback)
* revive resource loading from file (the function pointer for this was removed in r1394, to actually use this pointer new code had to be written)
* modify resDataInit to handle memory allocation as well as data initialization
* modify struct RES_DATA to not have a fixed size char array to contain the filename (is now dynamically allocated together with the rest of the struct, see resDataInit)
* modify some argument lists to take `const char*` instead of `char*`
* change resLoadFile to use RES_TYPE.fileLoad if available, also remove an unused if statement (well actually the condition could never be false)
* resource type "WAV" (see data.c) now directly loads from a file (rather than copying the file entirely into memory and then to operate on that)
* fix sound_ConstructTrack (track.c) where I used the wrong source to copy the filename from
* fix sound_LoadTrackFromBuffer (track.c) to *not* add the track to the tracklist because this breaks other code
* modify sound_ReleaseTrack (track.c) to gracefully deal with NULL pointers
* remove dataAudioRelease (data.c) and instead just use sound_ReleaseTrack
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1397 4a71c877-e1ca-e34f-864e-861f7616d084
* remove function resAddFileLoad from lib/framework/frameresource.[ch] which was used to set RES_TYPE.fileLoad
* remove only call to resAddFileLoad from src/data.c, function dataInitLoadFuncs
* remove now completely unused function dataSaveGameLoad from src/data.c
* modify function dataInitLoadFuncs in src/data.c:
* modify the struct definition for the list of resource types
* modify the list accordingly
* remove the NULL-item from the end of the list
* modify list iteration code to use a start and end iterator (end being a pointer just past the last valid list-item, begin being the first valid one)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1394 4a71c877-e1ca-e34f-864e-861f7616d084
variables. 4. Commented out some unused sound code.
I just love Valgrind :)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1390 4a71c877-e1ca-e34f-864e-861f7616d084
Remove all callers (which all were commented out)
The 'real' font implementation used lives in ivis_
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1357 4a71c877-e1ca-e34f-864e-861f7616d084
* replace all instances of PTRVALID(ptr,size) by (ptr != NULL)
* remove asserts of style ASSERT( x == NULL || x != NULL ) because they would evaluate to true always anyhow and as such wouldn't ever trigger
* remove macros iV_HeapAlloc and iV_HeapFree and replaced them with MALLOC and FREE respectively (that's what they expanded to anyway)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1348 4a71c877-e1ca-e34f-864e-861f7616d084
The MSVC poject will need to be updated I guess, as some files were deleted.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1343 4a71c877-e1ca-e34f-864e-861f7616d084
- Remove unneeded checks from autogen.sh (all of them are also checked in configure.ac)
- Move AM_CPPFLAGS=-$(top_srcdir), which was included in nearly every Makefile, to configure.ac
- Remove -g from CFLAGS for usual builds. This should be set by the buildscripts instead
- Remove CFLAGS_OVERRIDE, which was rendered obsolete by the above change
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1332 4a71c877-e1ca-e34f-864e-861f7616d084
string, but does not use hashes. I could not see that it is ever used,
but it must be wrong, so fixing it anyway. Adding the first case of
gettext markup in the code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1248 4a71c877-e1ca-e34f-864e-861f7616d084
- Vector3i from lib/ivis also used in lib/audio, maybe want to move it to some more generic place?
- Replace iPoint with Vector2i
- Remove additional integer type declarations from pietypes.h
- Rename all iSprite to iTexture
- Various warning fixes: Unsigned/signed comparisons, uninitialized variables, declared but not defined symbols
- Replace DEBUG_BLOCK with DEBUG_MALLOC (it was virtually the same)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1245 4a71c877-e1ca-e34f-864e-861f7616d084
- Examine si_code where non default (SI_*) value are possible
- Output signal in style: "SIGNAL: Problem: Reason"
- Handle more signals (all which are marked "A - Abnormal termination of the process" by the POSIX manual)
- Check for XSI extension (_XOPEN_UNIX) instead of presence of every single signal. Hope this works on all systems
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1226 4a71c877-e1ca-e34f-864e-861f7616d084
- Added a bit more safety to WZ_DECL_UNUSED (not sure since which GCC version this exists, so choose >=3.2)
- Encapsulate GLibC extensions and use rest of errorHandler for all POSIX systems (thus renamed to posixErrorHandler)
- A little bit more verbosity in the gdmp
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1222 4a71c877-e1ca-e34f-864e-861f7616d084
- Move programCommand into the Linux section as it is not needed on Windows
- Add some comments
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1206 4a71c877-e1ca-e34f-864e-861f7616d084
- Don't call GDB if not available
- Use fork/pipe/exec properly (subprocess ends after exec, so don't call other functions after it, close files correctly)
- sizeof(char) is guaranteed to be 1 by C
- Use execve instead of execle, because execle might perhaps cause problems
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1205 4a71c877-e1ca-e34f-864e-861f7616d084
definition on all platforms by using a switch and some ifdefs.
Looks ugly but should be safer.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1204 4a71c877-e1ca-e34f-864e-861f7616d084
Additional to the useless GLibC backtrace also try to attach GDB to the process and dump a backtrace.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1196 4a71c877-e1ca-e34f-864e-861f7616d084
- Handle OS differences better
- Clarify which headers in the Linux handler belong to which standards
- Use GNU backtrace() libc-extension only on Linux
- programVersion -> VERSION on Windows
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1194 4a71c877-e1ca-e34f-864e-861f7616d084
It uses strlen(), which is not required to be signal safe, but I can't imagine it to be not reentrant and suffering from heap/stack corruption...
It uses strsignal(), which is a GNU extension. strsignal is implemented using the signum as an index into an array of signal descriptions, which should be easily cloneable for non GNU systems if needed.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1190 4a71c877-e1ca-e34f-864e-861f7616d084
- Reorder read_gdmp output
- Added compilation date to gdmp
- Reordered gdmp values: sysInfo now after programVersion/compileDate instead of before, to match read_gdmp display order
Still not implemented: Custom (signal safe) sprintf replacement, so we can output textfiles instead of binary blobs.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1189 4a71c877-e1ca-e34f-864e-861f7616d084
yes (as before), relaxed (-O2 & -Wextra), and no
(as before). Fix two more reported warnings.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1151 4a71c877-e1ca-e34f-864e-861f7616d084
for compilers other than gcc. Thanks to devurandom for bringing
this problem to my attention. Also update documentation for
WZ_DECL_DEPRECATED, which had bitrotted.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1149 4a71c877-e1ca-e34f-864e-861f7616d084
debug builds. Hopefully this will not cause too much pain, but
rather increase code quality for the future.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1144 4a71c877-e1ca-e34f-864e-861f7616d084
C macro M_PI (if available, or we will define it on our own in fractions.h).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1033 4a71c877-e1ca-e34f-864e-861f7616d084
The include changes might break other buildsystem, I'll fix that when I am back on Linux.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@983 4a71c877-e1ca-e34f-864e-861f7616d084
* moved several #defines to the enums where they belong
* changed some datatypes on declaration
* prepended casts to malloc calls (using typeof() style)
* changed some (void*) casts to (void**) where required
* removed several #defines and there instances and then replaced them with their corresponding values from an enum
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@969 4a71c877-e1ca-e34f-864e-861f7616d084
- removed these functions and all calls to it if REALLY_DEBUG_MALLOC isn't defined, because they don't do anything currently when REALLY_DEBUG_MALLOC isn't defined
- moved the declaration of memRecReport from memint.h to mem.h where it is, together with memMemoryReport, optionally declared depending on REALLY_DEBUG_MALLOC
* fixed yet another set of signed/unsigned errors (src/seqdisp.c & textdraw.c/h)
* removed a cast from char* to char* (that's what I call unnecessary; transforming something into something it already is)
* memory system:
- added some comments to clarify what certain pieces of code actually do
- removed some redundant code (e.g. why would you ever want to overwrite memory to zero just before passing it to free()?)
- made debug-version of free() return immediately when being passed a NULL pointer (i.e. after raising an assert)
- moved some variable declarations down to the first point of usage
- *IMPORTANT*: commented the definition of MEMORY_SET out (line 38 mem.c), this might break code that expects freshly malloc'ed memory to be pre-initialized, if you experience any problems due to commenting this out please say so on the mailinglists!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@957 4a71c877-e1ca-e34f-864e-861f7616d084
* remove some unused things: variables, macros (MEMORYREPORT, MEMORYTREAP)
* fix some signing errors:
* change assignments of/comparisons with -1 to unsigned variables ((-1) directly, not through a preprocessor directive) to ~0 (left OpenAL-code alone)
* remove some casts to (SDWORD) in comparisons which actually cause signed/unsigned errors rather than fix them
* redefine some vars as unsigned
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@955 4a71c877-e1ca-e34f-864e-861f7616d084
Changes several DBPx macros to debug() calls and:
I introduced 2 new categories: LOG_MOVEMENT and LOG_ATTACK
and what didn't fit in was set to LOG_NEVER.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@876 4a71c877-e1ca-e34f-864e-861f7616d084
-compiler and parts of interpreter now use union to store different data types
-got rid of a great deal of pointer->integer casts
-ASSERT() now outputs last event (or function) called by scripts
-implemented float data type support for the scripting engine - basic functionality at the moment
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@846 4a71c877-e1ca-e34f-864e-861f7616d084
- *WarzoneKeyNumeric definition changed to SDWORD
- Report wrong tracknumbers to LOG_SOUND and don't crash in sound_Play*DTrack
- Correct --help text
- Make console backlog key configurable
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@810 4a71c877-e1ca-e34f-864e-861f7616d084
- Remove lots of unused functions (Windows/DDraw related)
- Now store the used bitdepth in the config and thus make it configurable without having to modify the sourcecode
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@808 4a71c877-e1ca-e34f-864e-861f7616d084
-fixed line endings in macro.h
-applied Christian Ohm's "032 - Fixes for src-aiexperience.c-h" and "037 - g++ fix" patches
-made warzone report loading of all *.lev files
Scripting:
-fixed implicit bool/int to string convertion for the scripting language
-STRUCTURESTAT can now be checked for being 0 with NULLSTRUCTURESTAT
-minor scripting function fixes
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@794 4a71c877-e1ca-e34f-864e-861f7616d084
-It is now possible to win in a team in 'Locked Alliances' mode, also in this mode a player doesn't lose until all of his team members were defeated
-Game now shows a text message when player has won/lost the game (just a temporary solution to bug #7317)
-Added extra heap debug, should be there at least until we fix bug #6530, as PTRVALID() doesn't seem to detect corrupted DROID pointers on win
-Increased number of iterations A* is allowed to do per frame, which will hopefully speed up pathfinding
-Fixed multiplayer menu slider bug (bug #6529)
-Fixed players not forwarding enemy units visibility to their allies in 'TEAMPLAY' and 'Locked Alliances' modes
-Further scripting engine improvements
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@780 4a71c877-e1ca-e34f-864e-861f7616d084
- Because savegame filenames are converted to lowercase old savegames won't work anymore. You can simply fix that by renaming them to lowercase.
- All unix_path, unix_fopen and PHYSFSEXT_locateCorectCase functions and calls to them have been removed. (So you _will_ notice when a file is not found, at least on Unix systems.)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@776 4a71c877-e1ca-e34f-864e-861f7616d084
The whole system has to be tuned further but this shows the direction.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@762 4a71c877-e1ca-e34f-864e-861f7616d084
- Define WORD and BYTE types to SDL types
- Let SDL handle some more of the win32fixes
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@739 4a71c877-e1ca-e34f-864e-861f7616d084
Mainly explicit casts, some type changes, a few fixes.
We need to have a look if this line creates any problems:
lib/script/interp.c @@ -329,7 +329,7 @@
- if(!RetStackRemember(CurEvent, (ip + 2))) //Remember where to jump back later
+ if(!RetStackRemember(CurEvent, *(ip + 2))) //Remember where to jump back later
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@719 4a71c877-e1ca-e34f-864e-861f7616d084
Patch marks several read-only function parameters and datastructures as such by adding const.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@709 4a71c877-e1ca-e34f-864e-861f7616d084
- Replace every occurence of VOID with void (and LPVOID with void*)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@703 4a71c877-e1ca-e34f-864e-861f7616d084
- Don't declare stdint declarations which are allready declared in SDL_config
- Change only use of stdint type to use SDL type instead
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@700 4a71c877-e1ca-e34f-864e-861f7616d084
netplay.c got a bunch of new LOG_NET debug()s whose effects on performance have not been tested
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@619 4a71c877-e1ca-e34f-864e-861f7616d084
- Make MinGW actually compile (it defines __MINGW32__ and not __MINGW__)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@614 4a71c877-e1ca-e34f-864e-861f7616d084
- Simplify definition of ASSERT(). Now is the same for GCC and MSVC.
This may not work on versions older than MSVC 2005. If you experience this, please report it!
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@613 4a71c877-e1ca-e34f-864e-861f7616d084
frame.h: Sync MAX_PATH with windef.h and require IE5 for SHGetFolderPath
types.h: Use stdint.h on MinGW and use __int* types on MSVC
lib/netplay/: Remove empty files
main.c: Use "Documents and Settings\Username\My Documents\Warzone 2.0" (in local lang) as writedir on Windows
Fix double definitions in last commit.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@612 4a71c877-e1ca-e34f-864e-861f7616d084
You can now register any callback function to the debug facility.
You will then recieve every preprocessed debug string for which part debugging was enabled.
Offers the possibility to output debugging info to any medium you can think of.
See debug_callback_stderr and debug_callback_file* for an example.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@604 4a71c877-e1ca-e34f-864e-861f7616d084
I am afraid that I reverted the changes made by Per. Will try to recover them tomorrow.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@590 4a71c877-e1ca-e34f-864e-861f7616d084
some things on platforms where 'just char' means unsigned char. Fix lots of
new signedness warnings resulting from that fix (which would have cropped
up on unsigned char platforms anyway). Also implement a small subset of
stdint.h for windows platform in frame.h, hope this does not create any
conflicts. This allows us to use types like uint64_t where relevant.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@569 4a71c877-e1ca-e34f-864e-861f7616d084
more than half the warnings on gcc4, and makes sure we do not
get signedness problems between platforms where char is defined
with different signedness. Also set line-ending properites for
some bison/flex files that did not have it set.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@563 4a71c877-e1ca-e34f-864e-861f7616d084
-added simple function support
Limitations:
-void return type only
-no arguments support
Example:
function void myFunc() {<code>}
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@557 4a71c877-e1ca-e34f-864e-861f7616d084
- block.c: Fix some malicious conversion from pointer to int
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@522 4a71c877-e1ca-e34f-864e-861f7616d084
- Cosmetic change in debug.c (Mark begin of the log with "---")
- Fix bug where PhysFS said WriteDir "Warzone-2.0\" is insecure and refused to create it (bug#6466)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@510 4a71c877-e1ca-e34f-864e-861f7616d084
- Makefile.raw doesn't try to link every .o to GL on Linux anymore
- Fixed PhysicsFS ignorecase to not create a Doxygen mainpage
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@509 4a71c877-e1ca-e34f-864e-861f7616d084
Uses a config.mk.tmpl file to set system dependend stuff, no bash required.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@490 4a71c877-e1ca-e34f-864e-861f7616d084
- Pointed out other locations where that error could occur (src/data.c, lib/ivis_common/pcx.c)
- Deprecated pie_ReloadTexPage, as it doesn't appear to be used (lib/ivis_opengl/tex.c)
- Made iSprite width and heigth unsigned (lib/ivis_common/pietypes.h)
- Added debugging for MSVC which doesn't understand the DB* redefines (lib/ivis_common/bitimage.c)
- Fixed deprecation for MSVC (lib/framework/macros.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@452 4a71c877-e1ca-e34f-864e-861f7616d084
- Cleaned up unneeded frees from last memleak fix.
- Added debug info as allways.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@451 4a71c877-e1ca-e34f-864e-861f7616d084
- DB* replaced by debug calls
- Added MSVCRT debugging flags for finding memleaks
- Added points to the TODO
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@450 4a71c877-e1ca-e34f-864e-861f7616d084
This patch includes:
- Strongly modified way of adding mods, maps and addons
- Make nearly everything use PhysFS (just netlog and debug stay)
- Convert several DBERRORs etc. to debug()
The new modloader works like this:
For every mod supplied on the commandline ("-mod") (maximum of MAX_MODS=100) keep it in mind (char * global_mods[]).
After initializing PhysFS do scanDataDirs(), which tries to register all possible paths, global_mods[] and maps with PhysFS. Dont check wether we succeed, only at the very end check if we got a "gamedesc.lev".
When we buildMapList(), mark "gamedesc.lev" as MOD_CAMPAIGN, "addon.lev" and every user supplied map as MOD_MULTIPLAY.
When we loadMods() modify the searchPath according to the supplied mods.
Note: T1 maps like Sk-Rush come from gamedesc.lev, are marked MOD_CAMPAIGN and thus wont load any multiplay_mods[], even if the user starts a multplayer game. Instead those maps are threated as campaignmode and will only load campaign_mods[].
This patch requires the "mp" patches to be either in ProgramDir/mp, in ProgramDir/data/mp or in ProgramDir/mp.wz
This is because one cannot add warzone.wz/mp to the search path if warzone.wz is an archive.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@436 4a71c877-e1ca-e34f-864e-861f7616d084
- Fixed several files for being C89 compatible, so MSVC compiles them. (No variable declarations after function calls allowed.)
- Added function definitions (lib/framework/win32fixes.h) for functions with different names under Win32/Linux. (Aiming at moving all platform specific defines into such headers. Everywhere included frame.h should make this easy.)
- Please take a look at lib/gamelib/audp_parser.y. I had to convert the lowercase token "text" to uppercase "TEXT", so it doesn't collide with msxml.h (mysteriously included by some windows headers).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@433 4a71c877-e1ca-e34f-864e-861f7616d084
- Removed unused/outdated ivis02/Ivis02.dsp/.vcproj and src/mpdpxtra.[ch]
- Replaced src/mplayer.c with a stub, containing only mplayerSubmit()
- Added DEPRECATED warnings
- Added documentation for WZ_DEPRECATED
One commit follows, to finish the move from ivis02/v4101_stub.c to ivis02/v4101.c
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@415 4a71c877-e1ca-e34f-864e-861f7616d084
- Added a WZ_DEPRECATED macro (lib/framework/macros.h) to mark deprecated functions.
(See http://websvn.kde.org/trunk/KDE/kdelibs/kdemacros.h.in?view=markup -> KDE_DEPRECATED for usage.)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@406 4a71c877-e1ca-e34f-864e-861f7616d084
Also big amount of whitespace changes, sorry for the inconvenience...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@400 4a71c877-e1ca-e34f-864e-861f7616d084
merged...
Now filenames are case insensitive (will help using maps
created with Qamly's EditWorld).
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@396 4a71c877-e1ca-e34f-864e-861f7616d084