Commit Graph

9908 Commits (685513816fb04e37565890e47b951287923c9c51)
 

Author SHA1 Message Date
Sven Eberhardt 685513816f Editor: Raise focused viewport dock.
When switching viewports using F10, the selected dock may have been hidden
2016-10-08 19:15:27 -04:00
Sven Eberhardt 9e150f2bfb Viewport zoom towards center and fix scrolling 2016-10-08 19:15:26 -04:00
Mark 7c169c7905 Moved object interaction menu sidebar icons to separate overloadable functions 2016-10-08 17:46:39 +02:00
Lukas Werling eff406a181 Fix plain --lobby not working 2016-10-06 21:19:31 +02:00
Maikel de Vries 2505dc77f1 add room door to Decoration.ocd
This is a door which leads to nowhere, but they can be connected via script or serve other purposes. Graphics by Apfelclonk.
2016-10-06 18:43:04 +02:00
Armin Burgmeier 561651b715 Fix issues with resolution switching on Linux
* Engine would always open up in Fullscreen and then switch to Windowed
   instead of just starting up as Windowed.

 * Could not change resolution because bit depth or refresh rate did not match
   * handle RefreshRate==0 as "any", just like windows

   * Remember refresh rate in combo box that enumerates all the modes and
     propagate to video mode setting instead of assuming all modes have the
     same refresh rate.

   * Report bit depth as 32 even if SDL tells us it's 24. Other parts of the
     code require it to be equal to 32, but 24 works just fine.

 * Changing from fullscreen to windowed when "Screen" was selected in
   resolution combo box (i.e. iXRes==-1) makes the window tiny (0x0 pixels).
2016-10-05 21:38:46 -07:00
Clonkonaut f37eda9508 Moved HUD proplist definitions to separate, overloadable functions.
See http://forum.openclonk.org/topic_show.pl?pid=32552#pid32552 for more information.
2016-10-06 01:47:45 +02:00
Lukas Werling ddb34ab5cb Disallow interaction with actively controlled Clonks
This prevents inventory stealing which is undesirable in cooperative
scenarios with competitive elements (e.g. some races) and confusing to
players.
2016-10-05 22:14:40 +02:00
Armin Burgmeier 25b1a49543 Set last error when setting resolution fails
The last error is displayed in the GUI, so until now there was just a "(null)"
string there.

The whole (SDL) resolution switching code is completely broken as well, but
that's a different story...
2016-10-03 22:39:46 -07:00
Maikel de Vries 89be9bd158 implement scenario saving for liquid tank, pump & pipe 2016-10-03 18:07:49 +02:00
Sven Eberhardt 4756fb0ba1 Unify moving brick graphics size.
Otherwise, there were still graphics artifacts sometimes.
2016-10-03 00:02:46 -04:00
Sven Eberhardt 76ce8089af Fix display of moving bricks with size<4. 2016-10-02 23:47:02 -04:00
Sven Eberhardt d48dbfba82 Add optional size parameter to Particles_Flash 2016-10-02 23:47:01 -04:00
Lukas Werling bca0c76331 Lower minimum masterserver update interval to 1s
This interval is critical for the netpuncher. Clients have to wait for
the first masterserver update before they can join.
2016-10-03 00:05:23 +02:00
Maikel de Vries 1483620b2b fix c4script runtime error in power system when pump is initialized 2016-10-02 23:23:20 +02:00
Maikel de Vries 48d98d708e fix script error in keypad 2016-10-02 08:03:14 +02:00
Maikel de Vries b0ff00439f fix possible script error in pump 2016-10-01 19:18:23 +02:00
Maikel de Vries 2073fb0f0a improve picture graphics of animals 2016-10-01 16:32:29 +02:00
Maikel de Vries 1eb17613bc keypad: allow alternative graphics for its buttons 2016-10-01 16:32:29 +02:00
Maikel de Vries df43ab86f2 add IsAnimal to animals for finding them 2016-10-01 16:32:29 +02:00
Sven Eberhardt 9299ec4223 Fix max energy in AI test scenario 2016-10-01 10:26:43 -04:00
Sven Eberhardt b317afbadc Fix division by zero on progress bars with max=0 2016-10-01 10:26:25 -04:00
Sven Eberhardt d35fc728bf Fix DrawParticleLine documentation and example #1823 2016-10-01 10:19:40 -04:00
Sven Eberhardt d04476ad0b Allow oversize and rotation of fence 2016-09-30 22:23:11 -04:00
Sven Eberhardt 0604a815d0 Fix undefined constant in keypad 2016-09-30 21:40:57 -04:00
Maikel de Vries fa977149e9 make firefly use insect swarm library 2016-09-30 18:58:42 +02:00
Maikel de Vries b42a4b824b insect swarm: fix movement issues 2016-09-30 18:58:42 +02:00
Armin Burgmeier 732fff3029 Fix possible use of uninitialized variables
For example, creating a C4WindowSDL and deleting it without calling
::Init() on it would lead to use of uninitialized variables.
2016-09-27 21:52:55 -10:00
Maikel de Vries 32f5b1cb25 add keypad to decoration objects
This can control lots of things and triggers on entering the correct code.
2016-09-26 17:15:37 +02: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 10622a9b61 Add generic A* implementation for path finding in graphs 2016-09-26 16:30:47 +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
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