Commit Graph

39 Commits (ac33b9f5dd869284b25549aee2088ddd00874270)

Author SHA1 Message Date
Dennis Schridde 49ceba7503 Add GPL notices to all sourcecode files.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1014 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-15 20:09:25 +00:00
Roman C 3bfab0ce95 -Implemented C-like #include preprocessor directive for the scripting engine, can be used up to depth of MAX_SCR_INCLUDE_DEPTH. Unlike C counterpart main purpose is to reuse executable and non-executable code.
Example:
#include "multiplay/skirmish/my_include.slo"

-Implemented C-like #define preprocessor directive. Nested macros allowed with up to depth of MAX_SCR_MACRO_DEPTH.
-Added a script function for a fast feature iteration (returns burning as well as non-burning oil resources)
-Replaced some custom Pumpkin routines with default FLEX routines
-Some cleanups

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@950 4a71c877-e1ca-e34f-864e-861f7616d084
2007-01-02 20:12:14 +00:00
Roman C 14cd4b60cc Scripting engine update:
-void pointer is now compatible with any other pointer type
-strings can now be directly compared using '==' and '!=' operators
-added a linguistic chat message parser with some generic messages predefined - to be used for Human<->AI and AI<->AI communication
Note: chat_lexer.l should be compiled using an additional -i switch for case-insensitive lexer

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@898 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-16 14:59:50 +00:00
Roman C ca6d0af961 Fixed a bug which was preventing script increment/decrement operators to function properly
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@895 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-06 18:57:17 +00:00
Roman C 10daf67ea4 -added increase/decrease operators (seems to have a minor flaw atm though)
-fixed MSVC compilation issues and wrong casts in initializations

Scripting Engine:
-lexer will now skip all macros in script files - allows to use macros in IDEs
-float data type can now be used in boolean expressions
-fixed visibility check in initEnumStruct() script function
-fixed playerLoaded() script function
-added some new script functions
-Object.weapon now also works with structures
-added decrement/increment operators

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@889 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-02 23:27:00 +00:00
Dennis Schridde 87da22bce1 - Fix maybe bugs introduced in last commits
- Fix a lot of char* related warnings (fixing of scripttabs.c needs to be finished like I started it)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@867 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-26 13:45:04 +00:00
Roman C e3b77d82d2 Script functions can now take float data type as parameters and return value
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@848 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-17 17:07:03 +00:00
Roman C dacc1de1ca Scripting engine overhaul - Part I
-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
2006-11-16 14:30:29 +00:00
Roman C 4de2b284a0 Fixed double declaration of "FUNCTION" token for bison.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@806 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-03 22:44:03 +00:00
Dennis Schridde d3cd44148d Patch by Gerard Krol: Replace STRING with char (STRING was confusingly defined to char)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@804 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-03 21:35:50 +00:00
Roman C 9be9d21e09 -automatic target assignment will now give low priority to half-built structures when looking for a target (structures getting full HP upon construction begin was an exploit against unit AI)
-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
2006-10-24 13:05:40 +00:00
Roman C e2de834b13 -1.10 AI doesn't build flamer bunkers in the base anymore
-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
2006-10-08 08:06:46 +00:00
Roman C 09f607afbc Unused variables cleanup.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@764 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-26 18:25:36 +00:00
Stefan Huehner b3e3d17b82 Include frameresource.h directly in its users. Fixup after
the big cleanup in 748:749.




git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@750 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-23 18:38:12 +00:00
Dennis Schridde 3261a09baf BIG cleanup of headers.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@749 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-23 17:24:55 +00:00
Roman C 15b02fe669 Fixed script compilation bugs,
further scripting enhancements.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@729 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-19 16:07:06 +00:00
Dennis Schridde d889ce9da7 Patch by Christian Ohm: "g++ fixes"
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
2006-09-17 20:39:25 +00:00
Dennis Schridde 75af155bbf Patches by Stefan Huehner: "code cleanup: void 5, static 4" and a slightly modified "doxy 1"
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@717 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-16 17:41:40 +00:00
Dennis Schridde 27b07a0ba1 Patch by Stefan Huehner: "code cleanup: const 2"
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
2006-09-13 21:16:17 +00:00
Dennis Schridde 728b9a9913 - Commit patches "code cleanup: void" and "code cleanup: const" by Stefan Huehner
- 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
2006-09-13 09:09:05 +00:00
Dennis Schridde 915390aa1b Fix possible bugs when having deeper pointers than probably intended.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@685 4a71c877-e1ca-e34f-864e-861f7616d084
2006-09-03 20:32:01 +00:00
Roman C e70448bc0d Fixed a #define inside of a Bison grammar rule
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@651 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-26 21:45:21 +00:00
Roman C c1c801383e Fixed compilation on GCC
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@650 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-26 20:51:54 +00:00
Roman C c3eae9e73f Fixed bug #6753 ,
Define DEBUG_SCRIPT to get some more Bison/Flex debug output

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@648 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-26 17:14:04 +00:00
Dennis Schridde 4208601a38 - Fix string stack reset for scripts
- Clean warnings and a wrapper function for widgets
- Add an assert to intDisplayMessageButton to catch crashes better


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@631 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-25 20:38:27 +00:00
Dennis Schridde 0e288f45e7 - Replace all ASSERT(( )) with ASSERT( )
- 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
2006-08-23 12:58:48 +00:00
Dennis Schridde 62ae49b0ce Replaced all occurences of DBMB, DBPRINTF and DBERROR with their former define.
( DBPRINTF(("Message")); becomes debug( LOG_NEVER, "Message" ); )



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@608 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-22 14:28:49 +00:00
Roman C aee8ea47f7 Fixed bug #6687,
Added debug() for scripts, 
Plus some cosmetic changes

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@603 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-21 21:20:17 +00:00
Roman C 433d707927 Fixed missing player names in multiplayer messages,
cleaned up Bison logs
enabled logs for loading .slo and .vlo files

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@597 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-21 09:34:42 +00:00
Ari Johnson 8917cea6cb Runtime script parse errors now report a filename and line number rather
than just an inaccurate line number.


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@591 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-20 11:15:55 +00:00
Roman C 797906a0db fixed some warnings
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@584 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-19 13:40:19 +00:00
Roman C 92284dc7bc Scripting engine update:
-implemented string support
-functions can now have arguments, example:
function STRING myFunc(DROID myDroid, int myInt2){<code>}
-functions can have return values:
return <statement>;
or just "return;" for void functions
-function calls are made the normal c/c++ way (using the function from the first example):
myString = myFunc(myDroid, 156);

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@583 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-19 13:26:11 +00:00
Roman C e0c93aec7d Scripting engine update:
Implemented local variables, which can be used inside of functions or events.
Syntax:

local int myVar1,myVar2;

 * fixed a bug which made wz crash when local variable was declared inside of an event

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@572 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-16 11:23:43 +00:00
Roman C a891af6a7a git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@570 4a71c877-e1ca-e34f-864e-861f7616d084 2006-08-15 18:38:51 +00:00
Per Inge Mathisen 2149739999 Almost all strings and buffers are now of type char. This fixes
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
2006-08-12 16:52:37 +00:00
Roman C 223ea92358 Scripting Engine Update:
-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
2006-08-12 10:02:59 +00:00
Dennis Schridde eb7ba7e41d - Again revised the modloading(restrictions were stupid) (src/levels.c,src/init.[ch],src/multiint.c,src/main.c)
- Fixed case problem with noVideo.rpl (lib/sequence/sequence_stub.c)
- Fixed some G++ 4.1 compile problems (mostly invalid conversions) (lib/script/script_parser.y,lib/framework/frame.h,lib/framework/frameresource.c,lib/framework/frameresource.h,lib/framework/input.c,lib/framework/configfile.c,lib/framework/frame.c)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@455 4a71c877-e1ca-e34f-864e-861f7616d084
2006-07-04 13:35:01 +00:00
Dennis Schridde 5175535d9d Full pathname includes
Same as in r431, but now for lib/
- converted the sources in lib/ to use full path includes instead of just the filename.
- marked places where lib/ivis_*implementation* (eg opengl) is needed, because of incomplete lib/ivis_common.

Should improve the understanding of interfaces and code organization.

(Also fixed a double slash (//) include in src/multimenu.c)



git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@432 4a71c877-e1ca-e34f-864e-861f7616d084
2006-06-02 19:34:58 +00:00
No Author 5ba7ddac6b Create final repository structure.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@362 4a71c877-e1ca-e34f-864e-861f7616d084
2007-06-28 17:47:08 +00:00