Commit Graph

3915 Commits (d722cb24bb08db9c9cb770cf135c5b1cb10bd797)

Author SHA1 Message Date
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
Giel van Schijndel eedd38bd80 * Fix several Doxygen comments and assign some to the group pathfinding
* Use ARRAY_SIZE(nodeArray[x]) to determine the amount of elements in nodeArray[x], instead of ARRAY_SIZE(nodeArray)
 * Add Dennis Luxen's comment from patch #1059


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4840 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 17:33:17 +00:00
Giel van Schijndel ffd381cd63 Rip out the hash table from the pathfinding code and replace it with a two dimensional array
Part of patch #1059 by Dennis Luxen;
 * I ripped out the iteration-counter optimisation to commit it seperately
 * Some small modifications for ISO C89 compliance (MSVC requires this)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4839 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 17:02:00 +00:00
Giel van Schijndel 30e790a7b8 Add a Doxygen comment to function iV_GetTexture
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4838 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 16:51:03 +00:00
Per Inge Mathisen 4a9db54241 Fix bug #11586: crash when reaching transport destination in mission beta 7
reported by Jan Dittberner. Smoke effect coordinates were not properly clipped.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4835 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 16:35:37 +00:00
Giel van Schijndel d16f801020 Add the new LeveLexer from r4833 to the Python Egg as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4834 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 00:45:15 +00:00
Giel van Schijndel d83e9ff749 * Add yet another Pygments lexer: LevelLexer which lexes .lev files
* Mark the .lev files as text/x-wzlev


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4833 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 00:41:59 +00:00
Giel van Schijndel df291b43fc Update the Code::Blocks and MSVC projects for the addition of the level parser in r4830
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4831 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 00:11:37 +00:00
Giel van Schijndel e0dc2071f0 Add a new bison/yacc parser: level_parser.y:
* Change level_lexer.l: 
  * Use lev_lval to return token-data in (instead of global vars)
  * Use strdup() to return strings to the parser and let the parser take care of memory clean-up (through Bison's %destructor directive)
  * Use the token constants as generated by Bison (instead of our own custom enum)
 * Rip out the custom state machine-like level parser from levels.c (was function levParse)
  * Remove all global variables associated with this parser
  * Remove the LP_* enum which was only used by this parser
  * Move function lev_error to level_parser.y
 * The new parser provides more verbose error messages if parsing fails

NOTE: The previous state machine-parser actually maintained state in two variables, so it was rather overly complex (quadratic complexity if you like)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4830 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-28 00:04:40 +00:00
Giel van Schijndel 0928c105e9 Change global var levelLoadType to a static one
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4829 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-27 23:57:22 +00:00
Giel van Schijndel ec293faa86 * #Include from the local directory (i.e. remove the "src/" part from some #include directives)
* Line out fix: use spaces, not tabs
 * Use the yy* macros provided by bison/flex instead of prefix*


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4828 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-27 23:44:40 +00:00
Giel van Schijndel 2523625716 r4826 didn't yet fix all, apparently there was commented out code changed as well
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4827 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-27 23:30:02 +00:00
Giel van Schijndel 16cd0c108e Oops! Apparently my search&replace regexp for r4825 contained a small typo causing a syntax error: fixed it
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4826 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-27 23:25:36 +00:00
Giel van Schijndel 62d1a9e5fc * Remove constant MULTI_TYPE_START and replace it by an enumeration value: LDS_MULTI_TYPE_START
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4825 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-27 23:21:19 +00:00
Giel van Schijndel e7269c9fce Lets not #include the Doyxgen generated files from a previous run in the Doxygen docs for the current run (specifically search.php)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4824 4a71c877-e1ca-e34f-864e-861f7616d084
2008-04-27 17:53:57 +00:00