Commit Graph

40 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
Nicolas Hake 22f42123e8 C4AbstractApp: Remove StdStrBuf 2017-03-16 18:51:16 +01:00
Julius Michaelis 5ad6012a3f Silence warning on switch over sdl scancodes 2017-02-21 19:37:20 +01: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
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
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
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 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 1919d81f9d SDL: Implement FlashWindow for X11 2016-05-07 00:33:26 +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
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 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
Lukas Werling 8dd1450e94 Implement "gamepad stick moved" events for analog input
Analog moved events are only sent once per control frame.
2016-02-21 18:26:18 +01:00
Lukas Werling bd3f020068 Replace Joystick controls with SDL GameController 2016-02-13 21:03:19 +01:00
Lukas Werling f505b31032 SDL: Fix mouse button handling
- The right mouse button didn't work at all.

 - The left mouse button stopped working when clicking multiple times
   without moving the cursor.
2016-02-11 22:29:10 +01:00
Lukas Werling 392b7bab72 SDL: Add support for the mouse wheel
Fixes #0001682
2016-02-11 22:17:42 +01:00
Günther Brammer 4b4b8781a0 Make GTK+ and SDL2 work together
If the gamepad code initialized the SDL video subsystem, GTK+ crashed in
libX11. Or something along those lines.

Making the optional subsystems using SDL for gamepads and audio use
SDL_InitSubSystem and only the SDL Application port do the full SDL_Init
is the proper way to do things in any case.
2016-02-06 21:12:56 +01:00
Günther Brammer 934b519bb4 Update the SDL port to SDL2
SDL2 is a much closer match to the other platform code, and
allows the creation of OpenGL 3 core contexts, which is
now required.
2016-02-06 16:48:21 +01:00
Günther Brammer 1010732ba8 Fix the SDL build 2016-02-06 16:47:56 +01:00
Nicolas Hake e9cf0f6fdc Stop pretending we support 16 bit color
The GTK and OS X platforms already ignored the requested bit depth and
always used 32 bit. Windows and SDL would set a 16 bit color depth for
the screen, but still did all of the rendering short of the final
present in 32 bit.
2016-02-02 00:00:23 +01:00
Sven Eberhardt 43165e24cd Change C4AbstractApp:SetVideoMode spatial resolution parameters to signed int.
The magic value -1 is used to denote "current screen mode", but it has trouble fitting into the unsigned concept. An alternative would be to use 0 as the magic value, but that would include quite a few places (including existing configuration settings) to change.
2015-09-01 22:51:32 -04:00
Günther Brammer 36ce941e4d cmake: Restore SDL-Mainloop build 2015-01-25 19:05:06 +01:00
Nicolas Hake e0dc30c59a Update copyright notices
As discussed in http://forum.openclonk.org/topic_show.pl?tid=2917, I
have merged all copyright notices into a single file and referenced that
merged file from each source file.

For the updated source files, the timeline has been split into three
parts:
 1. Pre-RWD code (before 2001)
 2. RWD code (2001 through 2009)
 3. OpenClonk code (2009 and later)
All pre-RWD copyright notices have been left intact, as have RWD-era
copyright notices where the file did not have a RedWolf design copyright
notice but only individual author ones. All copyright notices of the
OpenClonk era have been replaced by a single notice ranging from the
first recorded year to the current year (2013). Mape code did not get a
OpenClonk Team copyright notice because it is somewhat separate from the
main OpenClonk codebase and has only been touched by Armin Burgmeier.
2013-12-23 13:03:19 +01:00
Tobias Zwick fe2a400c02 replace global function GetTime() with class function C4TimeMilliseconds::Now() 2013-12-07 21:27:01 +07:00
Martin Plicht 60bafd6b3b Change remaining #ifdef USE_GL blocks into #ifndef USE_CONSOLE blocks (this makes Linux version work again) 2013-11-09 00:20:14 +01:00
Martin Plicht 59742510d9 linux/mac: Fix compilation after D3D removal 2013-11-03 11:44:20 +01:00
Günther Brammer cc25878ba6 Default to not changing the resolution
1. We receive bugreports that changing the resolution doesn't work, but
can't reproduce that
2. Flat screens look best at their natural resolution
2012-08-19 20:59:01 +02:00
Günther Brammer 1a29f8625d Reorder engine source file organization a bit
This mostly consists of flattening the hierarchy, splitting the
graphics stuff out of platform, and a few smaller cleanups.
2012-04-27 19:04:43 +02:00
Günther Brammer 40de33ca3c win32: Make sdl-mainloop option work
As it doesn't have the editor, this is only useful for compiling
more of our code on more platforms.
2012-03-23 22:53:56 +01:00
Günther Brammer 19eefbc777 Move Gammaramp code from CStdGL to C4AbstractApp
The windows code now has to delegate to StdD3D like it does for the
resolution setting, but for the other ports the code fits much better in
the app source files.
2012-02-28 20:40:19 +01:00
Günther Brammer b7f7c933b1 Remove unused Application.DoNotDelay 2012-03-11 23:06:23 +01:00
Günther Brammer afe5411709 linux: Replace Application.Location with readlink("/proc/self/exe") 2012-03-11 23:01:21 +01:00
Günther Brammer b4439ac1b7 Remove unused C4AbstractApp::ClearClipboard 2012-02-28 01:37:26 +01:00
Günther Brammer 1cafba4be8 Rename files implementing C4AbstractApp and C4Window 2011-10-03 17:19:24 +02:00