1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00
Commit Graph

92 Commits

Author SHA1 Message Date
Ivan Savenko
bd5682ecc3 Merge remote-tracking branch 'vcmi/master' into develop 2024-01-19 13:49:54 +02:00
Alexander Wilms
1b85abb508 Use auto instead of redundant type in initializations using new
grep -r --include \*.h --include \*.cpp "=" * | grep -v "auto\|int\|char\|bool\|float|\double\|for\|if\|googletest\|fuzzylite\|size_t\|using\|return\|{\|}\|= \"\|= tr(\|virtual\|void" | grep -Po ".*[^ ]+ [^ ]+ [^ ]*[ ]*=.*;" | grep -v "float\|nullptr" | grep "new" | grep -v "AI/FuzzyLite" | grep \( | grep "= new" > redundant_types.txt

import re

with open("redundant_types.txt") as f:
    for line in f:
        line = line.strip()
        path = line.split(":", 1)[0]
        original_code = line.split(":")[1].strip()
        if "new " in original_code:

            cpp_type = original_code.split(" ")[0]
            if original_code.count(cpp_type) == 2:
                print()
                print(path)
                print(original_code)
                new_code = "auto "+" ".join(original_code.split(" ")[1:])
                print(new_code)

                with open(path, "r") as f:
                    filedata = f.read()

                filedata = filedata.replace(original_code, new_code)

                with open(path, "w") as f:
                    f.write(filedata)
2024-01-16 21:40:53 +00:00
Alexander Wilms
781328f282 Convert C-style casts to the more verbose C++ style 2024-01-10 00:30:35 +00:00
Alexander Wilms
5e9f98b15c Resolve intentionality issues 2024-01-10 00:23:24 +00:00
Alexander Wilms
f3277b7953 Define each identifier in a dedicated statement 2024-01-10 00:22:23 +00:00
Ivan Savenko
3383221f0b Show error message on failure to create renderer 2024-01-05 21:46:44 +02:00
Alexander Wilms
f01ec55d21 Use the "nullptr" literal.
"nullptr" should be used to denote the null pointer
2023-10-27 18:18:59 +00:00
Johannes Schauer Marin Rodrigues
a1a5bc28c2
convert line endings from CRLF (Windows) to LF (Linux/Unix)
Mixed line endings cause problems when exporting patches with
git-format-patch and then trying to "git am" a patch with mixed and
non-matching line endings. In such a situation git will fail to apply
the patch.

This commit runs the dos2unix tools on the remaining files with CRLF
(\r\n) line endings to convert them to line-feeds (\n) only.

Files that are Windows specific like *.vcxproj and *.props files were
not converted.

Closes: #3073
2023-10-19 16:23:21 +02:00
Nordsoft91
041ffceb07
Merge pull request #2952 from Alexander-Wilms/develop
Enable VSync to prevent screen tearing while scrolling across map
2023-10-01 14:08:00 +02:00
Laserlicht
293214bb61
height fix 2023-09-29 00:08:25 +02:00
Alexander Wilms
23d1638d70 Add VSync to settings 2023-09-26 18:55:25 +02:00
Alexander Wilms
73ea52c615 Enable VSync to prevent screen tearing while scrolling across map
Fixes #2935
2023-09-26 18:55:25 +02:00
Laserlicht
a2174dc83f
fix window open while sound playing 2023-09-19 11:20:16 +02:00
Nordsoft91
0a799ecc46
Merge pull request #2740 from Laserlicht/fix_cursor_issue 2023-09-11 22:20:11 +02:00
Laserlicht
2cb28178ae
code review 2023-09-10 20:52:35 +02:00
Ivan Savenko
1d0e696db6 Added RenderHandler that acts as factory for images and animations 2023-09-04 18:22:34 +03:00
Ivan Savenko
0f88b8969b Removed some usages of std string as resource path 2023-09-04 18:22:34 +03:00
Ivan Savenko
823ffa7a07 Always use ResourcePath for referencing images and animations 2023-09-04 18:22:34 +03:00
Michael
20fd0d8901
fix cursor issue 2023-09-02 18:35:32 +02:00
Michael
40c7ddcaf4
dim adventuremap 2023-08-29 22:22:22 +02:00
Ivan Savenko
ce20d913e0 Fix checking PlayerColor's for validness 2023-08-27 01:35:38 +03:00
Ivan Savenko
f13a53c1d9 Merge remote-tracking branch 'vcmi/beta' into develop 2023-08-12 17:28:47 +03:00
Ivan Savenko
0b99fc0ccb Show message box when H3 data is missing 2023-08-06 18:16:32 +03:00
Ivan Savenko
6ddac8376d Fixed possible crash on attempt to load missing font(?) 2023-08-06 17:47:12 +03:00
Ivan Savenko
5faaf175f9 Added debug information to SDL-related crashes 2023-08-06 13:31:10 +03:00
Ivan Savenko
537f9fa048 Merged master into develop 2023-08-03 23:38:32 +03:00
Ivan Savenko
723c674d81
Merge pull request #2447 from IvanSavenko/modding_handler_refactoring
(develop) Modding handler refactoring
2023-08-02 21:26:05 +03:00
Ivan Savenko
43795c39a5 Replaced all usage of SDL_Color outside of render with ColorRGBA 2023-07-31 21:07:30 +03:00
Ivan Savenko
62fddca21e Split massive CModHandler class/file into multiple parts:
- IdentifierStorage is now a separate handler in VLC
- Renamed ModHandler::Incompatibility exception to ModIncompatibility
- Extracted ModScope namespace from ModHandler
- Extracted ModUtilities namespace from ModHandler
- Split CModHandler.cpp on per-class basis
- Replaced some direct members with unique_ptr to reduce header includes
2023-07-30 22:17:47 +03:00
Ivan Savenko
a73146751c Execute cursor changes in main thread on any platform 2023-07-30 12:30:56 +03:00
Ivan Savenko
8dc009e2c9 Always show correct game resolution in settings, unaffected by scaling 2023-07-15 16:09:44 +03:00
Ivan Savenko
fb00bf4067
Merge pull request #2322 from dydzio0614/resolution-fix
Fix for fullscreen game always starting in native resolution
2023-07-13 12:57:32 +03:00
Dydzio
42db24b4b2 Fix for fullscreen game always starting in native resolution 2023-07-11 17:59:22 +02:00
Ivan Savenko
2a634b2ec0 Fixed UI updates on switching to/from fullscreen 2023-07-07 15:26:42 +03:00
Ivan Savenko
7e00a702c1 Fix switching to exclusive fullscreen to borderless windowed 2023-07-07 14:29:03 +03:00
Ivan Savenko
0c83e34093 Implemented reserved area for iOS notch / cutout 2023-07-07 14:29:03 +03:00
Ivan Savenko
5143ca266d Moved SDL renderer access to ScreenHandler class 2023-07-07 14:29:03 +03:00
krs
0ee1866f73 Added SDLImage::doubleFlip() 2023-06-11 18:45:14 +03:00
Ivan Savenko
8ea0ecaec1 show/showAll methods now use Canvas instead of SDL_Surface
- added compatibility method to Canvas to allow SDL_Surface access
- added drawBorder method to Canvas to replace CSDL_Ext method
- added drawColor method to Canvas to replace CSDL_Ext method
- minor changes to Tavern and Trade windows to adapt to new API
2023-06-02 16:42:18 +03:00
Ivan Savenko
5e86b00dda Moved input handling from GuiHandler to set of classes in eventsSDL dir 2023-05-20 01:51:49 +03:00
Ivan Savenko
ad3e54e6c0 Reduced usage of topWindow() method 2023-05-16 21:57:45 +03:00
Ivan Savenko
051a4a3c17 Encapsulation of WindowHandler state 2023-05-16 19:10:22 +03:00
Ivan Savenko
7838190ef4 Moved window stack management from GuiHandler to new class 2023-05-16 19:10:21 +03:00
Ivan Savenko
8504b891a8 Added more checks for SDL return status 2023-05-09 13:10:33 +03:00
Ivan Savenko
c01b74434c Fix cancelling spellcast with escape 2023-05-09 13:10:33 +03:00
Ivan Savenko
e26b18c139 Rename & cleanup of WindowHandler -> ScreenHandler 2023-05-09 13:10:33 +03:00
Ivan Savenko
29b10f0436 Try to enable window resize 2023-05-09 13:10:33 +03:00
Ivan Savenko
bffec0068b Fix screen updates after window resize 2023-05-09 13:10:33 +03:00
Ivan Savenko
dbc4330fc5 Fixed positioning of resource bar and town list in other windows 2023-05-09 13:10:33 +03:00
Ivan Savenko
f403766fbb Attempt to fix DPI scaling on Windows 2023-05-09 13:10:33 +03:00