Commit Graph

53 Commits (master)

Author SHA1 Message Date
Kanibal 384472f183 Modernize loader loading code (#1748) 2018-01-28 11:07:05 +01: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
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 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 8d2f2846b5 Fix mac build
Also move some stuff around once again…
2016-10-21 01:25:48 +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 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
Sven Eberhardt 019cc0d583 Enable immediate tooltips on mouse-over-event for unlabeled icons in lobby and scenario selection (#1132). 2015-12-06 21:03:54 -05: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
David Dormagen 8af7897c52 fixed wrong mouse cursor offset in developers mode (#646)
Steps: open player menu (F), hover over entries -> mouse cursor was drawn at a wrong position.
2015-11-09 10:48:34 +01:00
David Dormagen ac738735b2 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/Vehicles.ocd/Airplane.ocd/Script.c
	src/game/C4Game.cpp
	src/game/C4GraphicsSystem.cpp
	src/gamescript/C4GameScript.cpp
2015-09-02 08:19:34 +02:00
Sven Eberhardt 535fc79c0f Silence a few compiler warnings. 2015-08-29 08:33:00 -04:00
David Dormagen 196f528201 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/HUD.ocd/FancyGridMenu.ocd/DefCore.txt
	planet/Objects.ocd/HUD.ocd/GridMenu.ocd/DefCore.txt
	planet/Objects.ocd/Helpers.ocd/Dummy.ocd/Graphics.png
	planet/Objects.ocd/Items.ocd/Tools.ocd/WindBag.ocd/Script.c
	planet/Objects.ocd/Items.ocd/Weapons.ocd/Javelin.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionMenu.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Flag.ocd/Marker.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Flagpole.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Pump.ocd/Script.c
	src/game/C4Game.cpp
	src/gamescript/C4GameScript.cpp
	src/gui/C4GameMessage.cpp
	src/landscape/C4Landscape.cpp
2015-06-03 22:32:36 +02:00
Nicolas Hake 5562b09dc4 Remove a lot of disabled legacy code, round 2
Maybe at some point we'll be rid of all the commented-out code that
nobody has looked at in years.
2015-03-25 20:02:53 +01:00
Nicolas Hake e21a5bdd44 Rename BoundBy to Clamp
"BoundBy" sounds like a predicate. "Clamp" is a common function name for
the operation in graphics processing, so it should be familiar to users.
2015-02-12 23:05:55 +01:00
David Dormagen 7319f7b3cc rewrite of C4GuiWindow to use C4GUI stuff wherever possible 2014-10-05 16:46:14 +02:00
Nicolas Hake 7a65ebade8 Warn on unsupported accelerator keys
Chars outside the basic latin alphabet don't actually work as
accelerator keys. Emit a warning when encountering them.
2014-03-11 00:26:13 +01:00
Nicolas Hake 4a3ece5f5d Don't split UTF8 when handling accelerators (#983)
Marking up accelerator keys still assumed all characters were one byte
wide. Change this to accept multi-byte characters.
2014-03-11 00:25:38 +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 95c3b0b75a fix scrollbar drawing and remove code duplication (#1004) 2013-12-05 10:40:17 +07:00
Nicolas Hake ca09a74241 Remove some silent conversion from integer 1/100ths to float 1/1s (#994)
4e875f4 didn't quite catch all instances of C4BltTransfor::SetRotate
being called, and silent conversion from int to float meant that those
rotations were incorrect by a factor of 100.
2013-11-11 00:23:01 +01:00
Günther Brammer 1e67a6fb24 Fix missing mouse cursor in fullscreen without resolution change
The mouse cursor was about the only thing affected by fZoom, and fZoom
should have been always 1 at the moment anyway.
2013-01-24 19:36:59 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Julius Michaelis 023aa90c0e Add config option for automatic windowed/fullscreen switching 2012-09-29 23:49:30 +02:00
Günther Brammer f6db61750e Store the size of the non-fullscreen-window separately
The size of that window can be adjusted by the player, so there is no need
for a GUI option.
2012-08-30 00:13:14 +02:00
Tobias Zwick 46156e3f1c show tooltip for C4D_MouseSelect using the property "Tooltip"
+ remove references to the old and obsolete "help mode"
2012-04-15 12:09:54 +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 ae322aa847 Remove some dead code 2012-03-04 21:44:20 +01:00
Günther Brammer 2b6f4432de Rename lpDDraw to pDraw 2011-10-03 16:30:18 +02:00
Günther Brammer d835ab002a Rename CStdWindow to C4Window 2011-08-27 23:12:01 +02:00
Nicolas Hake 8d8b087808 Return NULL instead of ((T*)false) from more functions 2011-09-28 19:42:56 +02:00
Günther Brammer be342d4a51 copyright notices update 2010
This time with more manual checking and using git blame -M -C, so that
a few cases of copied code get a copyright notice corresponding to
their initial introduction.
2010-12-23 01:01:24 +01:00
Martin Plicht 4c14ca4f5b Unnecessary check is not so unnecessary after all 2010-12-06 13:05:25 +01:00
Günther Brammer 0d59854c5c GUI: Remove superfluous checks for IsGUIValid() and GetScreenS()
Some of them should rather check whether the user has closed the window,
though.
2010-10-30 02:08:58 +02:00
Sven Eberhardt be8ef23f83 fix exclusive startup GUI after a game (#497) 2010-12-02 19:20:56 +01:00
Günther Brammer d92b9976a1 Remove all remaining GUI elements on C4Game::Clear (#477)
This was done when removing the Screen instance, do it when clearing the
screen instance instead.
2010-11-27 02:30:02 +01:00
Günther Brammer b0d9d73af6 GUI: Do not allocate the Screen dynamically, it's always used (#442)
At least according to Isilkors analysis, this should fix the crash.
2010-10-30 01:19:54 +02:00
Günther Brammer 2aa2712bfc Move C4GraphicsSystem::MouseMove to C4GUI::Screen
The function mostly operated on C4GUI::Screen anyway.
2010-09-29 23:58:59 +02:00
Günther Brammer a7e4dd9a9c Rename some fullscreen flags to editor 2010-09-28 20:16:33 +02:00
Günther Brammer 9bae376055 Remove old style Cursor and other dead code 2010-07-06 02:10:54 +02:00
Günther Brammer 46aa12def4 Merge C4GUI::Resource into C4GraphicsResource
Both classes did the same thing at the same time, with the only difference
that C4GUI::Resource was vaguely more associated with GUI stuff. Some
time ago, C4GUI::Resource could be freed during the game, but not anymore.

This saves some lines of code and one redundant class, but shouldn't change
anything besides progress bar being textured a little earlier during
startup.
2010-06-27 02:42:48 +02:00
Benjamin Herr 4378de147c Rerun astyle with missing \ added 2010-03-28 20:58:01 +02:00
Günther Brammer b4e37b070b Change all indentation with spaces to use tabs instead
This is a whitespace-only patch. Hopefully, it'll only affect rarely-changed
parts of the engine, since all regularly maintained pieces should already
use tabs.
2010-03-27 17:05:02 +01:00
Sven Eberhardt ce5bff74e6 fix menu close button usability glitch 2010-03-25 13:38:14 +01:00
Armin Burgmeier 7d17cb28e6 Fix a few compiler warnings 2010-03-16 12:39:58 +01:00
Günther Brammer 90a3c69791 X11: Fix developer mode GuiDialogs
Windows drew the dialog to the global back buffer at some random position
and copied the contents to the window. Instead, just draw the dialog at the
right position in the window.

Also, implement HandleMessage.
2010-03-05 22:15:48 +01:00
Günther Brammer 8d81513c40 OpenGL: Clean up the context handling
Instead of sprinkling calls to select the right context throughout the code,
store the context to use in the CSurface, and create a CSurface for every
window that's drawn to, and use that as the target parameter for the drawing
calls. D3D is probably even more broken now, but it should work just fine with
the right surface creation incantation.
2010-03-06 15:07:30 +01:00
Benjamin Herr f3b35227ea avoid lots of gcc warnings 2010-01-25 05:00:59 +01:00