Skip to content

Improve the inputs #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 77 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
f3f39c2
HUGE input refactoring (WIP):
Totto16 May 4, 2024
e2ca40b
readd clang tidy warnings fro special member functions (WIP, warnings…
Totto16 May 4, 2024
c66be9d
add settings for all three input types:
Totto16 May 5, 2024
bd8dfbb
make settings non default constructible, and move them around while s…
Totto16 May 5, 2024
ad39a00
implement offset_pointer_event for pointer inputs
Totto16 May 5, 2024
5e8f013
refactor the way the joystick manager works, it now is only used by t…
Totto16 May 5, 2024
06a6496
detect touch inputs dynamically, as sdl allows that
Totto16 May 6, 2024
0eaceb6
clang format (18) everything
Totto16 May 6, 2024
51b92c2
port joystick navigation names to the new API
Totto16 May 6, 2024
828260a
implement missing function of "input::PointerEventHelper"
Totto16 May 6, 2024
f779ae0
readd some used and non input related functionalities from capabiliti…
Totto16 May 6, 2024
02e4f4a
implement input::InputManager::get_primary_input
Totto16 May 6, 2024
c3a7949
- only include <SDL.h> and not some other sdl files
Totto16 May 6, 2024
d9ed0ef
improve sdl key:
Totto16 May 7, 2024
a6adf17
implement missing methods of KeyboardInput
Totto16 May 7, 2024
39b34d2
- implement missing methods of MouseInput
Totto16 May 7, 2024
f127e7e
fix some small things:
Totto16 May 7, 2024
c2322cd
implement missing TouchInput methods
Totto16 May 7, 2024
3047f17
add more unimplemented methods
Totto16 May 9, 2024
cc2f054
- fix last compile errors
Totto16 May 10, 2024
81f57f5
- add more sdl_key test cases
Totto16 May 10, 2024
8b2a4b6
require sdl2 >=2.24.0 for SDL_GUID
Totto16 May 10, 2024
f781f38
add backwards compatible typedef for sdl 2.30.0 feature
Totto16 May 10, 2024
1b38462
add more sdL_key tests
Totto16 May 10, 2024
b09c1ec
- add needed include, it was previously not needed, since it was used…
Totto16 May 10, 2024
df50e75
- fix error in newer gcc, unnecessary copy of std::string in for loop
Totto16 May 10, 2024
141e50f
input/guid: fix typedef usage
Totto16 May 10, 2024
8d87722
- fix error in newer gcc: const in static_cast
Totto16 May 10, 2024
579bb96
fix android build
Totto16 May 10, 2024
40bc524
fix switch build
Totto16 May 10, 2024
47a4e8b
fix 3ds build
Totto16 May 10, 2024
aa7096f
fix MSVC build
Totto16 May 10, 2024
53c5dfa
imporve utils::unrechable:
Totto16 May 10, 2024
646c7cd
fix MSVC build
Totto16 May 10, 2024
5b595be
fix error after rebase
Totto16 May 13, 2024
faefebf
clang tidy:
Totto16 May 13, 2024
81af69b
run clang-format
Totto16 May 13, 2024
7f0bae0
clang tidy:
Totto16 May 13, 2024
8a4ad7f
clang tidy: refactor settings
Totto16 May 13, 2024
b8fffa7
clang-tidy: fix some things
Totto16 May 13, 2024
a0bf1af
remove NOLINT's for readability-use-anyofallof and use std::ranges
Totto16 May 13, 2024
583b52c
modernize:
Totto16 May 13, 2024
ae4644c
c++ std version:
Totto16 May 13, 2024
462bfa9
c++26: try to use newer features
Totto16 May 13, 2024
513a499
clang-format files
Totto16 May 13, 2024
da4bf15
fix a few more clang-tidy things
Totto16 May 14, 2024
9bef844
clang-tidy: fix more errors
Totto16 May 15, 2024
011b4f9
clang-tidy: fix more things
Totto16 May 15, 2024
e6ca4fa
Merge pull request #152 from OpenBrickProtocolFoundation/clang-tidy-n…
Totto16 May 15, 2024
25772b1
extract generic string operations, that were used in sdl_key
Totto16 May 16, 2024
b8ea07b
input:
Totto16 May 16, 2024
eaf32ae
fix switch build, by providing some missing functions
Totto16 May 16, 2024
1376acc
use X Macro magic to reduce the duplication of settings keys
Totto16 May 16, 2024
04aa055
fix a few minor mistakes:
Totto16 May 16, 2024
e685941
fix android build
Totto16 May 16, 2024
d5119ca
fix windows MSVC build
Totto16 May 16, 2024
fc916a3
refactor console / switch joystick input:
Totto16 May 16, 2024
36eaac3
build scripts:
Totto16 May 16, 2024
e62606a
buildscript: make minor improvements for android
Totto16 May 16, 2024
faca147
input:
Totto16 May 16, 2024
f7a3931
input:
Totto16 May 16, 2024
6049bbc
input:
Totto16 May 16, 2024
5074c30
input:
Totto16 May 16, 2024
1b4d0cc
input: console:
Totto16 May 16, 2024
ec64b9f
clang-tidy:
Totto16 May 16, 2024
1392129
clang-tidy:
Totto16 May 16, 2024
a72503c
clang-tidy:
Totto16 May 16, 2024
4bd7b8d
clang-tidy:
Totto16 May 16, 2024
96bef6f
input: console:
Totto16 May 16, 2024
cf604f8
clang-tidy:
Totto16 May 17, 2024
b8d91d0
clang-tidy:
Totto16 May 17, 2024
9fc93e3
clang-tidy:
Totto16 May 17, 2024
55f6c4b
clang-tidy:
Totto16 May 17, 2024
d153d4c
input:
Totto16 May 17, 2024
9f728ad
input:
Totto16 May 17, 2024
a41c76c
input: console:
Totto16 May 17, 2024
9e1ed5f
clang-tidy, input:
Totto16 May 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
344 changes: 162 additions & 182 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,188 +1,168 @@
# taken from https://github.com/cpp-linter/cpp-linter-action/blob/main/demo/.clang-tidy
---
Checks: "clang-diagnostic-*,clang-analyzer-*,bugprone-*,misc-*,performance-*,readability-*,portability-*,modernize-*,cppcoreguidelines-*,-modernize-use-trailing-return-type,-readability-named-parameter,-readability-identifier-length,-misc-include-cleaner,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-misc-non-private-member-variables-in-classes,-cppcoreguidelines-non-private-member-variables-in-classes,-cppcoreguidelines-special-member-functions"
Checks: "clang-diagnostic-*,clang-analyzer-*,bugprone-*,misc-*,performance-*,readability-*,portability-*,modernize-*,cppcoreguidelines-*,google-*,llvm-*,cert-*,-modernize-use-trailing-return-type,-bugprone-argument-comment,-misc-include-cleaner,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-readability-avoid-nested-conditional-operator,-llvm-namespace-comment,-llvm-header-guard"
WarningsAsErrors: ""
HeaderFilterRegex: "oopetris/src/.*"
AnalyzeTemporaryDtors: false
FormatStyle: "file"
CheckOptions:
- key: bugprone-argument-comment.CommentBoolLiterals
value: "0"
- key: bugprone-argument-comment.CommentCharacterLiterals
value: "0"
- key: bugprone-argument-comment.CommentFloatLiterals
value: "0"
- key: bugprone-argument-comment.CommentIntegerLiterals
value: "0"
- key: bugprone-argument-comment.CommentNullPtrs
value: "0"
- key: bugprone-argument-comment.CommentStringLiterals
value: "0"
- key: bugprone-argument-comment.CommentUserDefinedLiterals
value: "0"
- key: bugprone-argument-comment.IgnoreSingleArgument
value: "0"
- key: bugprone-argument-comment.StrictMode
value: "0"
- key: bugprone-assert-side-effect.AssertMacros
value: assert
- key: bugprone-assert-side-effect.CheckFunctionCalls
value: "0"
- key: bugprone-dangling-handle.HandleClasses
value: "std::basic_string_view;std::experimental::basic_string_view"
- key: bugprone-dynamic-static-initializers.HeaderFileExtensions
value: ",h,hh,hpp,hxx"
- key: bugprone-exception-escape.FunctionsThatShouldNotThrow
value: ""
- key: bugprone-exception-escape.IgnoredExceptions
value: ""
- key: bugprone-misplaced-widening-cast.CheckImplicitCasts
value: "0"
- key: bugprone-not-null-terminated-result.WantToUseSafeFunctions
value: "1"
- key: bugprone-signed-char-misuse.CharTypdefsToIgnore
value: ""
- key: bugprone-sizeof-expression.WarnOnSizeOfCompareToConstant
value: "1"
- key: bugprone-sizeof-expression.WarnOnSizeOfConstant
value: "1"
- key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression
value: "0"
- key: bugprone-sizeof-expression.WarnOnSizeOfThis
value: "1"
- key: bugprone-string-constructor.LargeLengthThreshold
value: "8388608"
- key: bugprone-string-constructor.WarnOnLargeLength
value: "1"
- key: bugprone-suspicious-enum-usage.StrictMode
value: "0"
- key: bugprone-suspicious-missing-comma.MaxConcatenatedTokens
value: "5"
- key: bugprone-suspicious-missing-comma.RatioThreshold
value: "0.200000"
- key: bugprone-suspicious-missing-comma.SizeThreshold
value: "5"
- key: bugprone-suspicious-string-compare.StringCompareLikeFunctions
value: ""
- key: bugprone-suspicious-string-compare.WarnOnImplicitComparison
value: "1"
- key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison
value: "0"
- key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit
value: "16"
- key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField
value: "1"
- key: bugprone-unused-return-value.CheckedFunctions
value: "::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty"
- key: cert-dcl16-c.NewSuffixes
value: "L;LL;LU;LLU"
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: "0"
- key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
value: "1"
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: "1"
- key: google-readability-braces-around-statements.ShortStatementLines
value: "1"
- key: google-readability-function-size.StatementThreshold
value: "800"
- key: google-readability-namespace-comments.ShortNamespaceLines
value: "10"
- key: google-readability-namespace-comments.SpacesBeforeComments
value: "2"
- key: misc-definitions-in-headers.HeaderFileExtensions
value: ",h,hh,hpp,hxx"
- key: misc-definitions-in-headers.UseHeaderFileExtension
value: "1"
- key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries
value: "1"
- key: misc-unused-parameters.StrictMode
value: "0"
- key: modernize-loop-convert.MaxCopySize
value: "16"
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-use-trailing-return-type
value: "false"
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-use-nullptr.NullMacros
value: "NULL"
- key: performance-faster-string-find.StringLikeClasses
value: "std::basic_string"
- key: performance-for-range-copy.AllowedTypes
value: ""
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: "0"
- key: performance-inefficient-string-concatenation.StrictMode
value: "0"
- key: performance-inefficient-vector-operation.EnableProto
value: "0"
- key: performance-inefficient-vector-operation.VectorLikeClasses
value: "::std::vector"
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: "1"
- key: performance-move-constructor-init.IncludeStyle
value: llvm
- key: performance-no-automatic-move.AllowedTypes
value: ""
- key: performance-type-promotion-in-math-fn.IncludeStyle
value: llvm
- key: performance-unnecessary-copy-initialization.AllowedTypes
value: ""
- key: performance-unnecessary-value-param.AllowedTypes
value: ""
- key: performance-unnecessary-value-param.IncludeStyle
value: llvm
- key: readability-braces-around-statements.ShortStatementLines
value: "0"
- key: readability-else-after-return.WarnOnUnfixable
value: "1"
- key: readability-function-size.BranchThreshold
value: "4294967295"
- key: readability-function-size.LineThreshold
value: "4294967295"
- key: readability-function-size.NestingThreshold
value: "4294967295"
- key: readability-function-size.ParameterThreshold
value: "4294967295"
- key: readability-function-size.StatementThreshold
value: "800"
- key: readability-function-size.VariableThreshold
value: "4294967295"
- key: readability-identifier-naming.IgnoreFailedSplit
value: "0"
- key: readability-implicit-bool-conversion.AllowIntegerConditions
value: "0"
- key: readability-implicit-bool-conversion.AllowPointerConditions
value: "0"
- key: readability-inconsistent-declaration-parameter-name.IgnoreMacros
value: "1"
- key: readability-inconsistent-declaration-parameter-name.Strict
value: "0"
- key: readability-magic-numbers.IgnoredFloatingPointValues
value: "1.0;100.0;"
- key: readability-magic-numbers.IgnoredIntegerValues
value: "1;2;3;4;"
- key: readability-redundant-member-init.IgnoreBaseInCopyConstructors
value: "0"
- key: readability-redundant-smartptr-get.IgnoreMacros
value: "1"
- key: readability-redundant-string-init.StringNames
value: "::std::basic_string"
- key: readability-simplify-boolean-expr.ChainedConditionalAssignment
value: "0"
- key: readability-simplify-boolean-expr.ChainedConditionalReturn
value: "0"
- key: readability-simplify-subscript-expr.Types
value: "::std::basic_string;::std::basic_string_view;::std::vector;::std::array"
- key: readability-static-accessed-through-instance.NameSpecifierNestingThreshold
value: "3"
- key: readability-uppercase-literal-suffix.IgnoreMacros
value: "1"
- key: readability-uppercase-literal-suffix.NewSuffixes
value: ""
## NAMING CONVENTION SECTION
- key: readability-identifier-naming.AbstractClassCase
value: "CamelCase"
- key: readability-identifier-naming.AggressiveDependentMemberLookup
value: true
- key: readability-identifier-naming.CheckAnonFieldInParent
value: false
- key: readability-identifier-naming.ClassCase
value: "CamelCase"
- key: readability-identifier-naming.ClassConstantCase
value: "lower_case"
- key: readability-identifier-naming.ClassConstantPrefix
value: "c_"
- key: readability-identifier-naming.ClassMemberCase
value: "lower_case"
- key: readability-identifier-naming.ClassMemberPrefix
value: "m_"
- key: readability-identifier-naming.ClassMethodCase
value: "lower_case"
- key: readability-identifier-naming.ConceptCase
value: "CamelCase"
- key: readability-identifier-naming.ConstantCase
value: "lower_case"
- key: readability-identifier-naming.ConstantMemberCase
value: "lower_case"
- key: readability-identifier-naming.ConstantParameterCase
value: "lower_case"
- key: readability-identifier-naming.ConstantPointerParameterCase
value: "lower_case"
- key: readability-identifier-naming.ConstexprFunctionCase
value: "lower_case"
- key: readability-identifier-naming.ConstexprMethodCase
value: "lower_case"
- key: readability-identifier-naming.ConstexprVariableCase
value: "lower_case"
- key: readability-identifier-naming.EnumCase
value: "CamelCase"
- key: readability-identifier-naming.EnumConstantCase
value: "CamelCase"
- key: readability-identifier-naming.FunctionCase
value: "lower_case"
- key: readability-identifier-naming.GlobalConstantCase
value: "lower_case"
- key: readability-identifier-naming.GlobalConstantPointerCase
value: "lower_case"
- key: readability-identifier-naming.GlobalFunctionCase
value: "lower_case"
- key: readability-identifier-naming.GlobalFunctionIgnoredRegexp
value: "(PrintTo)" ## for gtest
- key: readability-identifier-naming.GlobalPointerCase
value: "lower_case"
- key: readability-identifier-naming.GlobalVariableCase
value: "lower_case"
- key: readability-identifier-naming.GlobalVariablePrefix
value: "g_"
- key: readability-identifier-naming.LocalConstantCase
value: "lower_case"
- key: readability-identifier-naming.LocalConstantPointerCase
value: "lower_case"
- key: readability-identifier-naming.LocalPointerCase
value: "lower_case"
- key: readability-identifier-naming.LocalVariableCase
value: "lower_case"
- key: readability-identifier-naming.MacroDefinitionCase
value: "UPPER_CASE"
- key: readability-identifier-naming.MemberCase
value: "lower_case"
- key: readability-identifier-naming.MemberPrefix
value: "m_"
- key: readability-identifier-naming.MethodCase
value: "lower_case"
- key: readability-identifier-naming.NamespaceCase
value: "lower_case"
- key: readability-identifier-naming.ParameterCase
value: "lower_case"
- key: readability-identifier-naming.ParameterPackCase
value: "lower_case"
- key: readability-identifier-naming.PointerParameterCase
value: "lower_case"
- key: readability-identifier-naming.PrivateMemberCase
value: "lower_case"
- key: readability-identifier-naming.PrivateMemberPrefix
value: "m_"
- key: readability-identifier-naming.PrivateMethodCase
value: "lower_case"
- key: readability-identifier-naming.ProtectedMemberCase
value: "lower_case"
- key: readability-identifier-naming.ProtectedMemberPrefix
value: "m_"
- key: readability-identifier-naming.ProtectedMethodCase
value: "lower_case"
- key: readability-identifier-naming.PublicMemberCase
value: "lower_case"
- key: readability-identifier-naming.PublicMemberPrefix
value: "" # NO PREFIX
- key: readability-identifier-naming.PublicMethodCase
value: "lower_case"
- key: readability-identifier-naming.ScopedEnumConstantCase
value: "CamelCase"
- key: readability-identifier-naming.StaticConstantCase
value: "lower_case"
- key: readability-identifier-naming.StaticConstantPrefix
value: "s_"
- key: readability-identifier-naming.StaticVariableCase
value: "lower_case"
- key: readability-identifier-naming.StaticVariablePrefix
value: "s_"
- key: readability-identifier-naming.StructCase
value: "CamelCase"
- key: readability-identifier-naming.TemplateParameterCase
value: "CamelCase"
- key: readability-identifier-naming.TemplateTemplateParameterCase
value: "CamelCase"
- key: readability-identifier-naming.TypeAliasCase
value: "CamelCase"
- key: readability-identifier-naming.TypedefCase
value: "CamelCase"
- key: readability-identifier-naming.TypeTemplateParameterCase
value: "CamelCase"
- key: readability-identifier-naming.UnionCase
value: "CamelCase"
- key: readability-identifier-naming.ValueTemplateParameterCase
value: "CamelCase"
- key: readability-identifier-naming.VariableCase
value: "lower_case"
- key: readability-identifier-naming.VirtualMethodCase
value: "lower_case"

# some needed settings, that are non default
- key: bugprone-misplaced-widening-cast.CheckImplicitCasts
value: true
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: true
- key: bugprone-suspicious-enum-usage.StrictMode
value: true
- key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison
value: true
- key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField
value: true
- key: misc-unused-parameters.StrictMode
value: true
- key: performance-inefficient-string-concatenation.StrictMode
value: true
- key: readability-inconsistent-declaration-parameter-name.Strict
value: true

## special things, that have special values
- key: readability-identifier-length.IgnoredVariableNames
value: ""
- key: readability-identifier-length.IgnoredParameterNames
value: "^(os)$" ## std::ostream
- key: readability-identifier-length.IgnoredExceptionVariableNames
value: ""
- key: readability-identifier-length.MinimumLoopCounterNameLength
value: 1
- key: readability-identifier-length.MinimumExceptionNameLength
value: 5
- key: readability-function-cognitive-complexity.Threshold
value: 50
- key: bugprone-assert-side-effect.AssertMacros
value: "assert"
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(
'buildtype': 'debug',
'optimization': '3',
'strip': true,
'cpp_std': ['c++23', 'c++latest', 'vc++latest', 'c++20'],
'cpp_std': ['c++26', 'c++23', 'c++latest', 'vc++latest'],
'b_ndebug': 'if-release',

},
Expand Down
4 changes: 3 additions & 1 deletion platforms/build-3ds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export CMAKE="$BIN_DIR/$TOOL_PREFIX-cmake"
export PATH="$BIN_DIR:$PATH"

export CC="$COMPILER_BIN/$TOOL_PREFIX-gcc"
export CXX="$COMPILER_BIN/$TOOL_PREFIX-g"++
export CXX="$COMPILER_BIN/$TOOL_PREFIX-g++"
export AS="$COMPILER_BIN/$TOOL_PREFIX-as"
export AR="$COMPILER_BIN/$TOOL_PREFIX-gcc-ar"
export RANLIB="$COMPILER_BIN/$TOOL_PREFIX-gcc-ranlib"
Expand Down Expand Up @@ -73,6 +73,8 @@ devkitpro = '$DEVKITPRO'
[binaries]
c = '$CC'
cpp = '$CXX'
c_ld = 'bfd'
cpp_ld = 'bfd'
ar = '$AR'
as = '$AS'
ranlib = '$RANLIB'
Expand Down
Loading
Loading