Sven Eberhardt
ebda8193ef
Replace NULL by nullptr in C++ sources
...
We don't support pre-C++0x any more, so nullptr should be fine everywhere (except in the plain C source files)
2016-11-02 19:58:02 -04:00
Lukas Werling
13fa0ab7b1
Implement adding/removing shaders from script
...
New script functions: AddFragmentShader, RemoveShader.
There is currently no support for adding vertex shaders.
2016-10-29 21:19:08 +02:00
Julius Michaelis
376ca5a9df
Prevent using USE_CONSOLE in lib{misc,c4script}
2016-10-22 17:42:23 +02:00
Armin Burgmeier
2362a73e60
FnSetSky: open Graphics.ocg before re-loading sky ( #1827 )
...
Needed to load shader slices in C4Sky::Init.
2016-10-16 10:04:54 -07:00
Lukas Werling
59b5525a41
Rework sky definition parsing
...
This also adds a broken SetSky() script function which was the main
motivation for the rework. See #1827
2016-10-15 13:34:39 +02:00
Maikel de Vries
679eedaf50
GetPathLength: add optional depth parameter
...
This is also exposed by the PathFinder defcore entry.
2016-09-25 21:48:19 +02:00
Lukas Werling
f7376169b9
Fix crash when starting a game in fullscreen mode
2016-09-08 21:26:59 +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
d70506ee2e
Improve GetDefinitionGroupPath script function
...
* Now works on _this instead of parameter
* Now works before editor window opened
2016-09-05 18:30:04 -04:00
Sven Eberhardt
41dde5e7d0
Add script function GetDefinitionGroupPath
2016-09-05 02:00:01 -04:00
Sven Eberhardt
16a770703a
Add IsEditor script function
...
Returns if the host is running in editor (not adjusted in savegames).
2016-07-21 00:24:52 -04:00
Maikel de Vries
6794b3b630
remove object component functionality from the engine
2016-05-21 13:34:34 +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
b00b8554ab
Merge branch script
2016-04-28 03:25:44 +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
50378ffda0
Script: CreateEffect starts effects that receive callbacks themselves
2016-04-28 01:08:04 +02:00
Lukas Werling
c349254d8b
Remove C4Particles.h include from C4Object.h
...
This reduces the number of files indirectly including PCG from ~50 to 7.
2016-04-25 21:24:27 +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
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
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
735f9cc06b
C4Landscape: Pull everything private out of the header
...
Since LTCG is enabled now, we don't have to define every function inside
the headers for ~xXx super speed xXx~, which means we can strip the
headers down to their bare minimum and reduce interdependencies and
therefore recompilation times by a lot.
2016-04-03 13:24:24 +02:00
Lukas Werling
19caa65b7b
Merge branch 'sdl-gamecontroller' (pull request GH-17)
2016-03-21 16:39:28 +01:00
Günther Brammer
b54ddc7663
Merge branch script
2016-03-01 03:04:17 +01:00
Günther Brammer
2fe0beebdb
Move contents of src/gamescript into other directories
...
C4Effect will get moved into the ScriptEngine, and just three source files
is a bit too little for one directory.
2016-02-02 02:57:46 +01:00