Giel van Schijndel
7b12081033
sDisplay is a member variable from BASE_OBJECT, so don't bother casting tile->psObject to a STRUCTURE* or FEATURE* before using this member variable
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4917 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 15:04:07 +00:00
Giel van Schijndel
3a11c25d54
* Turn macros TILE_OCCUPIED, TILE_HAS_STRUCTURE, TILE_HAS_FEATURE, TILE_HAS_WALL, TILE_HIGHLIGHT, TILE_HAS_TALLSTRUCTURE and TILE_HAS_SMALLSTRUCTURE into static inline functions TileIsOccupied, TileHasStructure, TileHasFeature, TileHasWall, TileIsHighlighted, TileHasTallStructure and TileHasSmallStructure respectively
...
* Move the definition of MAPTILE above these ^^ macros and functions to prevent declarations problems
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4916 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 14:56:33 +00:00
Giel van Schijndel
45c2a0676c
Don't check for strlcpy and strlcat in the configure script as simply #defining _XOPEN_SOURCE (what config.h does) is enough to prevent declarations of these functions from being included (thus the #inclusion of "frame.h" in strlfuncs.h should be enough (this should fix bug #11609 )
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4915 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 13:56:27 +00:00
Roman C
2c7d52d0c8
Fix MSVC compilation.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4914 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 12:55:05 +00:00
Per Inge Mathisen
221a2cb4ee
Remove MSVC support for WZ_DECL_CONST since it didn't work.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4913 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 12:34:20 +00:00
Roman C
7f96d8ad29
Don't try to draw effect, that is used to visualize a radius, off map. This prevents an assert in map_Height().
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4911 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 11:59:57 +00:00
Roman C
024def4cd0
Balance:
...
-make Scorpion slightly 4% more expensive
-cost of Dragon any Wyvern body decreased by ~10%
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4909 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-04 11:55:16 +00:00
Per Inge Mathisen
6e9732a86a
WZ_DECL_CONST now implies WZ_DECL_WARN_UNUSED_RESULT and also works on MSVC.
...
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
2008-05-04 11:43:28 +00:00
Giel van Schijndel
bedb5a77cb
Remove function declarations for non-implemented functions receiveWholeDroid and sendWholeDroid
...
PS Thanks Troman for granting me the privilege of removing these declarations. I just love cleaning up code ;-)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4907 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 23:13:20 +00:00
Per Inge Mathisen
df4e26104e
Remove unused code
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4906 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 22:04:05 +00:00
Roman C
b32efa5ce5
Fixed vertical position of the 'ready' button.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4904 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 20:09:17 +00:00
Roman C
2e7aeb7e1e
Add highlighting frame for the 'ready' button.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4902 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 18:48:19 +00:00
Roman C
aa97edfd3c
Add proper icons for the 'ready' buttons. Icons by elio`.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4900 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 17:43:55 +00:00
Per Inge Mathisen
d5200992a1
Remove references to old bitmap font images.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4899 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 17:04:15 +00:00
Per Inge Mathisen
5fcc77fe59
Simplify fpathRoute parameters, and its beautify error log calls.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4898 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 11:57:54 +00:00
Giel van Schijndel
6a236994ae
Move psActionTarget into a more local scope, to ease debugging of bug #11609
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4897 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 11:16:03 +00:00
Giel van Schijndel
31fda8026b
Don't call function pointers when they're NULL (fixes a segfault bug that occurs when a resource type without release function couldn't be loaded)
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4896 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 10:24:36 +00:00
Giel van Schijndel
46805bb32f
Fix bug #11480 :
...
* Don't call PHYSFS_close if our PHYSFS_file* pointer is NULL
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4895 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-03 10:17:06 +00:00
Giel van Schijndel
8997223371
Perform the actual function call of the parsing function (levParse) in doParseTest() in t1000.c rather than parse_test.c
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4894 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 21:55:24 +00:00
Giel van Schijndel
ed46143437
Update svn:ignore and bugtraq:* properties on /tests/
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4893 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 21:38:50 +00:00
Giel van Schijndel
510b633251
* Utilise ARRAY_SIZE to determine the amount of elements in a statically sized array
...
* Use sizeof(*ptr) instead of sizeof(type) in malloc & memset calls
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4892 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 21:19:15 +00:00
Per Inge Mathisen
6f7ee5236e
Remove unused aMapLinePoints global.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4891 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 21:10:08 +00:00
Per Inge Mathisen
1423e2d742
Add path-finding test and measurement to selftest.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4890 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 21:06:39 +00:00
Giel van Schijndel
03bc81c0fb
#include "frame.h" in strlfuncs.h; to hopefully fix bug #11609
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4889 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 20:59:35 +00:00
Giel van Schijndel
0071531040
Fix several memory leaks in level_parser.y that occur when parsing errors occur:
...
* In case of a semantic error (i.e. we detect something is wrong in a parsing rule) deallocate the resources of our current tokens __before__ calling YYABORT
* Only add a LEVEL_DATASET* to the psLevels list when we've fully and succesfully finished parsing of the corresponding level_entry
* Add a bison "destructor" that handles destruction of tokens on the parsing stack when a syntax error occurs (i.e. the current tokens cannot be matched to any parsing rule)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4888 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 20:37:23 +00:00
Giel van Schijndel
efd188a632
Call debug_exit() on exit from the parser unit test so that valgrind testing becomes easier
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4887 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 20:30:45 +00:00
Giel van Schijndel
006ec9e71a
clean up levShutDown()
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4886 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 19:51:23 +00:00
Per Inge Mathisen
76110b6156
Vastly simplify fpathGatewayRoute
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4885 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 19:03:10 +00:00
Giel van Schijndel
ff89c2e63f
Less leaking of memory from level_parser.y
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4884 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 18:58:43 +00:00
Giel van Schijndel
35d84d2fbf
Add the beginnings of an external unit test framework (i.e. it doesn't run in Warzone itself, it just links to pieces of Warzone's code to test it):
...
* Add a new directory with unit tests (/tests/)
* Run `make test` in this directory to execute all these unit tests and get reports from them if they fail
* Add a single unit test to the directory which tests level_parser.y and the input it should & shouldn't accept
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4883 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 18:44:01 +00:00
Giel van Schijndel
d722cb24bb
Allow level files (*.lev) to be empty, though give a warning when they are (LOG_WARNING)
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4882 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 18:22:59 +00:00
Per Inge Mathisen
54ce38695e
Add hack check to warn against flex 2.5.34, revert requirement back to .33
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4880 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 18:04:08 +00:00
Giel van Schijndel
9c73cefd89
Don't ASSERT on a parsing error, use debug(LOG_ERROR, ... instead (the parser's return-value will be enough to determine that an error occurred)
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4879 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 17:59:39 +00:00
Giel van Schijndel
5154d575da
Assert that the pointers to strlcpy & strlcat are not NULL
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4878 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 12:38:44 +00:00
Giel van Schijndel
b9857f9bf9
Detect whether the OS already supplies strlcpy and strlcat and don't define our own if it does:
...
* Add m4 macros AC_STRLCPY_CHECK and AC_STRLCAT_CHECK for use in the autoconf script
* Don't define our implementation when HAVE_STRLCPY or HAVE_STRLCAT is defined
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4876 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-02 12:04:20 +00:00
Giel van Schijndel
87c779278a
Remove non existent files platform.h and dbghelp.h from the Code::Blocks projectfile
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4875 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-01 22:54:37 +00:00
Giel van Schijndel
91fb082019
Minor cleanup
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4874 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-01 20:50:30 +00:00
Giel van Schijndel
d962bcbf1c
* Use a nice & easy to maintain string to enum mapping-array and utilise a for-loop to fetch the correct value from it (instead of a huge amount of code repetition)
...
* Some const correctness
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4873 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-01 20:25:20 +00:00
Giel van Schijndel
507a1a6da2
Less bitfucking:
...
* Don't store whether a research item is possible in a bitflag; use a boolean instead
* Use functions instead of macros to access research->possible
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4872 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-01 20:00:13 +00:00
Giel van Schijndel
43fb7d845a
Fix Code::Blocks projectfile
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4871 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-01 19:47:16 +00:00
Giel van Schijndel
b241fb574e
Update frontend2.svg with the latest changes by Elio Gubser
...
File attached to http://forums.wz2100.net/?topic=1608.msg16060#msg16060 (minus the Inkscape property changes)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4870 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-01 15:39:45 +00:00
Roman C
5f19bef86a
Added two heavy templates to templates.txt for AIs.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4869 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-01 14:37:30 +00:00
Roman C
4c5420f463
Aivolution:
...
-fix heavy templates
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4868 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-01 14:36:00 +00:00
Roman C
738344ccf4
Get rid of all references to the 'OK' button that used to start a multiplayer game.
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4866 4a71c877-e1ca-e34f-864e-861f7616d084
2008-05-01 12:52:24 +00:00
Per Inge Mathisen
5034cedfd4
Rename astrlcpy and astrlcat to sstrcpy and sstrcat. Add ssprintf and sstrcmp also.
...
Renaming due to name conflict with a gnu extension. Added debug versions of all the
above, that assert if a char* pointer is passed in. This means they cannot be used
with strings shorter than the shortest expected length of void*.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4865 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-30 17:26:38 +00:00
Per Inge Mathisen
28da8c3c36
Fix warnings
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4864 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-30 17:14:16 +00:00
Roman C
405a03ba95
Aivolution:
...
-counter attacks by long-ranged units (including arty)
-rewrote the way AI handles situations when it loses enemy base location while attacking it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4863 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-30 16:04:08 +00:00
Roman C
d764b211cb
Scripting engine:
...
-added a way to check map tiles for visibility
-added a function to check for visible droids inside a certain range
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4862 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-30 15:44:04 +00:00
Giel van Schijndel
bdaa9290da
Make a lot of duplicates clones of a single "parent"
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4860 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 19:57:09 +00:00
Giel van Schijndel
6e0f763ad5
Add Elio Gubser <elio> to the AUTHORS file
...
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4859 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 17:30:45 +00:00