Skip to content
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

Improve recording utility #160

Merged
merged 77 commits into from
May 27, 2024
Merged

Improve recording utility #160

merged 77 commits into from
May 27, 2024

Conversation

Totto16
Copy link
Collaborator

@Totto16 Totto16 commented May 24, 2024

Failures on the Windows Wrapper Ci are related to prebuild/prebuildify#90

and are fixed by prebuild/prebuildify#91

solved by uploading it to the private package registry here

- add json serializer, atm only to_json is implemented
- use static version constant instead of hardcoded magic value for recording file version
@Totto16 Totto16 added the enhancement New feature or request label May 24, 2024
@Totto16 Totto16 added this to the 0.5.7 milestone May 24, 2024
Copy link

github-actions bot commented May 24, 2024

badge

Code Coverage Summary

Filename                                                    Stmts    Miss  Cover    Missing
--------------------------------------------------------  -------  ------  -------  -----------------------------------------------------------------------------------
src/discord/core.cpp                                          103     103  0.00%    11-180
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/command_line_arguments.cpp                             5       5  0.00%    7-16
src/game/game.cpp                                              61      61  0.00%    8-108
src/game/game.hpp                                               0       0  100.00%
src/game/graphic_helpers.cpp                                   42      42  0.00%    12-94
src/game/grid.cpp                                              73      73  0.00%    6-112
src/game/grid.hpp                                               0       0  100.00%
src/game/rotation.cpp                                          23      23  0.00%    5-37
src/game/tetrion.cpp                                          414     414  0.00%    19-652
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%    17-28
src/graphics/rect.hpp                                          23      23  0.00%    16-55
src/graphics/renderer.cpp                                      72      72  0.00%    8-125
src/graphics/renderer.hpp                                      30      30  0.00%    34-78
src/graphics/sdl_context.cpp                                   14      14  0.00%    19-54
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%    51-61
src/graphics/window.cpp                                        41      41  0.00%    6-62
src/helper/clock_source.cpp                                    28      28  0.00%    8-47
src/helper/clock_source.hpp                                     7       7  0.00%    10-25
src/helper/git_helper.hpp                                       2       2  0.00%    7-11
src/helper/graphic_utils.cpp                                   23      23  0.00%    5-117
src/helper/graphic_utils.hpp                                    0       0  100.00%
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%    22-197
src/helper/nfd_include.hpp                                      1       1  0.00%    23
src/helper/platform.cpp                                        12      12  0.00%    16-98
src/helper/platform.hpp                                         4       4  0.00%    14-36
src/input/controller_input.cpp                                161     161  0.00%    12-323
src/input/controller_input.hpp                                 52      52  0.00%    54-161
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%    9-40
src/input/guid.hpp                                             46      46  0.00%    32-135
src/input/input.cpp                                           200     200  0.00%    20-427
src/input/input_creator.cpp                                    72      72  0.00%    21-154
src/input/input_creator.hpp                                     6       6  0.00%    21-32
src/input/input.hpp                                             9       9  0.00%    119-133
src/input/joystick_input.cpp                                  205     205  0.00%    18-970
src/input/joystick_input.hpp                                   74      74  0.00%    32-437
src/input/keyboard_input.cpp                                  128     128  0.00%    8-220
src/input/keyboard_input.hpp                                   53      53  0.00%    44-159
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-97
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/libs/core/game/mino.cpp                                    10      10  0.00%    3-20
src/libs/core/game/mino.hpp                                     1       1  0.00%    19
src/libs/core/game/mino_stack.cpp                              55      55  0.00%    7-86
src/libs/core/game/mino_stack.hpp                               0       0  100.00%
src/libs/core/game/tetromino_type.cpp                          22      22  0.00%    5-45
src/libs/core/hash-library/sha256.cpp                         417     417  0.00%    40-604
src/libs/core/helper/bool_wrapper.hpp                          11      11  0.00%    15-37
src/libs/core/helper/color.cpp                                 86      36  58.14%   11-31, 38-53, 61, 75, 145-157, 161-164
src/libs/core/helper/color.hpp                                 95      86  9.47%    28-58, 80-108, 147-254
src/libs/core/helper/color_literals.hpp                       320      30  90.62%   412, 582, 647-694, 708-711
src/libs/core/helper/const_utils.hpp                           17       1  94.12%   72
src/libs/core/helper/date.cpp                                  46      46  0.00%    9-113
src/libs/core/helper/errors.cpp                                29      29  0.00%    3-49
src/libs/core/helper/errors.hpp                                 0       0  100.00%
src/libs/core/helper/parse_json.cpp                            23      23  0.00%    6-55
src/libs/core/helper/parse_json.hpp                            61      61  0.00%    27-130
src/libs/core/helper/point.hpp                                 24      24  0.00%    17-93
src/libs/core/helper/random.cpp                                13      13  0.00%    5-25
src/libs/core/helper/random.hpp                                 4       4  0.00%    21-24
src/libs/core/helper/sleep.cpp                                 15      15  0.00%    20-71
src/libs/core/helper/static_string.hpp                         30      30  0.00%    16-128
src/libs/core/helper/string_manipulation.cpp                   41       7  82.93%   16-23
src/libs/core/helper/timer.hpp                                 21      21  0.00%    16-49
src/libs/core/helper/utils.hpp                                 18      18  0.00%    46-115
src/libs/recordings/utility/additional_information.cpp        329     329  0.00%    9-564
src/libs/recordings/utility/additional_information.hpp         23      23  0.00%    33-175
src/libs/recordings/utility/checksum_helper.cpp                10      10  0.00%    5-21
src/libs/recordings/utility/checksum_helper.hpp                13      13  0.00%    21-47
src/libs/recordings/utility/helper.hpp                         81      81  0.00%    33-177
src/libs/recordings/utility/recording.cpp                      21      21  0.00%    7-48
src/libs/recordings/utility/recording.hpp                       4       4  0.00%    47-58
src/libs/recordings/utility/recording_reader.cpp              147     147  0.00%    11-278
src/libs/recordings/utility/recording_reader.hpp                0       0  100.00%
src/libs/recordings/utility/recording_writer.cpp               84      84  0.00%    5-174
src/libs/recordings/utility/recording_writer.hpp                6       6  0.00%    51-58
src/libs/recordings/utility/tetrion_core_information.hpp        6       6  0.00%    13-24
src/libs/recordings/utility/tetrion_snapshot.cpp              108     108  0.00%    13-218
src/libs/recordings/utility/tetrion_snapshot.hpp                0       0  100.00%
src/lobby/api.cpp                                             164     164  0.00%    9-339
src/lobby/types.hpp                                            13      13  0.00%    15-82
src/manager/event_dispatcher.hpp                               37      37  0.00%    36-120
src/manager/event_listener.hpp                                  6       6  0.00%    6-19
src/manager/font.cpp                                           12      12  0.00%    5-18
src/manager/font.hpp                                            3       3  0.00%    13-16
src/manager/music_manager.cpp                                 227     227  0.00%    17-403
src/manager/music_manager.hpp                                  12      12  0.00%    62-79
src/manager/resource_manager.hpp                                2       2  0.00%    30-31
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%   27, 75-76, 154-156, 205-211, 222-223, 230, 288, 313, 368-369, 385, 395-414, 424-425
src/manager/sdl_key.hpp                                         3       3  0.00%    90-92
src/manager/settings_manager.cpp                               29      29  0.00%    9-54
src/manager/settings_manager.hpp                               35      35  0.00%    19-76
src/scenes/scene.cpp                                           18      18  0.00%    19-62
src/scenes/scene.hpp                                           13      13  0.00%    25-74
src/scenes/about_page/about_page.cpp                           57      57  0.00%    19-121
src/scenes/about_page/about_page.hpp                            0       0  100.00%
src/scenes/loading_screen/loading_screen.cpp                   68      68  0.00%    16-127
src/scenes/logo/logo.cpp                                       25      25  0.00%    11-147
src/scenes/main_menu/main_menu.cpp                             97      97  0.00%    13-166
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%    19-164
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%    12-136
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%    22
src/scenes/recording_selector/recording_selector.cpp          129     129  0.00%    30-233
src/scenes/recording_selector/recording_selector.hpp            2       2  0.00%    23-25
src/scenes/replay_game/replay_game.cpp                         80      80  0.00%    14-163
src/scenes/replay_game/replay_game.hpp                          0       0  100.00%
src/scenes/settings_menu/color_setting_row.cpp                123     123  0.00%    16-236
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                    111     111  0.00%    20-196
src/scenes/settings_menu/settings_menu.hpp                      2       2  0.00%    24-26
src/scenes/single_player_game/game_over.cpp                    26      26  0.00%    14-65
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%    20-142
src/scenes/single_player_game/single_player_game.hpp            0       0  100.00%
src/ui/focusable.hpp                                           26      26  0.00%    15-66
src/ui/hoverable.hpp                                           31      31  0.00%    17-80
src/ui/layout.cpp                                              32      32  0.00%    5-62
src/ui/layout.hpp                                              38      38  0.00%    21-144
src/ui/widget.cpp                                               4       4  0.00%    7-12
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%    30-131
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%    43-100
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                                                        8523    7944  6.79%

Results for commit: ba7b483

Minimum allowed coverage is 0%

♻️ This comment has been updated with latest results

Totto16 added 24 commits May 25, 2024 02:46
- be subproject agnostic (e.g,. this project can be used as subproject)
- override teh declared dependencies, so that it's easier to use those dependencies elsewhere
- radically change the structure of the whole game so that it:
 - can be used as dependency
 - is subproject agnsotic
 - installs headers correctly
 - generates correct package files
 - make include files all use correct headers, so that they work when installed

- remove helper helper::optional, since every compiler we support supports std::optional

WIP
…ws.h", so everything that includes "api.hpp" needs to do that, even if it sucks, since header order shouldn't matter, but it does on windows xD
…ded automatically, by providing liboopetris_core

- now fmt works with clang, so not using header only lib anymore
Totto16 added 28 commits May 26, 2024 20:15
…x it by specifying a flag, to disable a gcc-14 warning
- add the NOMINMAX hack (I hate windows.h xD)
- fix building with many hacks in the bindings.py
- fix compilation in CI, since we have to use static stdlib
- fix Ci, by using libcpp in macos build
- fix binding.gyp build on mac
- wrap all main functions in a try catch, to print the exception message
- replace all usage of helper::expected<bool, T> with helper::expected<void, T>, where only true is used  as teh state of the bool, just to signify .has_value()
…at may be replaced by "#define main SDL_main" and doesn't like the noexcept attribute
…:exit() doesn't work, so trowing an exception, catching it in the main a,dn exiting via return there

- core/errors.hpp: add virtual override for std::exception what(), so that it gets a correct message, if it's used wrongly
…to be removed from an internal array due to not using JoystickLikeInput but JoystickInput
- remove service_provider member from MusicManager, it is not needed
- android handle a few special events
@Totto16 Totto16 merged commit b2271fa into main May 27, 2024
22 checks passed
@Totto16 Totto16 deleted the improve-recording-utility branch May 27, 2024 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant