Commit Graph

3929 Commits (31fda8026bf52024958339e6b8686bcc33d05870)

Author SHA1 Message Date
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
Giel van Schijndel 448349a245 Change 'elio' in the license statement to 'Elio Gubser'
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4858 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 17:28:00 +00:00
Roman C 1521a97bd8 Suppress #line creation for scriptvals_parser and level_parser, this fixes MSVC compilation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4857 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 15:22:27 +00:00
Giel van Schijndel 4e60f65e8f Don't #include "script_parser.tab.h" in lib/script/stack.c as we don't depend on the parser's token definitions there
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4856 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 15:18:42 +00:00
Roman C c3ace2ec9f Redefine __STDC__ to 1, this fixes MSVC compilation.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4855 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 15:05:08 +00:00
Giel van Schijndel b047f2c1ef Work around MSVC not #defining __STDC__ (all ISO C89 compliant compiles _should_ #define that macro)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4854 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 14:32:14 +00:00
Giel van Schijndel 7179a24fb5 Stuff frontend2.png on the background of frontend2.svg so that the improvements are more easily visible
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4853 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-29 00:02:46 +00:00
Giel van Schijndel f86812690c Add a (partial) Scalable Vector Graphics (svg for short) version of frontend2.png
By Elio, from this topic: http://forums.wz2100.net/?topic=1608.msg15980#msg15980


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4852 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 23:35:35 +00:00
Giel van Schijndel bfb035d41a Merge r4804 from the 2.1 branch into trunk (except for the removal of the SQLite stuff from the XCode projectfile)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4849 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 21:41:12 +00:00
Per Inge Mathisen f6919d5b1e Add highlighting for player flags in MP dialog. Icons by Elio.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4848 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 21:34:16 +00:00
Giel van Schijndel fbf8efefde Only truncate the programPath if it's followed by an EOL
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4847 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 21:16:51 +00:00
Giel van Schijndel 0f71381685 Lets use some proper make rules!
* Use $@ and $< to refer to the targets and dependencies of make rules
 * Don't refer to make rule dependencies and targets by copying them!
 * Putting make rules on multiple lines isn't bad, in fact it increases readability!
 * Mark phony make rules (i.e. rules who's actions don't produce files) as `.PHONY`

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4846 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 20:58:13 +00:00
Giel van Schijndel a5a74770e8 Allow proper linking of the exceptionhandler with the raw Makefile system
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4845 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 20:46:33 +00:00
Giel van Schijndel 0555874c44 Pass programCommand to dbgDumpInit() so that it can use that to set up debug dump info
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4844 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 20:45:28 +00:00
Per Inge Mathisen 8837e5630f Make repair facilities that are close to each other share the workload
if one is overloaded and others are out of work.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4843 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 19:06:21 +00:00
Giel van Schijndel 282b5793c2 Optimise the management of the 2D node-table `nodeArray`:
* Implement lazy deletion:
  * Keep a counter, `resetIterationCount`, and only treat nodes that have it's `iteration` member set to the same value as valid nodes
  * "Delete" all current nodes from the table by simply incrementing the `resetIterationCount` counter
  * Detect upcoming overflows of `resetIterationCount`, fully clear the node-table and reset the iterator if an overflow is "pending"

Patch #1059 by Dennis Luxen and myself


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4842 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 18:42:25 +00:00
Per Inge Mathisen 63d537d458 Also restore the LOS optimization of paths for trunk, removed in r4637, so
that long paths work again.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4841 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 18:33:07 +00:00