Commit Graph

37 Commits (master)

Author SHA1 Message Date
Julius Michaelis 9d61cc9bc9 Fix Mac build broken in b11564168, attempt 2 2018-01-19 13:01:26 +01:00
Julius Michaelis 914d3798a4 Addedum to the control fixes in b11564168 (#1693, #1982):
- Allow configuring keyboard keys with modifier keys
 - Allow using Alt as a key in game on linux
   (I'm still puzzled why only Ctrl and Shift where implemented in so many places)
 - Adjust the deserializer and PlayerControls.txt to match the serializer for mouse keys
 - Refactor C4PlayerControl::DoMouseInput a little bit
 - Try to fix the Mac build (attempt 1)
 - Fix a bug in C4KeyCodeEx::CompileFunc where it set an incorrect KeyComboItem::sKeyName
 - Fix(?) StdCompilerConfigRead not doing anything on NoSeparator
2018-01-19 11:23:51 +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
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
Nicolas Hake eabca223f5 Update all copyright notices for 2016 2016-04-03 20:24:42 +02:00
Lukas Werling 9e0143b998 Remove gamepad ids from key codes
We want one gamepad key mapping to work with multiple gamepads, so
including the id there doesn't make sense.

Additionally, the gamepad id may change during the game (controller
hot-plugging).
2016-02-21 18:27:02 +01:00
Lukas Werling 24622f3a9c Update main menu GUI gamepad control bindings
It is now possible to control all GUI menus using the left stick or the
dpad, along with the A and B buttons on the controller.

This also doubles the button emulation dead zone to make navigating the
menus with the stick easier.
2016-02-21 18:26:44 +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
Sven Eberhardt afab6ef464 func PlayerControl: Send nil instead of 0 for non-mouse controls.
The main script function always assumed this, but it was not actually implemented that way.
2016-01-16 22:06:19 -05:00
Sven Eberhardt e89779a8c7 Handle key-up events corresponding to keys that were down even if scope is not matched #1145 2016-01-09 00:19:38 -04:00
Günther Brammer 5db59e8665 Fix C4MessageBoard key binding lifetime
I think C4Game::InitKeyboard relies on the callback targets outliving the
keybindings and every other class is prepared to be deleted before
C4KeyboardInput::Clear(), so needs to hold a ref to the keybinding to
delete that in its destructor.

C4KeyBinding is the class that is used for that, and it sets the reference
count to 1 in the constructor, to represent the reference held in the
owning class.

On the other hand, C4CustomKey gets immediately forgotten by C4Game and the
only reference is held in the keymap.

To prevent this from happening again, make the C4CustomKey constructors
protected and C4Game a friend of the class.

Also remove an unused C4CustomKey constructor.
2016-01-01 16:24:43 +01:00
Sven Eberhardt 15a1a62521 Automatically deduce shift state in combo keys with Control/Shift combo. 2015-09-01 19:11:13 -04: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
Günther Brammer 50eb1b6a76 Since internal keycodes are now scancodes, they do not need to be resolved 2013-05-24 17:41:14 +02:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Sven Eberhardt 8bdd761027 PlayerControls: Allow usage of keyboard scan codes instead of virtual key names using $%x format (Win32 only)
Also re-resolves keys if the keyboard layout changed at runtime.
2012-10-09 00:54:34 +02:00
Sven Eberhardt 80d5f01642 Added FnGetPlayerControlAssignment: Get key/button assigned to a control.
To be used by tutorial messages explaining controls.
2012-04-17 17:06:16 +02:00
Sven Eberhardt c287c093cc PlayerControl: Mouse coordinate space (viewport vs landscape) is now a control property; not an assignment property.
This is in preparation for proper custom control assignments
2011-11-20 21:49:38 +01: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 f6f86f1ada Fix some indentation problem 2010-12-06 14:01:25 +01:00
Benjamin Herr 27287b981f Reformat everything according to style guidelines
as per http://forum.openclonk.org/topic_show.pl?tid=208
and http://wiki.openclonk.org/w/Style_Guidelines
via astyle
  --brackets=break
  --indent=tab=2
  --keep-one-line-statements
  --keep-one-line-blocks
  --indent-namespaces
  --convert-tabs
  --recursive
  --exclude=zlib
  --exclude=tinyxml
  src/\*.h src/*.cpp
2010-03-28 19:58:21 +02:00
Sven Eberhardt 35d439951e Allow Modifier+CON_* as player control assignment
ControlSet merging overrides only if OverrideAssignments is set to true
2010-03-27 19:08:01 +01: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 25e5279c0d implement gamepad axis strength parameter in player controls
lowered axis threshold to 20%
2010-02-23 17:53:38 +01:00
Asmageddon f3fcf7e80e fix key release event not being triggered if shift state changed during key hold (#134) 2010-02-18 18:43:38 +01:00
Benjamin Herr f3b35227ea avoid lots of gcc warnings 2010-01-25 05:00:59 +01:00
Sven Eberhardt 23a206ccdd implement *Mouse*Wheel1Up/Down for player controls
implement mouse wheel viewport zoom as async PlayerControl
2009-12-31 18:20:45 +01:00
Tobias Zwick edec15d64f merge 2009-11-30 17:24:14 +01:00
Armin Burgmeier 49e607bab0 Added includes and forward declarations, fixing the build 2009-10-26 00:09:34 +01:00
Sven Eberhardt 9be7a2724a added mouse support for scripted player controls 2009-10-17 17:53:26 +02:00
Sven Eberhardt 1c941adddc fix gamepad control 2009-10-16 16:23:17 +02:00
Tobias Zwick 8e5bac5071 fixed missing includes 2009-10-10 19:30:18 +02:00
Sven Eberhardt df6010a148 merge 2009-08-12 17:27:43 +02:00
Günther Brammer 572d00c32e Move all source files
This might make stuff easier to find.
2009-08-10 17:59:18 +02:00