Skip to content

Fix known bugs #159

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 9 commits into from
May 24, 2024
Merged

Fix known bugs #159

merged 9 commits into from
May 24, 2024

Conversation

Totto16
Copy link
Collaborator

@Totto16 Totto16 commented May 24, 2024

This fixes #151

  • slider takes control of wheel: see this behavior in the settings where we need a better handling of who is going to "get the wheel events" either the slider or the scroll layout
  • slider offset bug: while sliding, it is offset
  • target fps / simulation speed should be independent: so that it feels the same to play on all fps and it also saves the recordings fps independent

- this was caused by not offset events in a scroll layout, it's fixed, by providing a correct implementation of handle_focus_change_events for scroll_layout, since it differs from the generic one for focus_layouts
- add boolean that represents the mouse capture state of a slider
- factor our the handle_event function for focus_layouts, where it is the same
@Totto16 Totto16 changed the title Fix knwon bugs Fix known bugs May 24, 2024
@Totto16 Totto16 added the bug Something isn't working label May 24, 2024
@Totto16 Totto16 added this to the 0.5.7 milestone May 24, 2024
…ality is no pointer event, so it has to be handled separately
Copy link

github-actions bot commented May 24, 2024

badge

Code Coverage Summary

Filename                                                 Stmts    Miss  Cover    Missing
-----------------------------------------------------  -------  ------  -------  -----------------------------------------------------------------------------------
src/application.cpp                                        208     208  0.00%    29-397
src/application.hpp                                         33      33  0.00%    65-127
src/discord/core.cpp                                       103     103  0.00%    12-181
src/discord/core.hpp                                         6       6  0.00%    61-70
src/game/bag.cpp                                            22      22  0.00%    3-33
src/game/bag.hpp                                             2       2  0.00%    15-16
src/game/game.cpp                                           61      61  0.00%    7-107
src/game/game.hpp                                            0       0  100.00%
src/game/graphic_helpers.cpp                                42      42  0.00%    11-93
src/game/grid.cpp                                           73      73  0.00%    6-112
src/game/grid.hpp                                            0       0  100.00%
src/game/mino.cpp                                           10      10  0.00%    3-20
src/game/mino.hpp                                            1       1  0.00%    19
src/game/mino_stack.cpp                                     55      55  0.00%    7-86
src/game/mino_stack.hpp                                      0       0  100.00%
src/game/rotation.cpp                                       23      23  0.00%    5-37
src/game/tetrion.cpp                                       414     414  0.00%    18-651
src/game/tetrion.hpp                                         7       7  0.00%    123-129
src/game/tetromino.cpp                                      44      44  0.00%    5-75
src/game/tetromino.hpp                                       5       5  0.00%    18-29
src/game/tetromino_type.cpp                                 22      22  0.00%    5-45
src/graphics/point.hpp                                      24      24  0.00%    17-93
src/graphics/rect.hpp                                       23      23  0.00%    16-55
src/graphics/renderer.cpp                                   72      72  0.00%    6-123
src/graphics/renderer.hpp                                   30      30  0.00%    33-77
src/graphics/sdl_context.cpp                                14      14  0.00%    18-53
src/graphics/text.cpp                                       11      11  0.00%    6-25
src/graphics/text.hpp                                        0       0  100.00%
src/graphics/texture.cpp                                    71      71  0.00%    7-118
src/graphics/texture.hpp                                     9       9  0.00%    50-60
src/graphics/window.cpp                                     41      41  0.00%    6-62
src/helper/bool_wrapper.hpp                                  9       9  0.00%    14-34
src/helper/clock_source.cpp                                 28      28  0.00%    8-47
src/helper/clock_source.hpp                                  7       7  0.00%    9-24
src/helper/color.cpp                                        86      36  58.14%   11-31, 38-53, 61, 75, 145-157, 161-164
src/helper/color.hpp                                        95      86  9.47%    28-58, 80-108, 147-254
src/helper/color_literals.hpp                              320      30  90.62%   412, 582, 647-694, 708-711
src/helper/command_line_arguments.hpp                       38      38  0.00%    21-77
src/helper/const_utils.hpp                                  17       1  94.12%   72
src/helper/date.cpp                                         46      46  0.00%    9-113
src/helper/errors.cpp                                       27      27  0.00%    3-44
src/helper/errors.hpp                                        0       0  100.00%
src/helper/git_helper.hpp                                    2       2  0.00%    7-11
src/helper/graphic_utils.cpp                                16      16  0.00%    4-95
src/helper/message_box.cpp                                   7       7  0.00%    7-22
src/helper/music_utils.hpp                                   4       4  0.00%    9-30
src/helper/nfd.cpp                                         108     108  0.00%    21-196
src/helper/nfd_include.hpp                                   1       1  0.00%    23
src/helper/parse_json.cpp                                   23      23  0.00%    6-55
src/helper/parse_json.hpp                                   35      35  0.00%    27-88
src/helper/platform.cpp                                     12      12  0.00%    16-98
src/helper/platform.hpp                                      4       4  0.00%    14-36
src/helper/random.cpp                                       13      13  0.00%    4-24
src/helper/random.hpp                                        4       4  0.00%    21-24
src/helper/sleep.cpp                                        15      15  0.00%    20-71
src/helper/static_string.hpp                                30      30  0.00%    16-128
src/helper/string_manipulation.cpp                          41       7  82.93%   16-23
src/helper/timer.hpp                                        21      21  0.00%    16-49
src/helper/utils.hpp                                        18      18  0.00%    45-114
src/input/controller_input.cpp                             161     161  0.00%    12-325
src/input/controller_input.hpp                              52      52  0.00%    55-162
src/input/game_input.cpp                                    67      67  0.00%    8-99
src/input/game_input.hpp                                    16      16  0.00%    51-99
src/input/guid.cpp                                          18      18  0.00%    8-39
src/input/guid.hpp                                          46      46  0.00%    32-135
src/input/input.cpp                                        199     199  0.00%    20-401
src/input/input_creator.cpp                                 72      72  0.00%    19-152
src/input/input_creator.hpp                                  6       6  0.00%    20-31
src/input/input.hpp                                          9       9  0.00%    119-133
src/input/joystick_input.cpp                               201     201  0.00%    18-963
src/input/joystick_input.hpp                                74      74  0.00%    32-438
src/input/keyboard_input.cpp                               128     128  0.00%    8-221
src/input/keyboard_input.hpp                                53      53  0.00%    43-158
src/input/mouse_input.cpp                                   36      36  0.00%    9-79
src/input/mouse_input.hpp                                    0       0  100.00%
src/input/replay_input.cpp                                  53      53  0.00%    6-98
src/input/replay_input.hpp                                   0       0  100.00%
src/input/touch_input.cpp                                  175     175  0.00%    13-344
src/input/touch_input.hpp                                   57      57  0.00%    50-214
src/lobby/api.hpp                                           25      25  0.00%    143-235
src/manager/event_dispatcher.hpp                            71      71  0.00%    15-120
src/manager/event_listener.hpp                               8       8  0.00%    6-19
src/manager/font.cpp                                        12      12  0.00%    5-18
src/manager/font.hpp                                         4       4  0.00%    13-26
src/manager/music_manager.cpp                              216     216  0.00%    17-380
src/manager/music_manager.hpp                               12      12  0.00%    58-75
src/manager/resource_manager.hpp                             8       8  0.00%    18-37
src/manager/sdl_controller_key.cpp                          18      18  0.00%    5-34
src/manager/sdl_controller_key.hpp                           3       3  0.00%    32-34
src/manager/sdl_key.cpp                                    213      33  84.51%   26, 74-75, 153-155, 204-210, 221-222, 229, 287, 312, 367-368, 384, 394-413, 423-424
src/manager/sdl_key.hpp                                      3       3  0.00%    91-93
src/manager/service_provider.hpp                             2       2  0.00%    32-37
src/manager/settings_manager.cpp                            29      29  0.00%    9-54
src/manager/settings_manager.hpp                            35      35  0.00%    19-76
src/recordings/additional_information.cpp                  322     322  0.00%    9-549
src/recordings/additional_information.hpp                   23      23  0.00%    32-168
src/recordings/checksum_helper.cpp                          10      10  0.00%    5-21
src/recordings/checksum_helper.hpp                          13      13  0.00%    21-47
src/recordings/helper.hpp                                   81      81  0.00%    33-177
src/recordings/recording.cpp                                21      21  0.00%    6-47
src/recordings/recording.hpp                                 4       4  0.00%    48-57
src/recordings/recording_reader.cpp                        148     148  0.00%    10-279
src/recordings/recording_reader.hpp                          0       0  100.00%
src/recordings/recording_writer.cpp                         83      83  0.00%    4-172
src/recordings/recording_writer.hpp                          6       6  0.00%    52-59
src/recordings/tetrion_core_information.hpp                  6       6  0.00%    13-24
src/recordings/tetrion_snapshot.cpp                        100     100  0.00%    12-201
src/recordings/tetrion_snapshot.hpp                          0       0  100.00%
src/scenes/scene.cpp                                        18      18  0.00%    17-60
src/scenes/scene.hpp                                        13      13  0.00%    25-74
src/scenes/about_page/about_page.cpp                        57      57  0.00%    16-118
src/scenes/about_page/about_page.hpp                         0       0  100.00%
src/scenes/loading_screen/loading_screen.cpp                68      68  0.00%    15-126
src/scenes/loading_screen/loading_screen.hpp                 0       0  100.00%
src/scenes/logo/logo.cpp                                    25      25  0.00%    11-147
src/scenes/main_menu/main_menu.cpp                          97      97  0.00%    12-165
src/scenes/main_menu/main_menu.hpp                           0       0  100.00%
src/scenes/multiplayer_menu/multiplayer_menu.cpp            76      76  0.00%    12-134
src/scenes/multiplayer_menu/multiplayer_menu.hpp             0       0  100.00%
src/scenes/online_lobby/online_lobby.cpp                    91      91  0.00%    16-161
src/scenes/online_lobby/online_lobby.hpp                     0       0  100.00%
src/scenes/play_select_menu/play_select_menu.cpp            76      76  0.00%    11-129
src/scenes/play_select_menu/play_select_menu.hpp             0       0  100.00%
src/scenes/recording_selector/recording_chooser.cpp         75      75  0.00%    13-137
src/scenes/recording_selector/recording_chooser.hpp          0       0  100.00%
src/scenes/recording_selector/recording_component.cpp       93      93  0.00%    13-162
src/scenes/recording_selector/recording_component.hpp        1       1  0.00%    21
src/scenes/recording_selector/recording_selector.cpp       129     129  0.00%    29-232
src/scenes/recording_selector/recording_selector.hpp         2       2  0.00%    23-25
src/scenes/replay_game/replay_game.cpp                      80      80  0.00%    12-161
src/scenes/replay_game/replay_game.hpp                       0       0  100.00%
src/scenes/settings_menu/color_setting_row.cpp             123     123  0.00%    15-235
src/scenes/settings_menu/color_setting_row.hpp               0       0  100.00%
src/scenes/settings_menu/settings_details.hpp                1       1  0.00%    11
src/scenes/settings_menu/settings_menu.cpp                 112     112  0.00%    20-197
src/scenes/settings_menu/settings_menu.hpp                   2       2  0.00%    23-25
src/scenes/single_player_game/game_over.cpp                 26      26  0.00%    13-64
src/scenes/single_player_game/game_over.hpp                  0       0  100.00%
src/scenes/single_player_game/pause.cpp                     36      36  0.00%    11-63
src/scenes/single_player_game/pause.hpp                      0       0  100.00%
src/scenes/single_player_game/single_player_game.cpp        75      75  0.00%    17-139
src/scenes/single_player_game/single_player_game.hpp         0       0  100.00%
src/thirdparty/hash-library/sha256.cpp                     417     417  0.00%    40-604
src/ui/focusable.hpp                                        26      26  0.00%    15-66
src/ui/hoverable.hpp                                        31      31  0.00%    16-79
src/ui/layout.cpp                                           32      32  0.00%    5-62
src/ui/layout.hpp                                           38      38  0.00%    20-143
src/ui/widget.cpp                                            4       4  0.00%    6-11
src/ui/widget.hpp                                           12      12  0.00%    29-56
src/ui/components/abstract_slider.hpp                      128     128  0.00%    28-243
src/ui/components/button.hpp                                54      54  0.00%    29-130
src/ui/components/color_picker.cpp                         321     321  0.00%    17-565
src/ui/components/color_picker.hpp                           0       0  100.00%
src/ui/components/image_button.cpp                          12      12  0.00%    5-27
src/ui/components/image_button.hpp                           0       0  100.00%
src/ui/components/image_view.cpp                            16      16  0.00%    5-34
src/ui/components/image_view.hpp                             0       0  100.00%
src/ui/components/label.cpp                                 15      15  0.00%    6-36
src/ui/components/label.hpp                                  0       0  100.00%
src/ui/components/link_label.cpp                            43      43  0.00%    6-81
src/ui/components/link_label.hpp                             0       0  100.00%
src/ui/components/slider.cpp                                39      39  0.00%    7-75
src/ui/components/slider.hpp                                 0       0  100.00%
src/ui/components/text_button.cpp                           33      33  0.00%    5-65
src/ui/components/text_button.hpp                            0       0  100.00%
src/ui/components/textinput.cpp                            248     248  0.00%    13-441
src/ui/layouts/focus_layout.cpp                            169     169  0.00%    10-296
src/ui/layouts/focus_layout.hpp                             28      28  0.00%    40-97
src/ui/layouts/grid_layout.cpp                              42      42  0.00%    5-68
src/ui/layouts/grid_layout.hpp                               0       0  100.00%
src/ui/layouts/scroll_layout.cpp                           225     225  0.00%    6-390
src/ui/layouts/scroll_layout.hpp                            13      13  0.00%    73-91
src/ui/layouts/tile_layout.cpp                              40      40  0.00%    5-57
src/ui/layouts/tile_layout.hpp                               9       9  0.00%    31-49
TOTAL                                                     8623    8044  6.71%

Results for commit: 401cb1f

Minimum allowed coverage is 0%

♻️ This comment has been updated with latest results

Totto16 added 7 commits May 24, 2024 21:29
- handle wheel input as separate pointer input, that has the advantaged, that the offset already works , without needed many new changes
- only support SDL_MOUSEWHEEL, since this event is dffernt than other pointer events
- bump required sdl version, since some fields in SDL_MOUSEWHEEL are only there since SDl 2.26.0
- replace utils::unreachable by macro, that also prints the current line and function, this is not possible with a constexpr function, so a macros has to be used
always simulate at 60 fps, an exception is, when a replay says, it uses another simulation frequency (which is not part of the standard, since this is stored in the additional information section of the recording format)
- we simulate 60 times per second, even if the display /  render frequency may be less or more
- allow faster simulation frequencies per se, since later we might add a speedup, alias play speed for recordings or similar.
- since in recordings we store the simulation index it is crucial to know which simulation_frequency we used, but it's not an additional field, so that we don#t break backwards compatibility, for that I added the additional information format earlier
@Totto16 Totto16 merged commit 08bf553 into main May 24, 2024
18 checks passed
@Totto16 Totto16 deleted the bug-fixes branch May 24, 2024 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix known bugs
1 participant