1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-16 10:19:47 +02:00
Commit Graph

820 Commits

Author SHA1 Message Date
Ivan Savenko
b8beb4fb13 Fixes for various minor issues detected by Sonar Cloud 2024-06-01 11:48:30 +00:00
Ivan Savenko
df83fa33a1 Merge branch 'vcmi/master' into 'vcmi/develop' 2024-05-31 09:34:21 +00:00
Ivan Savenko
adc3441bda
Merge pull request #3998 from IvanSavenko/refactor_sdl_media
[1.6] Reorganize SDL sound/music/video handling
2024-05-31 12:02:55 +03:00
Ivan Savenko
5d6470e527
Merge pull request #4025 from IvanSavenko/shared_ptr_lib
[1.6] Use shared_ptr for library entities
2024-05-30 19:14:06 +03:00
Ivan Savenko
2aec3cde2c Fix possible crash on replaying combat after manual run 2024-05-23 12:46:28 +00:00
Ivan Savenko
d1aa4ecd10
Merge pull request #4013 from IvanSavenko/shortcuts_additions
[1.5.2] Shortcuts additions
2024-05-21 14:18:55 +03:00
Ivan Savenko
ffe14fc1fc
Merge pull request #4022 from vcmi/master
Merge master -> beta
2024-05-20 18:09:51 +03:00
Ivan Savenko
0db8266495 Implemented some of the requested shortcuts 2024-05-19 09:12:36 +00:00
Ivan Savenko
d502850054 Add network thread termination logic for adventure map animations 2024-05-18 12:15:48 +00:00
Ivan Savenko
9bfe000724 Added semi-workaround method for network thread shutdown:
Currently closing game while network thread is waiting for something is
very bug-prone, since network thread may resume during shutdown and
access partially destroyed client state.

Now if exit has been requested, the very first step would be semi-
graceful shutdown of network thread (via exception throwing). This may
in theory skip some cleanup in non-RAII code, but since game is shutting
down this does not matters much.

This logic applies to:
- shutting down while network thread is waiting for dialogs
- shuttind down while network thread waiting for animations in combat
2024-05-18 11:04:10 +00:00
Ivan Savenko
7461df161c lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
Ivan Savenko
85d8e093df Battle console: attempt to re-split string if it is too long to fit into
two lines due to line break
2024-05-17 12:22:21 +00:00
Ivan Savenko
721b15d9de Merge branch 'vcmi/master' into 'vcmi/develop' 2024-05-17 08:26:37 +00:00
Ivan Savenko
540bd16e7b Fixed video widget playback 2024-05-16 16:50:36 +00:00
Ivan Savenko
d08c7b7b8f Added VideoWidget to hide implementation details 2024-05-15 17:05:16 +00:00
Ivan Savenko
d27b854cb1 Reorganized music, video and sound players:
- All XXXplayers are now in client/media directory
- Reogranized code on one class per file basis
- Extracted interfaces from handlers. Handlers now implement
corresponding interface.
- CCS now only stores pointer to an interface
2024-05-15 17:05:12 +00:00
Laserlicht
f596fbc9b3
Apply suggestions from code review
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2024-05-14 12:44:08 +02:00
Laserlicht
e06c09d709
battle log expansion 2024-05-14 02:50:57 +02:00
Ivan Savenko
278e8ac65e Do not show preview for ranged retaliation - not implemented in lib 2024-05-10 19:51:36 +00:00
Ivan Savenko
d094a17298 Added simple damage preview for retaliations 2024-05-10 19:40:33 +00:00
Ivan Savenko
30e0a16ee9 Fix some 'new' issues reported by Sonar Cloud 2024-05-06 15:33:30 +00:00
Ivan Savenko
2861ebb515 Capture members by copy instead of capturing this due to short lifetime 2024-04-16 18:55:21 +03:00
Ivan Savenko
07d201502e Refactoring of button class to prepare for configurable button 2024-02-29 13:57:25 +02:00
Ivan Savenko
e6b339448f Refactoring & deduplication of infowindow code 2024-02-26 18:32:15 +02:00
Ivan Savenko
af671d109f Made graphical primitive-based UI more configurable 2024-02-18 20:48:45 +02:00
Laserlicht
5e3f0e631c
possibility to show small queue outside 2024-02-01 21:17:08 +01:00
Laserlicht
25188aead8
change config name 2024-02-01 20:50:58 +01:00
Laserlicht
aa2fc4b88a
adjustable queue size for embedded queue 2024-02-01 20:38:38 +01:00
Ivan Savenko
a9866bb5c6 Added RandomGeneratorUtil::nextItemWeighted convenience method 2024-01-31 00:17:40 +02:00
Ivan Savenko
5d8b65befd
Merge pull request #3575 from Laserlicht/infobox_pos
fix infobox position while disabling
2024-01-30 17:36:30 +02:00
Laserlicht
7cc004e139
code review 2024-01-29 21:33:20 +01:00
Laserlicht
7ddc87f4a2
removed unused param; optimized pos 2024-01-29 21:11:18 +01:00
Laserlicht
36881c226f
fix infobox position while disabling 2024-01-27 22:08:15 +01:00
Laserlicht
cad0d5db16
consider unlimited replay (or not) 2024-01-27 15:02:03 +01:00
Laserlicht
3e71cbcc39
Block feature is battle against human 2024-01-27 14:35:54 +01:00
Laserlicht
a2fd5039ab
setting 2024-01-27 01:16:55 +01:00
Laserlicht
e8c541f873
end with auto combat 2024-01-26 23:15:56 +01:00
Ivan Savenko
2a193effcc Merge branch 'master' into 'develop' 2024-01-25 16:23:13 +02:00
Ivan Savenko
d8a96066c6
Merge pull request #3533 from Laserlicht/battle_text
fix battle text position
2024-01-21 10:10:26 +02:00
Ivan Savenko
24d25730ad Changed checks for null with checks for hasValue 2024-01-20 16:41:10 +02:00
Laserlicht
3084cb2e46 fix battle text position
fix space
2024-01-20 14:35:21 +01:00
Ivan Savenko
6e629a6a5f split getBonusLocalFirst into two distinct method:
- const method getFirstBonus that returns single matching bonusToString
- non-const method getLocalBonus that returns bonus from current node
2024-01-19 13:56:06 +02:00
Ivan Savenko
bd5682ecc3 Merge remote-tracking branch 'vcmi/master' into develop 2024-01-19 13:49:54 +02:00
Alexander Wilms
73019c204d Replace redundant types with auto for the lvalues of template factory functions for smart pointers
grep -r --include \*.h --include \*.cpp "= std::" * | grep -v auto | grep -Po ".*[^ ]+ [^ ]+ [^ ]*[ ]*=.*;" | grep -v "auto\|int\|char\|bool\|float|\double\|for\|if\|googletest\|fuzzylite\|size_t\|using\|return" | grep -v double | grep -v si64 | grep -v si32 | grep -v ui32 | grep \< | grep -v float | tr -d '\t' | grep -v assert > 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 = ":".join(line.split(":")[1:]).strip()

        print()
        print(path)
        print(original_code)
        prefix = "auto "
        if original_code.startswith("static"):
            static = True
        else:
            static = False

        cpp_type = " ".join(original_code.split("=")[0].strip().split(" ")[0:-1])
        print(cpp_type)

        if static:
            new_code = "static auto "+ " ".join(original_code.split(" ")[2:])
        else:
            new_code = "auto "+ " ".join(original_code.split(" ")[1:])
        print(new_code)

        if True:
            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-17 12:50:00 +00:00
Ivan Savenko
0d0d3d8c80 Renamed speed -> getMovementRange, remove misleading default parameter 2024-01-14 17:14:36 +02:00
Ivan Savenko
f6e0f46040
Merge pull request #3467 from dydzio0614/hota-fixes
Fix HotA creature abilities (add bonuses allowing implementing them)
2024-01-12 21:55:18 +02:00
M
815fa26fb3 Change nix rounding, revert assert comment 2024-01-10 22:18:53 +01:00
Dydzio
d309a00025 Extra fix: fix amount position in battle creature labels 2024-01-07 21:45:39 +01:00
Dydzio
bb925e4cb0 First version of sea witch / sorceress ability 2024-01-07 19:27:32 +01:00
Laserlicht
7a6722bc45
fix spell hover 2024-01-07 18:12:17 +01:00