Commit Graph

494 Commits (master)

Author SHA1 Message Date
Lukas Werling 319dc87eea Remove #undef new/delete before Qt includes
This has not been necessary anymore since a1885006 ("Remove MS CRT
memory management debugging").
2019-02-19 15:35:00 +01:00
Lukas Werling 60841c1d96 Write text files with unix file endings
The old LineFeed constant caused problems with Qt. Using \n directly is
easier and I don't think there's a reason left to use \r\n anyways.
We've always converted the files in the repository. Nowadays, even
notepad.exe works with unix file endings.
2019-02-19 15:28:12 +01:00
Lukas Werling 952cfef497 Add missing C4Include include in C4ConsoleQtShapes
Qt's moc generates another source file that includes this header without
including C4Include.h first. The generates source file thus doesn't
compile. It is unclear to me why this isn't an issue with our current
build setup (it is an issue with a meson-based build).
2018-10-14 23:19:32 +02:00
Lukas Werling fa3e8c2a50 Fix editor keyboard input on FreeBSD (hopefully)
Assuming keyboard scancodes on FreeBSD are the same as on Linux.
2018-02-18 01:05:28 +01:00
Lukas Werling 08edf3bb58 Enable -Wformat-security for gcc and fix one warning (GH-64)
Fedora has -Werror=format-security enabled per default, so enabling and
fixing these warnings is a good idea.
2018-02-06 23:31:50 +01:00
Sven Eberhardt a74dcc5450 Editor: Support localized definition group folder names (from Title.txt) 2017-05-27 16:30:59 +09:00
Tushar Maheshwari a661eab867 Automatic fixes using clang-tidy for header files
A follow-up on a previous PR GH-41. The discussion in the forum can be
viewed at http://forum.openclonk.org/topic_show.pl?pid=33086.
Run clang-tidy (without auto, pass-by-value and using checks) to fix the
header files not modified in the previous PR.

Summary of the changes:

 - C++11 member initialization.
 - nullptr instead of 0 for pointers.
 - override for functions declared virtual in base class.
 - default trivial special member functions
2017-05-15 13:46:46 +02:00
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
Sven Eberhardt 041e562542 Add HorizontalFix and VerticalFix support for "point" editor property delegate 2017-05-10 18:42:56 -04:00
Sven Eberhardt 1b4fd9abe3 Editor: Add translation overview table (Tools menu) 2017-05-09 22:43:56 -04:00
Sven Eberhardt 3289068ee0 Move C4PropertyPath class into its own files 2017-05-09 22:43:06 -04:00
Sven Eberhardt 94669cebe4 Merge branch 'master' of ssh://git.openclonk.org/openclonk
Conflicts:
	src/editor/C4ConsoleQtPropListViewer.cpp
2017-05-07 15:16:01 -04:00
Sven Eberhardt 9eedfe268c Editor: Reduce size of string localization button 2017-05-07 15:02:09 -04:00
Sven Eberhardt 4fac960cf4 Editor: Add localized string support 2017-05-07 14:26:30 -04: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
Nicolas Hake 48513291e7 C4ConsoleQtNewScenarioDlg: Avoid std::string conversion ambiguity 2017-03-24 09:08:47 +01:00
Nicolas Hake 007a05468e C4Scenario: Remove fixed char buffers 2017-03-23 16:35:25 +01:00
Sven Eberhardt 5dfd723708 New scenario dialogue: Redraw definition list after template changed 2017-03-11 14:30:46 -05:00
Nicolas Hake 6386621a4a Mark an unchanged parameter as const
Fixes build on standards-compliant C++ compilers.
2017-03-11 11:35:32 +01:00
Sven Eberhardt 6937969175 Force pre-select definitions specified in [Definitions] section of editor template c4s (#1898) 2017-03-11 00:13:49 -05:00
Lukas Werling 2c3a770415 Fix crash on invalid Editor.geometry (#1897) 2017-03-10 22:02:32 +01:00
Sven Eberhardt c8aa5fff8f Fix missing return value in C4PropertyDelegateFactory::PasteFromClipboard 2017-02-26 11:00:20 -05:00
Sven Eberhardt 5032e61dea Editor: Add OnUpdate to all delegates and EditorPropertyChanged callbacks to selected root object 2017-02-26 10:53:59 -05:00
Julius Michaelis d81a7f10e3 Silence a lot of inconsistent-missing-override warnings 2017-02-21 19:03:46 +01:00
Julius Michaelis 5f1ad6a5d7 Travis: fancy stuff
- gtest
 - colors
 - container based builds and GCC PCH (for a faster: "you failed")
2017-02-21 17:13:18 +01:00
Sven Eberhardt 9abb0bc200 Fix drawing of editor shape delegate polylines with settings StartFromObject=true and Relative=false 2017-02-20 22:25:28 -05:00
Sven Eberhardt e3eec21271 Editor: Add arrow drawing option to polyline delegate 2017-02-20 14:05:24 -05:00
Sven Eberhardt 294b679961 Editor: Add StartFromCenter option to polyline delegate 2017-02-20 13:39:46 -05:00
Sven Eberhardt 6579798907 Add editor enum option to force value serialization on foreign values 2017-02-19 20:36:40 -05:00
Sven Eberhardt 22306bd266 Editor: Add templates for new scenarios 2017-02-05 16:08:29 -05:00
Nicolas Hake c2ae62975a Win32: Fix build without Qt 2017-01-07 13:41:46 +01:00
Lukas Werling f9305a1526 Editor: Fix crash when trying to save scenario into itself 2016-12-19 23:14:49 +01:00
Armin Burgmeier 0340a28cdd editor: delete viewport widgets immediately
I don't know why the viewports are deleted with deleteLater(), but it leads
to an OpenGL context getting deselected behind our back, and so we don't know
when is a good time to re-select it. This leads to termination of the engine
when selecting File->Close (Ctrl+W) in the editor, because the graphics
re-initialization fails with no GL context active.

Instead, just delete the viewport widget immediately, which works fine at
least on Linux. This is also recommended by the Qt documentation at
http://doc.qt.io/qt-5/qopenglwidget.html.
2016-11-26 15:19:56 -08:00
Armin Burgmeier 75cbba8b7d editor: keep track of viewports properly
When removing a viewport, then also remove it from the internal list of
viewports. Otherwise, we might attempt to delete it again later. Fixes
crash on editor shutdown on Linux.
2016-11-26 15:19:56 -08:00
Armin Burgmeier 648309cf7e Make console destruction more deterministic
This fixes a crash on Linux when exiting the editor. It was caused by
C4Console::~C4Console being called by the C++ runtime after after main()
returned. The C4Console destructor then goes and deletes all the Qt
resources (QApplication and friends), and that caused a segfault, maybe
because some of the static Qt structures have already been deallocated.

Fix this by making the destruction of the Qt components deterministic. Add
a function "DeleteConsoleWindow" which deletes all the Qt components, and
call this function in C4Console::Clear.
2016-11-26 15:19:56 -08:00
Armin Burgmeier 7a8b01f7d5 Change return type of CreateConsoleWindow to bool
All implementations were just returning `this` anyway, and this makes it
easier to add a corresponding cleanup function.
2016-11-26 15:19:51 -08:00
Sven Eberhardt 5ccc932386 Editor: Disable packed export if no game is loaded 2016-11-22 22:28:19 -05:00
Sven Eberhardt 1cde52e060 Editor: Add "Export packed" file menu item 2016-11-20 22:43:44 -05:00
Sven Eberhardt d77206338c Editor: Fix pre-selection of last file and folder in save as dialogue 2016-11-20 22:43:15 -05:00
Sven Eberhardt 27272aea02 Fix mac build 2016-11-20 13:58:25 -05:00
Sven Eberhardt 04b5f82080 Editor: Add "open in network" to file menu and to new scenario dialogue 2016-11-20 13:24:09 -05:00
Sven Eberhardt 5e2c39da28 Editor: Fix shape edge and vertex properties when used within an enum 2016-11-20 13:15:00 -05:00
Sven Eberhardt e0d741079a Editor: Fix shape drag value updates 2016-11-20 13:15:00 -05:00
Sven Eberhardt 6793455119 Add drag_finished parameter to EditCursorMoved callback 2016-11-20 13:14:59 -05:00
Sven Eberhardt 072e1dcde0 Editor graph delegate: Add update callback functionality for graph edits 2016-11-12 22:20:05 -05:00
Sven Eberhardt 83c1d25b84 Fix editor graph delegate vertex hit radius 2016-11-12 22:20:04 -05:00
Sven Eberhardt 1621e984a9 Editor shapes: Update shape if value changed by script 2016-11-12 22:20:04 -05:00
Sven Eberhardt 91af5a95be Editor graph delegate: Add HorizontalFix, VerticalFix and StructureFix constraints 2016-11-12 22:20:03 -05:00
Lukas Werling b3772e6650 Fix assertions in C4ConsoleQtGraph 2016-11-11 18:00:21 +01: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