Commit Graph

114 Commits (master)

Author SHA1 Message Date
Tushar Maheshwari 3a4f49ad90 Revisit #includes
Consolidate the include statements scattered across the code in accordance
with the comment in C4Include.h. The advantages are listed in the same
comment.
Furthermore, it follows llvm-include-order which is the logical
extrapolation of the project's style guideline wherever possible
(C4Include.h being the most-frequent exception).
2017-05-15 13:24:59 +02:00
Tushar Maheshwari e58a7884e4 Automatic fixes using clang-tidy
See http://forum.openclonk.org/topic_show.pl?tid=3376 for discussion.

Close GH-41
2017-05-03 20:30:45 +02:00
Sven Eberhardt 27272aea02 Fix mac build 2016-11-20 13:58:25 -05:00
Sven Eberhardt 6793455119 Add drag_finished parameter to EditCursorMoved callback 2016-11-20 13:14:59 -05:00
Sven Eberhardt bf9c940aa6 Editor graph delegate: Add edge and vertex properties. Remove graph storage options.
The different storage options weren't really needed and would not work with edge and vertex delegates.
2016-11-10 21:43:43 -05:00
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
Sven Eberhardt 54e8c14666 Editor: Add graph, polyline and polygon shape delegates 2016-11-02 09:54:31 -04:00
Sven Eberhardt 5c5e1a5fa3 Fix editor selection after object duplication on remote clients
Also remove some remaining EditCursorSelection/EditCursorDeselection callbacks
2016-10-30 22:26:14 -04:00
Julius Michaelis 34a9a1de8d Twiddle with header organization: lib{misc,c4script} do no longer include GL/glew.h
(Yes, it is just that complicated.)
2016-10-20 18:46:32 +02:00
Sven Eberhardt 028b576ab3 Editor: Change initial tool to "object edit" 2016-10-15 11:43:55 -04:00
Sven Eberhardt 4b3f8c0fef Remove EditCursorSelection and EditCursorDeselection callbacks
They never worked properly in network mode because all users would see the changes.

EditorProps, EditorActions and shape delegates now provide the functionality to have custom object editing widgets.

This also fixes a bug with the selection callback causing the object list to act up.
2016-10-15 10:06:43 -04:00
Sven Eberhardt 510d91fd00 Editor: Allow movement of HorizontalFix items by holding Shift and on object duplication 2016-10-10 21:46:17 -04:00
Sven Eberhardt 5e4aefddb2 Editor: Fix Ctrl+Click in object creation mode to create contents 2016-10-10 21:35:04 -04:00
Sven Eberhardt 4eae2b28d7 Editor: Fix drop cursor drawing 2016-10-10 21:26:10 -04:00
Sven Eberhardt 528504d72e Editor: Hide grade circle in viewport when using rectangle or picker tool 2016-08-27 20:10:58 -04:00
Sven Eberhardt 4f74d88d51 Editor: Fix selected object property dropdown list 2016-08-27 19:56:46 -04:00
Lukas Werling b7359e0c27 Remove the GTK platform (USE_GTK)
The GTK code does not work with the Qt editor. The simpler SDL2 platform
does, so we have little reason to keep the GTK code.

Note that GTK is still a dependency for mape.

Discussion: http://forum.openclonk.org/topic_show.pl?tid=3328
2016-08-03 16:25:46 +02:00
Sven Eberhardt ed368e128b Qt Editor: Ensure duplicated objects are moved to the cursor without extra mouse movement 2016-06-22 01:46:13 -04:00
Sven Eberhardt 8158cbf87c Qt Editor: Allow hotkey (F2) to duplicate selected objects.
Also reset cursor pos to center of duplicated objects to ensure they're on screen when duplicating by hotkey.
2016-06-22 01:04:14 -04:00
Sven Eberhardt b6526d2f65 Qt Editor: Always duplicate contents with objects
Even if they are not selected, this is probably what the user expects.
2016-06-20 15:50:35 -04:00
Lukas Werling b853f99b28 Fix -Wc++11-narrowing error in clang 2016-06-20 16:08:37 +02:00
Sven Eberhardt 44d94d5043 Improve editor duplicate function to duplicate properties and object connections.
It serializes objects using a selective SaveScenarioObjects script callback and then just executes the generated script. This automatically saves important properties, connects switches and doors, etc.

This change also solves the problem that duplicating an elevator plus case would create two elevator cases.

If execution fails (e.g. because of script errors or because a non-saveable object was duplicated), the method falls back to the legacy duplication method of creating objects with the same prototypes at the same position.
2016-06-20 01:45:26 -04:00
Sven Eberhardt e7be7d6acd Qt Editor: Add viewport context menu 2016-06-19 22:45:12 -04:00
Sven Eberhardt 1b785da271 Fix non-Qt build 2016-06-18 10:33:08 -04:00
Sven Eberhardt b70882d7fa Editor: Object scaling+rotation 2016-06-17 00:07:49 -04:00
Sven Eberhardt f913b4d012 Qt Editor: Highlight objects hovered in object selection delegate in viewport 2016-06-16 16:15:15 -04:00
Sven Eberhardt 2f22a3a8fe Qt Editor: Add property delegate type "object" 2016-06-16 14:59:04 -04:00
Sven Eberhardt 747077b71b Qt Editor: Fix effect properties 2016-05-23 19:22:05 -04:00
Sven Eberhardt 881534bee0 Qt Editor: Shape properties 2016-04-25 16:17:10 -04: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
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 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
Sven Eberhardt a3cdfa3221 Qt Editor: Add shadow to landscape brush circle
To be more visible e.g. when drawing snow or in front of a white sky
2016-03-20 11:35:20 -04:00
Sven Eberhardt ed0647866e Qt Editor: Add preview for new object placement 2016-03-19 14:40:22 -04:00
Sven Eberhardt 4f70fdbfc8 Qt Editor landscape drawing fixes and improvements. Add brush size preview. 2016-03-18 00:26:14 -04:00
Sven Eberhardt 80549ca2cc Qt Editor: Add object creator 2016-03-06 13:06:29 -05: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 a4d28c383b Qt Editor: Implement object list view 2016-02-18 00:11:35 -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 11bbeb2a5b Rename WITH_DEVELOPER_MODE to USE_GTK
This mirrors USE_WIN32_WINDOWS, USE_SDL_MAINLOOP and USE_COCOA.
2016-01-23 20:36:33 +01:00
Günther Brammer c20f98dcf9 gtk editor: Support EditCursorCommands, too
Reuse the windows code for this. Both versions had three parts: Enabling
the right menu items, adding the selection-specific ones, and showing the
menu. The second part is now common code, with the platform code in a new
function, since it grew big enough to be worth sharing.
2016-01-11 01:52:49 +01:00
Nicolas Hake 24b54211c5 Drop Min, Max, Swap for std::min, std::max, std::swap
The C++ standard library comes with perfectly fine implementations of
these functions, so there's no point in reimplementing them just for the
hell of it.
2015-11-15 13:53:01 +01:00
Sven Eberhardt 9e771acfd1 Editor: Add most recently entered script lines to dropdown list.
This also enables easier auto-completion via arrow-down.
2015-09-27 15:28:17 -04:00
Sven Eberhardt 26dff21b8a Fix tool picker on materials with sky background.
It selected an invalid texture before.
2015-09-19 22:37:45 -04:00
Sven Eberhardt 5b539a5b34 Fix manipulation of multiple objects in editor.
It would only do work on the last (and possibly random objects because initialized memory was accessed).
2015-09-15 21:29:26 -04:00
Armin Burgmeier 20eb0615ee Custom shader for drawing sky
Add a C4ShaderCall parameter to tho most important drawing functions, and
make C4DrawGL's CreateSpriteShader public with additional parameters to
specify additional defines and shader slices. C4Sky uses this to compile its
own shader with OC_SKY defined.
2015-09-12 18:15:34 -04:00
Sven Eberhardt 20d3de46cd Fix some unused variables. 2015-09-03 21:26:49 -04:00