Commit Graph

9877 Commits (679eedaf50b60bb7ff8ec116e52be72b03b8c67e)
 

Author SHA1 Message Date
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
Maikel de Vries 0e76c85531 make line overlap check a global function
This avoids code duplication and really is a Math.c function.
2016-09-24 17:30:19 +02:00
Maikel de Vries fb38acb946 allow setting plr view/zoom at player start object 2016-09-23 20:21:34 +02:00
Maikel de Vries 18424aaaa7 add rule to control pump speed 2016-09-23 09:26:06 +02:00
Maikel de Vries 4c7d27ec64 bats require less space on placement 2016-09-23 09:18:57 +02:00
Maikel de Vries 3df960851c _inherited() for trees to access library functionality 2016-09-20 15:11:32 +02:00
Lukas Werling c3cf464a83 Editor: Fix scenario open filter (#1817) 2016-09-18 23:22:39 +02:00
Lukas Werling 880981ad31 Fix build on systems with non-long regex index types 2016-09-18 19:40:32 +02:00
Maikel de Vries 823b13d764 add simple string to integer conversion function
Just a basic one in C4Script for now.
2016-09-18 11:30:35 +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 db12ed7c99 Remove FindSubstring as it's really really slow
Use RegexSearch() instead, which is 100 times faster for large strings
(see benchmark results below).

Example benchmark:

    global func TestFindSubstring(int iterations)
    {
    	var result;
    	for (var i = 0; i < iterations; i++)
    	{
    		result = FindSubstring(hamlet, "and");
    	}
    	return result;
    }

    global func TestRegexSearch(int iterations)
    {
    	var result;
    	for (var i = 0; i < iterations; i++)
    	{
    		result = RegexSearch(hamlet, "and");
    	}
    	return result;
    }

    global func RunBenchmark(int iterations)
    {
    	StartScriptProfiler();
    	Log("FindSubstring: %d iterations", iterations);
    	var substr = TestFindSubstring(iterations);
    	Log("RegexSearch: %d iterations", iterations);
    	var regex = TestRegexSearch(iterations);
    	StopScriptProfiler();

    	if (!DeepEqual(regex, substr))
    		Log("Results differ: %v vs %v", substr, regex);
    }

Results:

    FindSubstring: 100 iterations
    RegexSearch: 100 iterations
    Profiler statistics:
    ==============================
    48903ms      Global.FindSubstring
    48903ms      Global.TestFindSubstring
    47979ms      Global.TakeString
    00504ms      Global.TestRegexSearch
    00016ms      Global.PushBack
    ==============================
2016-09-17 20:08:43 +02:00
Lukas Werling b614209593 SDL: Use OpenGL 3.1 if 3.2 is not available (like WGL) 2016-09-17 12:32:18 +02:00
Nicolas Hake 6a6f4520d3 Merge pull request GH #25 from Mailaender/appdata
Added a Linux AppData file
2016-09-17 11:55:43 +02:00
Nicolas Hake 59173dbd12 Merge pull request GH #27 from lheckemann/master
Require Qt 5.4+ for editor — needs QOpenGLWidget
2016-09-17 11:03:00 +02:00
Linus Heckemann 355b6fe070 Require Qt 5.4+ for editor — needs QOpenGLWidget 2016-09-17 08:23:07 +01:00
Lukas Werling d7cd224a4f Add functions RegexReplace, RegexSearch and RegexMatch 2016-09-16 23:46:03 +02:00
Maikel de Vries 4b54b86d30 add function to find substrings 2016-09-16 17:25:22 +02:00
Mark ae1de739b0 Wooden Bridge: Return other bridge in CombineWith()
Apparently the return value is not used anywhere; the change allows chaining multiple bridges in a comfortable call.
2016-09-15 19:25:16 +02:00
Mark 58d42b8fd8 Library Lamp: Extracted functions.
Did this change a long time ago, probably for re-using functions in a derived object.
2016-09-15 19:17:17 +02:00
Sven Eberhardt 0cdad64934 Fix goal and rule displays (#1811) 2016-09-14 21:46:16 -04:00
Sven Eberhardt 22af9f0e8c Fix landscape placement functions (#1820, #1821) 2016-09-14 21:30:57 -04:00
Sven Eberhardt 61b1ab08ad Editor: More shortcuts; show helper shortcuts in tools menu 2016-09-10 01:17:40 -04:00
Sven Eberhardt d3d7256fec Fix missing achievement in Krakatoa's Krach (#1819) 2016-09-10 01:17:39 -04:00
Lukas Werling 8d9657a800 Change default puncher address to netpuncher.openclonk.org 2016-09-09 18:31:39 +02:00
Sven Eberhardt 2490ef4584 Editor: Add more shortcut keys 2016-09-09 00:56:16 -04:00
Sven Eberhardt e67e429fef Editor: Improve default layout and raise proper dialogues on tool change 2016-09-09 00:56:15 -04:00
Lukas Werling c41f93a2f6 Fix c4script and mape build 2016-09-08 21:45:30 +02:00
Lukas Werling f7376169b9 Fix crash when starting a game in fullscreen mode 2016-09-08 21:26:59 +02:00
Lukas Werling 7177c261b3 Bring back and fix the netpuncher
As carrier-grade NATs are becoming common, many players cannot host
Clonk games at all. The simple STUN-like netpuncher from Clonk Rage
which was removed three years ago is already effective against some
DS-Lite NATs.

With some extensions, we should be able to make it work with more
restrictive NATs as well.

This reverts commit 72002cc366.
2016-09-08 21:10:06 +02:00
Sven Eberhardt 53b365a6d2 Editor: Add shortcuts, menu items, tooltips 2016-09-08 01:56:01 -04:00
Sven Eberhardt 0e02bad837 Editor: Disable reinit scenario button if no scenario is loaded 2016-09-08 00:25:17 -04:00
Sven Eberhardt b95d1387a4 Editor: Add "reset to saved scenario" command 2016-09-07 01:53:54 -04:00
Sven Eberhardt 856730aabd Fix some signed/unsigned warnings 2016-09-07 01:53:54 -04: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
Lukas Werling 3d5f2f012a Fix openclonk-server build 2016-09-06 22:12:06 +02:00
Maikel de Vries f76e056cea add new items to knowledge in worlds 2016-09-06 17:06:05 +02:00
Maikel de Vries 17f98bd235 add helper functions chars 2016-09-06 17:06:05 +02:00
Sven Eberhardt a882a6e64b Fix black editor screen due to GL object creation and removal in wrong context 2016-09-06 02:45:17 -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 282a561462 Add editor props and user actions for boiling lava and acid
Also optimize the timer
2016-09-06 00:06:37 -04:00
Sven Eberhardt 6aeeff0545 Add Library_Stackable editor props 2016-09-05 20:19:25 -04:00
Sven Eberhardt db986e3dd7 Allow repeated ejection of infinite material stack counts in bucket and barrel 2016-09-05 20:08:30 -04:00
Sven Eberhardt 3330c592e3 Improve PlayerStart initial material setting to allow specification of weapon ammo, stackable stack count and liquid contents 2016-09-05 20:01:47 -04:00
Sven Eberhardt ba371db0e6 Editor property enum delegate: Improve grouping when an item is also a group 2016-09-05 19:19:33 -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 34058e13f9 Fix default assignment of selected object in user action filtered object evaluators 2016-09-05 02:00:00 -04:00