Commit Graph

802 Commits (e19e8814b6fbb23c855e65ad35dd586f97b069a3)

Author SHA1 Message Date
Giel van Schijndel e19e8814b6 * Add a GPL (v2 or later) header to source:trunk/lib/ivis_common/pievector.h
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2678 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-02 19:41:04 +00:00
Per Inge Mathisen ec232d7e0f Actually use audio.cfg configuration of sound volume. Patch by Buginator in patch #822
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2677 4a71c877-e1ca-e34f-864e-861f7616d084
2007-11-02 18:47:22 +00:00
Per Inge Mathisen ccd725073e Add extra sanity checking to tagfile code to make it fail earlier rather than later.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2673 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-30 18:51:44 +00:00
Per Inge Mathisen 5567ae6e4b Add debug log call for tagfile errors.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2672 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-30 16:58:35 +00:00
Per Inge Mathisen 6e19e51118 Replace int x,y,z in TERRAIN_VERTEX with a Vector2i, and fix two cases of
type punned pointer casts.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2670 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 22:00:55 +00:00
Dennis Schridde 06a469ed5b Simplify Vector2f_Normalise and update docs
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2669 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 21:43:55 +00:00
Per Inge Mathisen b99feff92f Merge PIEVERTEX and SVMESH into TERRAIN_VERTEX and use struct assignment instead of memcpy on it.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2668 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 21:41:38 +00:00
Per Inge Mathisen fe27053bf7 Fix bug in last commit
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2664 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 19:51:02 +00:00
Per Inge Mathisen ec0836efdc Fix type punning warning where we cast an array as a struct pointer in netplay.c
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2663 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 19:49:39 +00:00
Per Inge Mathisen 81ccff31f7 Convert hash table to use 64 bit keys instead of 32 bit keys, since they are used
to store pointers.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2661 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 19:28:02 +00:00
Per Inge Mathisen c086e3c529 Clean up hash table code
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2660 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 19:16:16 +00:00
Per Inge Mathisen 70718282a4 Fix shadows looking bad from opposite view direction of shadows, and fix
memory leak in shadow code reported in bug #10190.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2659 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 18:52:43 +00:00
Giel van Schijndel dcbef6f398 * Don't use variable array, structure members in RES_DATA
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2658 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-29 17:53:37 +00:00
Per Inge Mathisen d668738714 Vector normalization should not be carried out if vector length is zero, as this
would divide a vector by zero, which is bad. This closes bug #9739.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2654 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-28 16:20:55 +00:00
Giel van Schijndel 0374c67a12 * Add a doxygen comment to source:trunk/lib/framework/strlfuncs.h describing macro STR_L_FUNC_TRUNCATION_DETECT
* Replace (the last) strncpy() call in nettyps.c with a strlcpy() call


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2647 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 20:20:35 +00:00
Per Inge Mathisen 49df8ea371 Use GLC_TEXTURE for font rendering. Patch by Bertrand Coconnier in bug #10188.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2646 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 19:20:25 +00:00
Per Inge Mathisen e808d83f0c Add comment about quesoglc workaround being fixed upstream as of today.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2645 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 19:00:55 +00:00
Per Inge Mathisen 1d2caebccd Cleanup fugly code, and add nasty hack around weird bug. See bug #9843 for more info on bug.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2644 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 18:16:15 +00:00
Per Inge Mathisen 9609cb0005 Use full path to frame.h. Patch in bug #10208 by unknown.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2642 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 17:30:49 +00:00
Giel van Schijndel f5602b4778 * Replace a large amount of strncpy() calls with the safer strlcpy()
* Fix an error in src/game.c where we would use the wrong size as parameter to strlcpy()


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


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


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2635 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 14:35:35 +00:00
Per Inge Mathisen 94421b5b56 Clean up LOG_3D
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2634 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 13:58:01 +00:00
Per Inge Mathisen 9d5f31cbdd Clean up RPL reader, removing static memory buffer once RPL file is closed. Closes bug #10206.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2633 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-27 13:30:23 +00:00
Per Inge Mathisen 35bd80b426 Add missing braces after conditionals. Please follow proper coding style :-)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2632 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-26 23:29:45 +00:00
Per Inge Mathisen 8885cb207c Try to work around QuesoGLC bug that makes Warzone hang on chat output. Fixes bug #10202.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2631 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-26 23:25:32 +00:00
Giel van Schijndel 673812b2a4 * Add file strlfuncs.h; this file contains an inline implementation of strlcpy and strlcat (safer variants of strncpy and strncat respectively)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2627 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-26 17:05:29 +00:00
Dennis Schridde 20bc25c107 Windows MiniDumper: resultMessage is always null-terminated and MessageBox is always shown. => Move out of ifs.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2626 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-25 23:32:20 +00:00
Dennis Schridde a923b6a000 Dump used compiler and version, too.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2625 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-25 23:23:21 +00:00
Giel van Schijndel e06c186bd6 * Replace a _lot_ of strcpy(), strcat() and sprintf() calls with the safer strncpy(), strncat() and snprintf() respectively
* Refactor NETlogEntry() to use the array of strings (packetname[]) instead of a large switch-statement with a lot of copy & pasted code


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


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

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2614 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-24 16:54:53 +00:00
Per Inge Mathisen 6cf0e01f0b Add write and read methods for bools to tagfile framework. Remove enum write macro.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2599 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-23 20:21:18 +00:00
Per Inge Mathisen 9ec705bd9c Add new debug tag LOG_MAP
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2597 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-23 18:18:48 +00:00
Giel van Schijndel 95caee7a1f * Don't (re)initialize the text render module upon calling iV_Reset() anymore
* Remove iV_Reset() call from src/levels.c which is there only to prevent a crash caused by the *OLD* font rendering code
 * Make sure to initalize the font rendering module (by calling iv_TextInit()) in init.c:systemInitialize()


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2593 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-22 22:51:44 +00:00
Dennis Schridde d5601ebc91 Found a version of the STATIC_ASSERT which also works in global scope.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2592 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-22 20:53:27 +00:00
Per Inge Mathisen ffc1f75aac Silence asserts going off on working separator tags in tagfile code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2589 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-22 20:09:55 +00:00
Per Inge Mathisen 3bd357ed08 Fix some mistakes and remove debug printfs from tagfile code.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2587 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-22 19:33:47 +00:00
Per Inge Mathisen c9b25c5738 Add the tagfile framework that we will use for our new savegame format, and related
unit tests. First sketch of new defined savegame format in tagfile_map.def.


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


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


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2550 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-15 18:09:18 +00:00
Roman C d042bb5203 Fixed c99-style variable declaration in script_lexer.l
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2536 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-08 14:21:09 +00:00
Giel van Schijndel ad3f3442f6 * Fix a segfault introduced in r2532 which was triggered when loading *.slo scripts with #define directives in them
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2533 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-06 14:22:49 +00:00
Giel van Schijndel f7e793cf31 * Load SCRIPT files (*.slo) directly from their files rather than an intermediate memory buffer
* In function dataScriptLoad, make "printHack" a "static const" instead of a local non-const variable (emphasizes that it really is a compile-time constant; also towards the compiler btw, GCC treats a static const var as a preprocessor macro with static type checking)
 * Move global variables pScrInputFiles (formerly pScrInputBuffer), scr_include_stack_ptr, scr_num_macros, scr_macro_stack_ptr, pScrMacroBuffer and scrInclLine from script_parser.y to script_lexer.l and mark them static to disallow external linkage (to make it a little bit better encapsulated and localised)
 * Make function scriptCompile return a SCRIPT_CODE* pointer instead of a BOOL and writing the same pointer into an output pointer (instead upon failure it now returns NULL)
 * Move some of the functionality of scriptCompile to new function scriptSetInputFile instead (which is based upon scriptSetInputBuffer)
 * Modify script_lexer.l to read include files directly from the files rather than an intermediate memory buffer (by means of a modified YY_INPUT macro)

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2532 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-05 22:44:18 +00:00
Giel van Schijndel 3ebad628ca * Allow QuesoGLC to fall back to a random font when we failed to load any fonts
* This should fix _the_symptoms_ of bug #10117

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2530 4a71c877-e1ca-e34f-864e-861f7616d084
2007-10-05 17:06:20 +00:00