Armin Burgmeier
836927d93c
Don't leak static proplists with cyclic references
...
If a local variable in a definition was set to a proplist inside the
Definition() callback, and that proplist contained cyclic references
then those references were leaked. Typically cyclic references for
script-created proplists are broken in
C4PropListScript::ClearScriptPropLists, however definition proplists
are changed to be static proplists in
C4PropList::FreezeAndMakeStaticRecursively.
To fix this, each script host maintains a list of proplists made static
by FreezeAndMakeStaticRecursively, and explicitly deletes all of these
proplists on Clear().
This leak also leads to an assertion failure inside
C4PropListScript::ClearScriptPropLists in debug mode, and can also be
observed by C4PropList::PropLists not being empty after game clear.
The definition in Objects.ocd/Helpers.ocd/UserAction.ocd constructs
cyclic proplists in its Definition() call. A simpler, more minimal way
to provoke the leak is the following (it provokes the leak but not the
assertion failure):
local bla;
func Definition(def)
{
bla = {};
bla.test = { Name="Test222" , Options = { Name="Test333" } };
bla.test.Options.Link = { Name="Test444", Blub=bla.test };
}
2016-09-30 17:50:41 -10:00
Lukas Werling
8a09fcc1b1
Increase REPL output depth to 10 (from 1)
...
This makes working with nested arrays and proplists a lot less annoying.
2016-09-26 16:33:24 +02:00
Lukas Werling
880981ad31
Fix build on systems with non-long regex index types
2016-09-18 19:40:32 +02:00
Lukas Werling
fbb8ad5d87
Add RegexSplit()
2016-09-18 11:10:19 +02:00
Lukas Werling
219f81f004
Regex: Fix off-by-one error
2016-09-18 10:49:06 +02:00
Lukas Werling
619ad27a91
Regex: Fix infinite loop with zero-length matches
2016-09-18 01:16:06 +02:00
Lukas Werling
d7cd224a4f
Add functions RegexReplace, RegexSearch and RegexMatch
2016-09-16 23:46:03 +02:00
Sven Eberhardt
2c20204021
Add C4SECT_ReinitScenario flag for LoadScenarioSection
...
This also resets the script engine and does player init callbacks. Useful to restart the scenario in the editor.
2016-09-07 01:53:53 -04:00
Sven Eberhardt
5523e685fb
Fix script engine assertion on game clear
2016-09-06 01:13:53 -04:00
Sven Eberhardt
dee6086e1d
Fix access violation in proplist-to-static conversion
2016-09-06 01:09:29 -04:00
Sven Eberhardt
31121d682c
Rename option default value function property to DefaultValueFunction
...
It was "Get" and later "Set", which was always a bit confusing.
2016-09-01 18:32:24 -04:00
Sven Eberhardt
6b9df3118c
Sort UserAction evaluators and groups by name
...
Also merge effect group into ambience group.
2016-08-27 16:46:59 -04:00
Sven Eberhardt
e4b4246500
Fix freezing and assignment of static names to child proplists created in Definition()-callbacks ( #1798 )
...
Also adjust editor props for the change:
1. enum needs to create a copy, not a reference for the default value of an option if it is defined inline
2. Always use proper GetName() resolution on property group names even if a static name would be available
2016-08-27 02:04:03 -04:00
Sven Eberhardt
5d6ecc8dc8
Fix possible hang on effect execution with timer=1
...
If a timer=1-effect registered another timer=1-effect into the same object, it could cause an endless loop. This happened if the timer in the sequence object was set to 1.
2016-08-18 00:14:19 -04:00
Sven Eberhardt
4581022411
Fix an aul preparser crash on DirectExec functions parsing
...
GetLastRetType doesn't work because the preparser does not generate code.
The code looks a bit like this line just got lost somehow?
2016-08-08 15:26:25 -04:00
Sven Eberhardt
fc24969899
Add EditorPlacementLimit property
...
Limits the number of object instances that can be placed of a given def.
2016-08-06 02:36:53 -04:00
Sven Eberhardt
bce09d272d
Add EditorInitialize callback
2016-08-04 22:12:10 -04:00
Sven Eberhardt
24a5dc33db
Qt editor: Sort properties in property list by localized name and priority
2016-08-02 01:12:08 -04:00
Sven Eberhardt
b1a1df8dee
Add eval parameter to not pass errors
2016-07-31 08:15:54 -04:00
Sven Eberhardt
18444c7e0d
Add StringToIdentifier script function
...
Required to sanitize variables in the editor. Works by stripping all non-identifier characters and preprending a _ if necessery.
2016-07-30 21:43:01 -04:00
Sven Eberhardt
442b8e66df
Qt Editor: Add short name for enum delegate options displayed as sub-delegate
2016-07-30 14:50:07 -04:00
Sven Eberhardt
37885a2e4f
Qt Editor: Add AllowEditing flag for enum delegates.
...
Used for sound delegate
2016-07-28 00:24:28 -04:00
Sven Eberhardt
ee88a36f73
Qt Editor: Rename EditorInfo to EditorHelp
...
Fits better with "UsageHelp" and is more precise.
2016-07-24 23:10:43 -04:00
Sven Eberhardt
534e4cc745
Merge branch 'master' into qteditor
...
Conflicts:
src/script/C4AulParse.cpp
2016-07-24 10:23:57 -04:00
Sven Eberhardt
4245f60e83
Qt Editor: Add help/description label for current selection
2016-07-24 10:12:38 -04:00
Sven Eberhardt
14d01cd5cd
Qt Editor: Add EmptyName option for def property to rename the "nil" entry
2016-07-22 00:28:01 -04:00
Sven Eberhardt
4fad947980
Qt Editor: Add Set function options SetGlobal and SetRoot
2016-07-21 00:24:53 -04:00
Sven Eberhardt
d605bab0be
Qt Editor: Move EditorActions from EditorAction_* to a proplist EditorAction.*
2016-07-14 00:17:53 -04:00
Sven Eberhardt
28d2172b78
Qt Editor: Move editor props from EditorProp_* to an EditorProp proplist
2016-07-13 17:18:08 -04:00
Sven Eberhardt
d9f31b006b
Add ReplaceString script function
2016-07-13 02:12:31 -04:00
Lukas Werling
2127e78db1
Fix c4script build
2016-07-07 22:50:13 +02:00
Lukas Werling
791315a54e
Fix #include-in-#appendto, but discourage with a warning
2016-07-07 21:13:18 +02:00
Nicolas Hake
dcd8d9676a
Fix unloading scenarios with Map.c or System.ocg scripts ( #1778 )
...
Destruction order matters!
2016-07-07 14:39:18 +02:00
Nicolas Hake
4725043493
Def unload: Fix overloaded function refcount
2016-07-07 14:34:24 +02:00
Sven Eberhardt
85c5deb099
Qt Editor: Add option to auto-select objects created by an EditorAction
...
To be used by the dialogue so you can press a button on the clonk to add and immediately configure a dialogue.
2016-07-07 01:36:58 -04:00
Nicolas Hake
7ff8c4f95a
Remove references to functions defined in unloading defs ( #1776 )
2016-07-06 14:41:22 +02:00
Sven Eberhardt
990b6ea8f1
Qt Editor: Add option to descend directly into a subpath from array and sequence property delegates
2016-07-06 00:56:08 -04:00
Sven Eberhardt
62c1f4bda5
Qt Editor: Add callback support for dynamic enum values in Enum delegates
2016-07-04 13:21:30 -04:00
Sven Eberhardt
b34ae09437
Fix utility builds
2016-06-21 21:48:10 -04:00
Sven Eberhardt
a7aa89f168
Merge branch 'master' into qteditor
...
Conflicts:
planet/Objects.ocd/Structures.ocd/StoneDoor.ocd/SpinWheel.ocd/Script.c
src/platform/C4WindowSDL.cpp
src/script/C4AulParse.cpp
src/script/C4Effect.cpp
2016-06-20 22:27:03 -04:00
Sven Eberhardt
068004d9af
Remove unused variable in C4AulExec
2016-06-20 15:50:36 -04:00
Sven Eberhardt
c6e4bfd585
Aul: Add DirectExec method for executing a complete function definition.
2016-06-20 01:37:04 -04:00
Sven Eberhardt
34289fa18a
Qt Editor: Add EditorActions.
...
Replacing the old EditCursorCommands (which nobody knew). Objects now publish their commands directly on the property viewer.
2016-06-19 00:08:09 -04:00
Sven Eberhardt
a7bd20a927
Fix server and utility build
...
Adding missing C4DefList::SortByPriority() stub
2016-06-18 10:35:54 -04:00
Sven Eberhardt
ad863836b3
Qt Editor: Add groups to enum
2016-06-15 00:15:47 -04:00
Sven Eberhardt
397dbd867a
Add DefinitionPriority property to control call order of Definition()-callbacks.
2016-06-07 18:22:43 -04:00
Sven Eberhardt
16e31098b4
Qt Editor: Improve proplist and array display/editing
...
* Add/Remove element buttons
* Display customization of user delegates
2016-06-06 01:54:05 -04:00
Sven Eberhardt
4d04135cda
Fix GetPropertyBool default value when descending into prototype [Guenther]
2016-06-03 20:17:20 -04:00
Sven Eberhardt
b10da0629d
Qt Editor: More EditorProps types (string, array) and attributes (EditOnSelection, DefaultEditorProp)
2016-06-03 01:20:43 -04:00
Günther Brammer
57a35bf01b
Don't crash on functions declared inside other functions
...
Declaring a local variable inside any function works the same way as
declaring it in top-level scope, which gets a bit weird if done inside a
function inside a constant proplist, but is at least consistent.
Thanks to Flinti for reporting this.
2016-05-25 01:06:10 +02:00
Sven Eberhardt
8a5dbdc73f
Qt Editor: More shape prop storage options
2016-05-23 19:22:49 -04:00
Nicolas Hake
3fd1187833
Don't overload CompileNewFunc with rvalue reference parameters
...
We don't need to pass the C4ValueNumbers* as a rvalue reference, and
doing so needs const qualifiers on MSVC.
2016-05-21 12:56:57 +02:00
Günther Brammer
d23ffde361
Merge script branch
2016-05-15 19:21:26 +02:00
Günther Brammer
6763f2b5c7
Silence complaints about missing functions in EffectCall ( #1736 )
...
All the other effect callbacks silently ignored missing functions, either
by using the Call variant that doesn't complain about it, or checking for
the missing function themselves.
2016-05-15 19:20:43 +02:00
Günther Brammer
0559a93f88
Script: CreateEffect effects do not get their target in callbacks
...
They can use the Target property instead.
2016-05-15 15:20:08 +02:00
Günther Brammer
3aa6978c4e
Script: Effects have their target as a property "Target"
2016-05-15 15:17:18 +02:00
Günther Brammer
c0d32f8f4e
Remove redundant target parameters from effect implementation
2016-05-15 15:17:17 +02:00
Günther Brammer
6aaf7cd2ef
Store a pointer to the effect target in the effect itself
2016-05-15 15:17:17 +02:00
Günther Brammer
408ac90cd7
Scenario effects: Use Scenario and not Scenario->GetPrototype() as this()
2016-05-15 15:17:17 +02:00
Günther Brammer
f927717458
CreateEffect initializes the name of the new effect
...
Effects with prototypes were supposed to inherit their names from the
prototype, but the effect prototypes are also supposed to get their names
from ParentKeyName, which is not inherited. Maybe that'll change, but for
now this matches how old effects work.
2016-05-15 15:17:17 +02:00
Günther Brammer
5c6a805fd5
Add move constructor to C4Value
2016-05-15 15:17:17 +02:00
Günther Brammer
9e8d644a26
StdAdaptors: Make mkParAdapt(mkPtrAdaptNoNull(), Par1, Par2) work
...
Employ variadic template arguments and more rvalue references for this.
Sadly, StdParameterAdapt itself is even more complicated, since it has to
store the parameters instead of just forwarding them, so the limit is still
two parameters. But that's twice as much as before in many cases.
2016-05-14 22:59:59 +02:00
Nicolas Hake
511e3bbb36
Aul: Deprecate implicit conversion from 0 to object/proplist/def/string
...
Instead of (int)0, nil should be used to signify "no object" etc.
2016-05-13 16:28:45 +02:00
Nicolas Hake
370a1dd3d1
Aul: Re-enable parameter type checking after AST rewrite
2016-05-13 16:22:37 +02:00
Nicolas Hake
3217fbf55b
C4AulScriptFunc::AddPar: Accept type in addition to name
...
This way, we don't have to first add the parameter and then set the type
afterwards via internal members.
2016-05-13 16:22:00 +02:00
Nicolas Hake
eca8f2cce8
Aul: && returns either parameter, not bool
2016-05-13 16:20:17 +02:00
Nicolas Hake
43c6f946dd
Aul: Split assignment op from standard BinOp
...
Assignment was special-cased everywhere, so it can just as well get a
separate AST node.
2016-05-13 13:50:29 +02:00
Nicolas Hake
daf3424e63
Delete some commented-out legacy function parameters
2016-05-13 13:14:23 +02:00
Nicolas Hake
092a23c2f7
Aul: Parse scripts into an AST, then generate bytecode from that
...
This commit contains a fairly substantial rewrite of the C4Script code
generator. Instead of generating bytecode while parsing the script,
we're now parsing the script into a syntax tree, and have any further
processing happen on that instead of the raw source.
At this time, the code generator emits the same bytecode as the old
parser; there are several optimization opportunities that arise from the
new possibility to emit code out of order from its specification by the
author.
Compared to the old compiler, this one is still rather deficient when
dealing with incorrect code; it's also not emitting several warnings
that used to be diagnosed.
2016-05-12 19:43:48 +02:00
Nicolas Hake
78e5f8528d
C4PropList::GetParent: make const
2016-05-12 18:47:53 +02:00
Nicolas Hake
5872b5e8ae
C4AulFunc::GetFullName: make const
2016-05-11 17:15:47 +02:00
Nicolas Hake
10abb1bbdb
Remove unused C4AUL_CodeBufSize
2016-05-11 17:15:47 +02:00
Nicolas Hake
a100b93e7f
DEBUG_BYTECODE_DUMP: Allow setting from build system
2016-05-11 17:15:47 +02:00
Nicolas Hake
16641d3841
C4AulScriptFunc::DumpByteCode: properly align BCC names
...
The old code just appended eight spaces when the type of the BCC was
shorter than eight chars.
2016-05-11 17:15:47 +02:00
Nicolas Hake
26334cb4d7
Aul: Join AB_INT + AB_Neg
2016-05-09 12:33:59 +02:00
Nicolas Hake
34556e3e81
Aul: Join AB_STRING+AB_ARRAYA to AB_PROP
2016-05-09 12:33:58 +02:00
Nicolas Hake
33f7fb935f
C4AulCompiler: Rename iStack to stack_height
2016-05-09 12:33:51 +02:00
Nicolas Hake
41000a8f9a
C4AulCompiler: Rename pLoopStack to active_loops
2016-05-09 12:21:33 +02:00
Nicolas Hake
d0dbe05876
C4AulCompiler: Rename fJump to at_jump_target
...
You have no idea how much I hate systems hungarian.
2016-05-09 12:21:33 +02:00
Nicolas Hake
f0b4ef46a5
GetStackValue: Remove "default: /* unreachable */"
...
Without an explicit default case, the compiler can warn about unhandled
enum values inside the switch.
2016-05-09 12:21:33 +02:00
Nicolas Hake
7a135a060f
C4AulParse: Take GetTokenName out of public interface
2016-05-09 12:21:33 +02:00
Nicolas Hake
0a3b31e735
C4AulParse::AddVarAccess: Move to C4AulCompiler
2016-05-09 12:21:33 +02:00
Nicolas Hake
0342711cd4
C4AulCompiler: Take GetStackValue out of public interface
2016-05-09 12:21:33 +02:00
Nicolas Hake
792e12adad
C4AulCompiler: Split into separate file
2016-05-09 12:21:33 +02:00
Nicolas Hake
c8d71d47c0
C4CodeGen: Rename to C4AulCompiler
...
I need to split up C4CodeGen into smaller parts, and having the bit that
actually generates the bytecode named C4CodeGenCodeGen would be silly.
2016-05-09 12:21:33 +02:00
Günther Brammer
69427a484a
C4AulParse: Check for function names after '->' with the helper function
2016-05-05 02:47:17 +02:00
Günther Brammer
994cb52cea
C4AulParse: Don't escape spaces in bytecode dumps of strings
2016-05-05 02:38:36 +02:00
Günther Brammer
99f704fbb8
Script: Prevent writes to constant arrays
2016-05-05 02:10:41 +02:00
Günther Brammer
9741af42fd
Replace all usages of the old local variables list with properties
2016-05-01 00:28:37 +02:00
Günther Brammer
7792acdff0
Script: Check for functions before keywords
...
This unifies the lookup for local variables and functions. Its slightly
awkward that global functions can overload if and Par now, but local
variables already could.
2016-05-01 00:28:37 +02:00
Günther Brammer
30f7457d89
Remove unused macros leftover from removed script features
2016-05-01 00:28:37 +02:00
Günther Brammer
b8f2d0ca87
Script: Repeat the parser error message when executing a broken function
2016-05-01 00:28:37 +02:00
Günther Brammer
17b18da26c
Make bytecode dump work again
...
Dumping the bytecode before adding EOFN while depending on that to signal
the end isn't such a hot idea.
2016-05-01 00:28:37 +02:00
Günther Brammer
904bf78d68
Don't crash when deserializing an effect with object command target ( #1730 )
2016-04-29 00:16:20 +02:00
Günther Brammer
4092911349
Move code generation into its own class
2016-04-28 03:25:47 +02:00
Günther Brammer
b00b8554ab
Merge branch script
2016-04-28 03:25:44 +02:00
Günther Brammer
d45ac946fe
Add C4AulParseError constructor and cease reusing it for warnings
...
The nontrivial code that formats the position is now a function of
C4AulParse used by both warnings and errors.
2016-04-28 02:59:12 +02:00
Nicolas Hake
a8f4bd3960
C4AulParseError: Avoid the second string parameter
...
While I'm not a big fan of hiding flow control in a function, Error()
handles formatting and saves me from calling FormatString().getData() a
lot.
2016-04-28 02:59:12 +02:00
Günther Brammer
4b43576f83
Script: Complain about some attempts to Call nonexistant function again
...
This code got lost in the function pointer rewrite.
2016-04-28 02:59:12 +02:00
Günther Brammer
3760363a3b
Script: Add GetPrototype and SetPrototype functions
...
This should eventually replace the Prototype property, so that proplists
can be used as a key-value-storage without any hidden gotchas.
The Prototype is such a magical property that any code dealing with all
properties has to special-case it anyway, and isn't even returned by
GetProperties().
2016-04-28 02:59:11 +02:00
Günther Brammer
525cdc11a3
Deduplicate calculation of the relative stack position of local variables
2016-04-28 02:59:11 +02:00
Günther Brammer
071feaa78f
Deduplicate loop control handling in the script parser
2016-04-28 02:59:11 +02:00
Günther Brammer
efd4724084
Script: Add Scenario effects
...
These work just like global effects, except that effects from CreateEffect
get the scenario as target parameter in the callbacks.
2016-04-28 02:53:21 +02:00
Günther Brammer
97406d24d2
Script: Add Construction and Destruction effect callbacks
2016-04-28 01:08:04 +02:00
Günther Brammer
50378ffda0
Script: CreateEffect starts effects that receive callbacks themselves
2016-04-28 01:08:04 +02:00
Sven Eberhardt
881534bee0
Qt Editor: Shape properties
2016-04-25 16:17:10 -04:00
Lukas Werling
aeabe28d82
Remove AsyncRandom() script function
...
We couldn't think of any reason you'd want to use this over regular
Random() in script.
2016-04-25 17:18:07 +02:00
Günther Brammer
e5cfb1858f
Script: GetName() can return the property a proplist was defined in
...
This means that the ActMaps do not need to repeat their name anymore,
provided that all Scripts use GetName() instead of directly accessing .Name.
2016-04-24 19:40:29 +02:00
Günther Brammer
5a470f51f8
Move Effect functions to C4Script.cpp
2016-04-24 19:40:29 +02:00
Günther Brammer
2cdf553953
Change effect list getting function parameter type to C4PropList*
...
This makes it possible to move the effect functions to C4Script.cpp.
2016-04-24 19:40:29 +02:00
Günther Brammer
e8811a7b21
Move global effects from ::Game to ::ScriptEngine
...
This even enables some simplification in the CompileFuncs, since the global
effects were already put in the same section as the other ScriptEngine
parts. The callback for updates due to relinks also fits nicely.
The reset in C4Game::Default was redundant with C4Game::Clear already.
2016-04-24 19:40:28 +02:00
Günther Brammer
e2c6c2a841
Do not use C4Object in C4Effect
...
Instead, the pointer to the effect list is passed to the functions that
previously used the object to determine it.
2016-04-24 19:40:28 +02:00
Günther Brammer
c89e73608b
Unite getting the effects list from a C4Object pointer into a function
...
This way, that function can be re-implemented in standalone c4script.
2016-04-24 19:40:28 +02:00
Günther Brammer
42a15e3be9
Convert C4Effect parameters that do not need to be C4Object* to C4PropList*
2016-04-24 19:40:28 +02:00
Günther Brammer
bfb9b6b1fd
Drop the roundtrip through C4ID for the effect C4Def command target
...
Unfortunately, this complicates the C4Effect::CompileFunc to stay
compatible.
2016-04-24 19:40:27 +02:00
Günther Brammer
632c5cbd0f
Refactor effect callbacks into helper functions
2016-04-24 19:40:27 +02:00
Günther Brammer
e22ca51f72
Don't leak references to Strings on script errors ( #583 )
2016-04-24 19:40:27 +02:00
Günther Brammer
5fbac346d3
Incompatible type warnings work for parameters with type declarations
2016-04-24 19:40:27 +02:00
Günther Brammer
55572720bc
Make the C4ScriptHost a ComponentHost again
2016-04-24 19:40:27 +02:00
Günther Brammer
fb76308812
Make C4ValueConv::Type a constexpr variable instead of an inline function
2016-04-24 19:40:26 +02:00
Nicolas Hake
19a3d43558
Fix definition of explicitly sized enums
2016-04-24 15:20:28 +02:00
Nicolas Hake
baad3aef3c
C4ScriptHost: add const proplist accessor
...
This accessor does not need to be virtual itself, because we don't want
people to override it; it calls the nonconst accessor anyway, which is
virtual.
2016-04-24 14:01:23 +02:00
Nicolas Hake
96223f154c
C4ValueMapNames: mark GetItemNr const
...
It doesn't change anything, so callers don't need a nonconst object.
2016-04-24 14:01:23 +02:00
Nicolas Hake
caf44e2473
Remove specious space from Aul operator table
2016-04-24 14:01:23 +02:00
Nicolas Hake
770be2dafe
Aul: Allow AB_ERR to carry more detailed error information
2016-04-24 14:01:23 +02:00
Nicolas Hake
367f58b1cc
C4AulParseError: Enable creation from host and source pointer
...
Instead of having a C4AulParseError constructor read the location data
from the parse state, allow explicit construction from a known location.
2016-04-24 14:01:23 +02:00
Nicolas Hake
cfdb1142b8
Move C4AulParse declaration into separate header
2016-04-24 14:01:23 +02:00
Sven Eberhardt
c0228be4e7
Qt Editor: More editor property types and functionality
2016-04-16 22:05:35 -04:00
Sven Eberhardt
2a2fc68e3f
Qt Editor: Add user properties
2016-04-09 14:29:02 -04:00
Nicolas Hake
aa06b3b6f6
C4AulParse: Drop unused ATT_STAR
...
ATT_STAR has been rolled into ATT_OPERATOR and is no longer used
anywhere.
2016-04-07 20:52:31 +02:00
Nicolas Hake
f963a398aa
Define NORETURN annotation for MSVC
2016-04-07 20:52:28 +02:00
Sven Eberhardt
879d501592
Merge remote-tracking branch 'remotes/origin/qteditor' into qteditor
...
Conflicts:
src/editor/C4ConsoleQtPropListViewer.cpp
src/editor/C4ConsoleQtPropListViewer.h
src/script/C4ValueArray.cpp
2016-04-04 19:34:02 -04:00
Sven Eberhardt
98c36e5955
Qt Editor: Implement setting of properties
2016-04-03 23:46:58 -04:00
Sven Eberhardt
e8f48fd53e
Qt Editor: Win32 build fixes
2016-04-03 23:46:20 -04:00
Nicolas Hake
9dddf289db
Merge branch 'master' into qteditor
2016-04-03 21:06:32 +02:00
Nicolas Hake
eabca223f5
Update all copyright notices for 2016
2016-04-03 20:24:42 +02:00
Nicolas Hake
493c276126
Rewrite header inclusions to #include "path/to/file.h" style
2016-04-03 20:24:42 +02:00
Nicolas Hake
0537df5f23
C4Object: Move C4Def.h dep out of header
...
C4Def is only ever used as a pointer inside C4Object.h, so we don't need
to include C4Def.h from it.
2016-04-03 13:24:26 +02:00
Maikel de Vries
d6b963d321
remove unused LineMaxDistance property
2016-03-22 22:26:46 +01:00
Günther Brammer
b54ddc7663
Merge branch script
2016-03-01 03:04:17 +01:00
David Dormagen
4c6d347c4d
C4ValueArraySortStringscomp: silenced string-to-bool-conversion warning
...
VisualStudio gave a "performance warning" about this implicit cast. I actually don't know why, but this change makes the intention clearer anyway (since we are not returning the string contents but just whether they exist). So it's probably not bad regardless of whether the warning is weird.
http://stackoverflow.com/questions/1847860/why-is-there-a-performance-warning-on-cast-pointer-to-bool
2016-02-27 11:42:37 +01:00
Sven Eberhardt
771a333e21
Qt Editor: Add effects to object list view + fixes
...
Also remove cache of C4Values and use callbacks on object and effect deletion instead.
2016-02-21 22:23:42 -05:00
Sven Eberhardt
2af22ee824
New editor (Qt-based)
...
Work in progress. So far only for Windows.
2016-02-15 08:38:06 -05:00
Günther Brammer
0c0c64642a
Remove unused #define in C4AulParse
2016-02-12 17:15:46 +01:00
Maikel de Vries
159dbf071f
make ContactCalls a property instead of DefCore entry
...
This allows for useful runtime changes, like disabling contact calls when an animal dies.
2016-02-08 21:25:43 +01:00
Günther Brammer
fdbad8fe83
Simplify the test for loop end in parameter parsing
...
Instead of storing in fDone whether the token is a ')', make that the loop
condition.
2016-02-02 02:57:50 +01:00
Günther Brammer
f1b99aa355
Avoid pushing and popping an unused parameter with ...
2016-02-02 02:57:49 +01:00
Günther Brammer
6a6c0d8b0b
Optionally warn about too many parameters in -> calls, too
...
While at it, only consult the right function for direct calls, not any
other function with the same name.
2016-02-02 02:57:49 +01:00
Günther Brammer
b2c263bd0e
Don't mark the condition of do-while as a jump target without a continue
...
In contrast to the other loops, where the condition is always jumped to.
2016-02-02 02:57:49 +01:00
Günther Brammer
00f013d59e
Optimize accessing the same variable as was just now set
2016-02-02 02:57:49 +01:00