Commit Graph

855 Commits (61962fe70abd22a665446cc09fcef163bf0e3862)

Author SHA1 Message Date
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
Julius Michaelis 9ab410e47d SDL: Notify C4Application of resolution / window size changes. 2016-10-29 14:15:09 +02:00
Nicolas Hake bce0b45413 Editor: Fix scheduler timer so it doesn't busy wait (#1834)
36/1000 is always 0 and doesn't make a lot of sense anyway. Use 1000/36
(aka 1000ms/36fps) instead so the UI thread has some time to rest.

Also use a Qt::PreciseTimer so Qt doesn't try to coalesce the scheduler
timer with other timers to save energy.
2016-10-28 21:31:14 +02:00
Julius Michaelis 376ca5a9df Prevent using USE_CONSOLE in lib{misc,c4script} 2016-10-22 17:42:23 +02:00
Lukas Werling 4d5bb7304c Fix game controllers not working with the editor 2016-10-10 14:16:18 +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
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
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
Sven Eberhardt 856730aabd Fix some signed/unsigned warnings 2016-09-07 01:53:54 -04:00
Lukas Werling 2044fc3c06 SDL: Fix wrong keyboad button labels 2016-08-20 23:16:31 +02:00
Lukas Werling 26a552473c Add support for two extra mouse buttons (#mantis-is-down-right-now)
This also fixes a missing definition for "MiddleDouble". Only
implemented for SDL and Qt, someone else will have to do Windows.
2016-08-18 22:43:42 +02:00
Lukas Werling abef0da0aa Fix RestartApplication on Linux
(and hopefully don't break it on Windows)
2016-08-11 22:11:15 +02:00
Sven Eberhardt 4869eff787 Allow joining to editor games through startup network dialogue 2016-08-10 19:35:39 -04:00
Lukas Werling ec128bede4 Qt editor: Fix freeze during lobby and loading on Linux 2016-08-08 17:24:44 +02:00
Sven Eberhardt c78a98d4b3 Fix crash on uninitialized pointer in Qt GL window initialization 2016-08-06 15:22:58 -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
Lukas Werling 582c82c159 Qt editor/Linux: Fix crash on player removal
See 69fff71abf
2016-08-01 13:54:35 +02:00
Sven Eberhardt 69fff71abf Qt editor: Fix crash on player removal 2016-07-31 23:22:09 -04:00
Sven Eberhardt 73510d7fb1 Qt Editor: Add sound property delegate 2016-07-27 22:35:11 -04:00
Kanibal 1e257c4e9e Allow C4Window to be constructed from Qt Widget on macOS 2016-07-23 22:47:14 -04:00
Martin Plicht 450619bac8 C4WindowController.mm: Only implement some viewport methods if not defined by qt editor implementation somewhere 2016-07-23 18:16:28 +02:00
Martin Plicht 2cfd743777 C4WindowMac.mm: Define some dummy K_* constants which weren't defined before for Cocoa 2016-07-23 18:16:28 +02:00
Sven Eberhardt a7aa89f168 Merge branch 'master' into qteditor
Conflicts:
	planet/Objects.ocd/Structures.ocd/StoneDoor.ocd/SpinWheel.ocd/Script.c
	src/platform/C4WindowSDL.cpp
	src/script/C4AulParse.cpp
	src/script/C4Effect.cpp
2016-06-20 22:27:03 -04:00
Lukas Werling 302fa5e362 Qt Editor: Make main loop calls more efficient 2016-06-20 16:56:20 +02:00
Nicolas Hake e490428f29 Win32: Drastically improve load times with unpacked planet/
C4Group::SearchNextEntry would waste lots of cycles looking up file
attributes that were never inspected afterwards. Since all we want is
the file size, and we already get that for free from FindFirstFile and
FindNextFile, store it with the directory iterator instead of querying
it at every iteration.

This reduces load times on my machine by almost half, tested across
several different scenarios.
2016-06-19 17:08:50 +02:00
Lukas Werling 60671474a8 Use Qt's event loop instead of polling for events
This fixes slow input event handling execution on Linux. Additionally,
it seems to fix some crashes with the menu bar.
2016-06-11 21:52:50 +02:00
Lukas Werling 435fe98b71 SDL: Handle key repeats 2016-05-22 23:27:57 +02:00
Lukas Werling 042e3c9602 SDL: Fix crash when opening resolution selector 2016-05-07 22:03:25 +02:00
Lukas Werling 9fa16c5e14 SDL: Enable multisampling
Unfortunately, there doesn't seem to be an easy way to apply
multisampling changes in SDL. As a workaround, a message requesting the
player to restart the game is shown.
2016-05-07 12:25:11 +02:00
Lukas Werling 1919d81f9d SDL: Implement FlashWindow for X11 2016-05-07 00:33:26 +02:00
Julius Michaelis 30bb12164b gtk_window_set_urgency_hint 2016-05-05 22:20:52 +02:00
Lukas Werling e33066a4f2 Rename SafeRandom() to UnsyncedRandom() 2016-04-25 17:32:23 +02:00
Nicolas Hake f963a398aa Define NORETURN annotation for MSVC 2016-04-07 20:52:28 +02:00
Lukas Werling de98bbef46 Fix compile errors on Linux/SDL 2016-04-06 19:17:52 +02:00
Nicolas Hake 1e1532ef8a Darwin: What the hell does "#import" do anyway? 2016-04-04 23:27:50 +02: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
Lukas Werling ca88a0a52a Implement new Linux editor todos 2016-03-26 21:43:37 +01:00
Lukas Werling f8dc58e0ed Remove Windows editor rendering hacks (untested) 2016-03-26 20:54:26 +01:00
Lukas Werling f9190cd1ea Fix keyboard input for Qt editor/SDL
The SDL port used to define a separate set of key codes differing from
the usual ones. The SDL codes are now translated to make the Qt input
easy.

This also fixes a broken keycode for the '0' key.
2016-03-26 20:29:07 +01:00
Lukas Werling 19caa65b7b Merge branch 'sdl-gamecontroller' (pull request GH-17) 2016-03-21 16:39:28 +01:00
Lukas Werling 75f62e52f2 Make Qt editor work with the SDL engine
Viewport rendering doesn't quite work yet, though.
2016-03-20 21:16:52 +01:00
Sven Eberhardt 645520c7af Qt Editor: Fix viewport focus and keyboard handling. 2016-03-15 22:58:41 -04:00
Sven Eberhardt f6ce50e9e7 Qt Editor: Use qt widgets for viewports 2016-03-10 00:07:17 -05:00
ckanibal 8f31ae22bf Make Windows build great again! 2016-03-07 00:58:23 +01:00
Lukas Werling 2d4747029d Make analog axis strength symmetrical (0 to 2^15 - 1) 2016-02-26 20:40:07 +01:00
Lukas Werling 3a4e667f4d Implement mouse grabbing for GTK on X11 (#1637)
The same thing should somehow also be possible using gdk_device_grab(),
but I couldn't get it to work properly.
2016-02-25 18:21:53 +01:00
Lukas Werling 8811356141 Make C4GamePadControl manage all controllers
The available gamepads are distributed automatically among players.

This also implements controller hot-plugging: It is possible to start a
game without a controller and plug it in later, and to reconnect a
controller after plugging it out.
2016-02-23 17:06:59 +01:00