Commit Graph

24 Commits (ebecb854b116f8fc3e56c2af0d00d43016313c38)

Author SHA1 Message Date
Dennis Schridde f888cc5b69 Revert 4344-4347, 4355, 4357, 4358, 4362: They caused too much slowdown in the scripting engine
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4379 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-27 18:38:25 +00:00
Dennis Schridde e6e09ee72a Differ between deep (i.e. incl strings) and non-deep (just the pointer) copies
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4362 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 21:43:39 +00:00
Dennis Schridde 3eecd4fd7b Move interp*2string to script*2string
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4356 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 14:57:35 +00:00
Dennis Schridde 9019233d1a Properly copy string->string
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4347 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 10:26:15 +00:00
Dennis Schridde 6fdc8dd8b1 Dont store values and types seperately.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4346 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 02:35:26 +00:00
Dennis Schridde cb2e3c3201 New interpreter functions for initialisation, cleanup and copy (incl. conversion, will be used later). Shall replace special string handling.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4344 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 01:54:27 +00:00
Dennis Schridde 480314fed0 Enhance copeprint capabilities and add more 2string functions for the scripting engine.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4340 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 00:45:03 +00:00
Dennis Schridde ce8e1d1846 - Generic cleanup
- Strings are not equivalent to anything, only convertible (mistake in one of my last commits)
- Clarify names
- Print user types


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4339 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-26 00:27:56 +00:00
Dennis Schridde e402233597 Add type to string function (i.e. to be used for error messages). Allow bool, int, float to be converted into strings in interpCheckEquiv().
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4323 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 20:57:07 +00:00
Dennis Schridde 10f2ccfd56 TRUE->true, FALSE->false (except in scripts)
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4311 4a71c877-e1ca-e34f-864e-861f7616d084
2008-03-24 16:51:17 +00:00
Roman C da3f1e25f8 - removed some ASSERSs doubling debug() error output
- when script runtime error occurs wz first outputs error information and then asserts, not vice versa
- printCallStack() script function will output script call stack to standard output

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1107 4a71c877-e1ca-e34f-864e-861f7616d084
2007-02-14 18:29:26 +00:00
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 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 634435e712 Change VAL_REF from a define to part of the VAL_... enum.
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@888 4a71c877-e1ca-e34f-864e-861f7616d084
2006-12-02 16:07:00 +00:00
Roman C 6d8dbda48e -fixed 'cpPrintProgram'
-fixed some spelling mistakes
-minor cleanups

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@847 4a71c877-e1ca-e34f-864e-861f7616d084
2006-11-17 11:25: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
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
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 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
Roman C e4883dabb9 Scripting engine update:
-added new scripting function
-added new callbacks
-added new member variables
-players controlled by AI now receive (and send) multiplayer messages and can process them

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@595 4a71c877-e1ca-e34f-864e-861f7616d084
2006-08-20 14:48:14 +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 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
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
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