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

3075 Commits

Author SHA1 Message Date
Nordsoft91
aaa07e4d2e New terrain support - part 1 (#755)
Initial support of new terrains
2022-09-11 11:31:26 +03:00
Andrii Danylchenko
23bbb69eb9 #793 U shortcut for creature stack stats window 2022-09-04 10:18:25 +03:00
Andrey Filipenkov
d7650ce9c0
use Conan to make macOS CI builds for both Intel and ARM (#782)
* [CI] append platform to output artifact name if it's given
2022-08-30 17:29:00 +03:00
Nordsoft91
4f1f9e3c5d
Fix start game button for rmg without templates (#781) 2022-08-30 08:30:21 +03:00
Evgeniy Meshcheryakov
ff00747ecf Fixed 3206 Bugged 'Start Walking' animation 2022-08-15 09:23:35 +03:00
Andrey Filipenkov
c0825149cf fix error C2338 when building Client on Windows
Windows headers require the default packing option. Changing this can lead to memory corruption. This diagnostic can be disabled by building with WINDOWS_IGNORE_PACKING_MISMATCH defined.
2022-08-06 11:47:09 +03:00
Andrey Filipenkov
7150ee565a [macOS] text input handling must be done on main thread
Xcode's Main Thread Checker warns about that
2022-08-03 12:09:49 +03:00
Andrey Filipenkov
f2187f6767 fix infinite recursion when using SDL_mixer v2.6
Mix_HaltChannel -> soundFinishedCallback -> Mix_FreeChunk -> soundFinishedCallback -> ...
2022-08-03 12:08:41 +03:00
Andrey Filipenkov
0429ff61b0 don't link client to TBB 2022-07-29 11:18:36 +03:00
nordsoft
53b9434a22 Fix crash 2022-07-29 11:08:38 +03:00
Evgeniy Meshcheryakov
e38b822303 Fix crash in scenario information window if campaign has no difficulty settings 2022-07-28 11:35:14 +03:00
Andrii Danylchenko
c4dec67acc Fix movement freeze after battle in teleport 2022-06-20 09:05:05 +03:00
Soar Qin
188607b05f Replace cotire with CMake builtin precompiled headers support (Requires CMake version >= 3.16) 2022-06-17 17:20:08 +03:00
Andrii Danylchenko
2521e7bac9 Fix flickering in fullscreen 2022-06-13 16:11:53 +03:00
Andrii Danylchenko
1128abc593 Fix hero movement animation 2022-06-07 15:00:39 +03:00
Soar Qin
b061c4988c
Changes to resolution check on window creation (#747)
* Changes to resolution check on window creation:
1. Allow scaled rendering in window mode
2. Match closest logical rendering resolution while scaling is used
2022-06-06 09:46:24 +03:00
nordsoft
d92356f085 Fixed game crash: divide by zero due to threads racing 2022-05-28 14:34:36 +03:00
Konstantin
8fc14369a4
CMake presets. (#744)
* CI: use single build action
* CMake: use imported targets
* CI: do not build boost for linux
* CMake: add FORCE_BUNDLED_MINIZIP option
* linux: use external minizip and fuzzylite
* CMake: add presets
* .gitignore: ignore cmake build dirs
* github: use cmake presets
2022-05-26 08:55:20 +03:00
Andrii Danylchenko
c293b655f5 Fix one more battle ai related crash. 2022-05-21 15:41:56 +03:00
Konstantin
c6b198ce14
Warning fix (I moved C++17 and CI to another branch) (#739)
* clang warning fixes
* use CMake 3.10 due to MXE CI does not have 3.13 yet

Co-authored-by: Konstantin <rilian@niisi.ras.ru>
2022-05-19 15:14:50 +03:00
Andrii Danylchenko
b269d7fed6 Fix case when defender creature is killed with pre-attack spell like liches death ripple 2022-05-14 17:38:06 +03:00
Andrii Danylchenko
6c36a1a2f6 Tray notifications for MXE 2022-05-14 13:23:09 +03:00
Andrii Danylchenko
2fc7cf02b0 tray notification for windows 2022-05-14 13:23:09 +03:00
Konstantin
8757a577e3 CVideoHandler: fix codecContext according to docs 2022-05-14 13:22:41 +03:00
Konstantin
e7b753c222 CVideoHandler: use new ffmpeg 2022-05-14 13:22:41 +03:00
Andrii Danylchenko
1e97859fbf Fix crash when clicking scenario info during campaign gameplay. 2022-05-10 09:48:05 +03:00
Andrii Danylchenko
2710d1df50 Android: make keyboard appear and disappear only on demand 2022-05-08 17:09:17 +03:00
Andrii Danylchenko
0d15089dd4 Do not remove hero if left only with commander 2022-05-01 09:30:30 +03:00
Andrii Danylchenko
e0e3787748 When the battle is won with only summoned creatures - defeat 2022-05-01 09:30:30 +03:00
Andrii Danylchenko
fa9a420f99 Fix a few crashes 2022-04-17 09:10:53 +03:00
Andrii Danylchenko
4defbc314a Fix saves when some humans become AI. (PlayerInterface destructor clears LOCPLINT) 2022-03-21 09:38:14 +02:00
Dmitry Orlov
ea2931c6ea Fix: Get rid of 'Tile is not visible' error message 2022-01-30 12:31:07 +02:00
Andrii Danylchenko
84948820b2 exchange window move single stacks buttons 2022-01-03 15:13:46 +02:00
Andrii Danylchenko
0fd13d2f3b Change HD mod assets 2022-01-03 15:13:46 +02:00
Andrii Danylchenko
78efd09e2e Refactor HD mod army exchange 2022-01-03 15:13:46 +02:00
Andrii Danylchenko
3c0935a5b9 Artifact exchange 2022-01-03 15:13:46 +02:00
Andrii Danylchenko
8fa0b30985 Army exchange implementation 2022-01-03 15:13:46 +02:00
Andrii Danylchenko
2ce73fd4e1 Army exchange implementation 2022-01-03 15:13:46 +02:00
Arseniy Lartsev
222a0e40c7 Added code to display some HD mod buttons in hero exchange window 2022-01-03 15:13:46 +02:00
Arseniy Lartsev
24d2d5b702 New layout for hero exchange dialog with HD mod features 2022-01-03 15:13:46 +02:00
Arseniy Lartsev
c502cfc223 Added constructor with target size argument for CAnimImage
The image will be scaled to the given width (height is ignored)
2022-01-03 15:13:46 +02:00
Dmitry Orlov
8cae3398ba Feature: Army Management Shortcuts should work as in HD+ Mod 2021-11-28 20:00:43 +02:00
Dmitry Orlov
a65feb29f5 Fixed: Advanced options window issues 2021-11-13 17:02:11 +02:00
Dmitry Orlov
1ce7701168 Fixed: Animation errors should not lead to hanging 2021-11-10 20:32:54 +02:00
Dmitry Orlov
0427fa45dd Fix: Terrain description should be shown correctly 2021-11-08 21:01:30 +02:00
Dmitry Orlov
7cfd1fe0ca Fix: Captured town should not be duplicated on the UI 2021-10-31 17:33:26 +02:00
Dmitry Orlov
30b879ae5d Fixed: duplicated bonusing building. Improved: opposite bonus propagation 2021-09-12 14:30:54 +03:00
Dmitry Orlov
25d9ea1ddf Feature: Opposite Side Limiter 2021-09-04 14:15:38 +03:00
Dmitry Orlov
6f0864b47c Feature: Town Negative Bonuses. Fix: Negative bonus bearers should not be affected 2021-09-04 14:15:37 +03:00
Andrii Danylchenko
83f690e059 change SDL color key alpha to transparent 2021-08-21 09:32:52 +03:00
Andrii Danylchenko
27b3a88dda Replace App Veyor 2021-08-21 09:32:52 +03:00
Sergei Trofimovich
23215e039c client/CVideoHandler.cpp: fix crash on video playback
Avoid buffer overflow caused by sws_scale():
    http://trac.ffmpeg.org/ticket/9254
Currently (ffmpeg-4.4 with SSE3 enabled) sws_scale()
has a few requirements for target data buffers on rescaling:
1. buffer has to be aligned to be usable for SIMD instructions
2. buffer has to be padded to allow small overflow by SIMD instructions
Unfortunately SDL_Surface does not provide these guarantees.
This means that atempt to rescale directly into SDL surface causes
memory corruption. Usually it happens on campaign selection screen
where short video moves start spinning on mouse hover.

To fix [1.] we use av_malloc() for memory allocation.
To fix [2.] we add an `ffmpeg_pad` that provides plenty of space.
We have to use intermdiate buffer and then use memcpy() to land it
to SDL_Surface.

Without the change crash has the following backtrace:

```
(gdb) bt
    (c=0x47508940, src=0x1ffeffef50, srcStride=0x1ffeffef30, srcSliceY=0, srcSliceH=116, dst=0x1ffeffef70, dstStride=0x1ffeffef40) at src/libswscale/x86/yuv2rgb_template.c:119
    (c=<optimized out>, srcSlice=<optimized out>, srcStride=0x432afa20, srcSliceY=<optimized out>, srcSliceH=116, dst=<optimized out>, dstStride=0x1ffefff0a0) at src/libswscale/swscale.c:969
    (this=0x1abaa330, x=90, y=72, dst=0x1a85a4c0, forceRedraw=<optimized out>, update=<optimized out>)
    at ../vcmi-9999/client/CVideoHandler.cpp:332
    at ../vcmi-9999/client/gui/CIntObject.cpp:83
    at ../vcmi-9999/client/gui/CGuiHandler.cpp:462
```

valgrind points to corruption right in sws_scale():

```
Invalid write of size 8
   at 0x6C50BD3: ??? (in /usr/lib64/libswscale.so.5.7.100)
   by 0x6C4FAE6: yuv420_rgb32_ssse3 (yuv2rgb_template.c:119)
   by 0x6C28DF2: sws_scale (swscale.c:969)
   by 0x4566F6: CVideoPlayer::nextFrame() (CVideoHandler.cpp:293)
   by 0x4573A6: CVideoPlayer::update(int, int, SDL_Surface*, bool, bool) (CVideoHandler.cpp:332)
   by 0x25EC94: CIntObject::show(SDL_Surface*) [clone .part.0] (CIntObject.cpp:83)
   by 0x34E855: CMainMenu::update() (CMainMenu.cpp:319)
   by 0x25D589: CGuiHandler::renderFrame() (CGuiHandler.cpp:462)
   by 0x1F7450: mainLoop (CMT.cpp:1387)
   by 0x1F7450: main (CMT.cpp:513)
 Address 0x475088a8 is 0 bytes after a block of size 92,840 alloc'd
   at 0x483F7E5: malloc (vg_replace_malloc.c:380)
   by 0x52B4E23: SDL_malloc_REAL (SDL_malloc.c:5387)
   by 0x5266237: SDL_SIMDAlloc_REAL (SDL_cpuinfo.c:963)
   by 0x52EF042: SDL_CreateRGBSurfaceWithFormat_REAL (SDL_surface.c:123)
   by 0x2649AC: CSDL_Ext::newSurface(int, int, SDL_Surface*) (SDL_Extensions.cpp:42)
   by 0x457B20: CVideoPlayer::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, bool, bool) (CVideoHandler.cpp:182)
   by 0x457C60: CVideoPlayer::open(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool) (CVideoHandler.cpp:84)
   by 0x35B14E: CCampaignScreen::CCampaignButton::show(SDL_Surface*) (CCampaignScreen.cpp:126)
   by 0x25EC94: CIntObject::show(SDL_Surface*) [clone .part.0] (CIntObject.cpp:83)
   by 0x34E855: CMainMenu::update() (CMainMenu.cpp:319)
   by 0x25D589: CGuiHandler::renderFrame() (CGuiHandler.cpp:462)
   by 0x1F7450: mainLoop (CMT.cpp:1387)
   by 0x1F7450: main (CMT.cpp:513)
```

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2021-07-31 14:35:31 +03:00
Andrii Danylchenko
3fa7e0976f Nullkiller: update / fix build, core changes required for Nullkiller AI 2021-07-26 21:02:50 +03:00
Andrii Danylchenko
b4241670ba Nullkiller: rename VCAI to AIGateway 2021-07-26 21:02:50 +03:00
Sergei Trofimovich
e407d4e547 client/lobby/CBonusSelection.cpp: fix difficulty overflow in bonus UI
Before the change campaign bonus selection screen had inconsistent
overflow behaviour for difficulty selection:

```
    0 1 2 3 4 | available buttons: '-' to decrease
      ^       |                    '+' to increase
```

Before the change:

1. If we click '+' 5 times we will end up on difficulty=4 (ok, saturated).
2. If we click '-' 5 times we will end up on difficulty=1 (unexpected, wrap around).

After the change:

1. If we click '+' 5 times we will end up on difficulty=4 (saturated).
2. If we click '-' 5 times we will end up on difficulty=0 (saturated).

The inconsistency happens because `difficulty` variable has `ui8` type
and server uses `difficulty = vstd::abetween(difficulty, 0, 4)` to
implement the saturation.

For large positive values saturation works as expected:
    vstd::abetween(difficulty=5, 0, 4) -> 4
For small values it does not:
    vstd::abetween(difficulty=-1, 0, 4) -> 4

The change makes client to avoid using negative values.
2021-07-25 21:01:17 +03:00
Sergei Trofimovich
e4dd2f6dd8 client/lobby/SelectionTab.cpp: initialize generalSortingBy before use
Noticed use of uninitialized value when built vcmi with -fsanitize=undefined:

```
  Established connection with
    VCMI 0.99 b310f2e61e (server).
    UUID: bab9a90d-7416-4566-8817-e367ffcac7c1
  ../vcmi-9999/client/lobby/SelectionTab.cpp:138:16:
    runtime error: load of value 32717, which is not a valid value for type 'ESortBy'
  /usr/lib/gcc/x86_64-pc-linux-gnu/12.0.0/include/g++-v12/tuple:190:4:
    runtime error: load of value 32717, which is not a valid value for type 'ESortBy'
  /usr/lib/gcc/x86_64-pc-linux-gnu/12.0.0/include/g++-v12/tuple:190:4:
    runtime error: load of value 32717, which is not a valid value for type 'ESortBy'
```

Here (before the change) `SelectionTab()` used `generalSortingBy` before
first use:

```
    SelectionTab::SelectionTab(ESelectionScreen Type) {
        ...
        if(tabType != ESelectionScreen::campaignList)
        {
            ...
                ESortBy criteria = (ESortBy)i;
                if(criteria == _name)
                    criteria = generalSortingBy;

                buttonsSortBy.push_back(... std::bind(&SelectionTab::sortBy, this, criteria)));
            ...
        }
        ...
        switch(tabType)
        {
        case ESelectionScreen::newGame:
                generalSortingBy = ESortBy::_name;
        ....
```

The change moves `generalSortingBy` initialization before first use.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2021-07-25 21:00:31 +03:00
Andrii Danylchenko
9c8d776398 Merge branch 'develop' into handlersAbstraction
# Conflicts:
#	CI/linux/before_install.sh
#	CI/mac/before_install.sh
#	CI/mxe/before_install.sh
#	lib/CModHandler.cpp
#	lib/mapObjects/CObjectClassesHandler.cpp
#	lib/mapObjects/CObjectClassesHandler.h
#	lib/mapObjects/CommonConstructors.cpp
#	server/CGameHandler.cpp
#	test/CMakeLists.txt
#	test/spells/effects/TeleportTest.cpp
2021-07-16 00:32:13 +03:00
AlexVinS
483a4689ce Fixes for code review issues 2021-02-20 04:57:50 +03:00
Vladislav Yakovlev
8e57d36b8c [3167] Fix SDL_StopTextInput extra calls 2021-02-15 21:11:18 +03:00
AlexVinS
a59e12ca5f tweaks 2021-02-15 15:03:32 +03:00
AlexVinS
ecaa9f5d0b Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2021-02-14 19:05:43 +03:00
Alexander Shishkin
db1f9a15b0
Merge pull request #675 from ShubusCorporation/do/fix/mod_system_and_interface_bugs
Fixed: Mods dependency issues leading to hanging & 'Restart Scenario' button functionality
2021-02-08 07:32:09 +03:00
Andrii Danylchenko
ade84699b0 found a bug in code where AI can change client gamestate directly causing sorting crash 2021-01-30 17:29:49 +02:00
Alexander Shishkin
5dc6d782f7
Merge pull request #674 from ShubusCorporation/do/fix/game_interface/load_and_main_menu_buttons
Fix: 'Load' and 'Main Menu' in-game buttons should work properly
2021-01-20 21:52:51 +03:00
Dmitry Orlov
3add3156e2 Fix: 'Restart Scenario' button should work properly 2021-01-20 21:29:50 +03:00
Dmitry Orlov
c99b8b54e6 Fix: 'Load' and 'Main menu' in-game buttons should work properly 2021-01-17 19:18:26 +03:00
Dmitry Orlov
8cd1af6998 Fix: Siege crashes when creature on the archer's tower is not a shooter 2021-01-17 15:02:58 +03:00
Dmitry Orlov
854a2e6c39 Feature: Mods system improvement, Part III. Bunusing buildings customization. 2021-01-14 01:02:13 +03:00
Dmitry Orlov
9cf953157a Fix: client crashes while browsing saves, if some factions are removed 2021-01-06 17:19:59 +03:00
Dmitry Orlov
39de2f6435 Fix: Morale bonus should be shown correctly 2020-11-11 22:43:40 +03:00
Alexander Shishkin
9ca9c809c6
Merge pull request #660 from ShubusCorporation/shc_rmg_issue
Mod system improvement: Patch 2
2020-10-26 09:26:14 +03:00
John Bolton
bb58d349cb Fixed potential race condition 2020-10-24 23:38:39 -07:00
Dmitry Orlov
d6a4767865 Mod system improvement: Patch 2 2020-10-25 01:04:34 +03:00
Alexander Shishkin
ff7fd2077a
Merge pull request #658 from ShubusCorporation/shc_test_centered
Fix: Issue #3151 - text centralization
2020-10-16 08:33:37 +03:00
Dmitry Orlov
e7665ba5de Fix: Issue #3151 - text centralization 2020-10-16 06:08:59 +03:00
Dmitry Orlov
934c4e511d Special buildings support : Patch 1 2020-10-15 15:03:01 +03:00
Dmitry Orlov
195fb8ff41 Mod system improvement Part I : Fix content losing after deserialization 2020-10-10 00:31:23 +03:00
Dmitry Orlov
f4816b0824 Mod system improvement Part I : Special buildings should work in the modders towns 2020-10-07 12:35:11 +03:00
John Bolton
c61bae4060 Fixed RETURN_IF_BATTLE(). Undid disabled warnings. Fixed indentation. 2020-10-05 16:28:28 -07:00
John Bolton
1722d15276
Update client/windows/CCreatureWindow.h
Removed leftover debugging code.

Co-authored-by: Alexander Shishkin <alexvins@users.noreply.github.com>
2020-10-05 16:13:13 -07:00
John Bolton
a05ae78e67 Fixed lots of warnings.
Disabled the following (for MSVC only) that couldn't (or shouldn't) be fixed.

4003: not enough actual parameters for macro 'identifier'
4250: 'class1' : inherits 'class2::member' via dominance
4251: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
2020-10-04 02:20:18 -07:00
John Bolton
6d8f1e4530 Fixed incorrect usage of const std::shared_ptr. Resolves 0003142.
Replaced const TBonusListPtr with TConstBonusListPtr where necessary
Replaced const std::shared_ptr<T> with std::shared_ptr<const T> where necessary.
Removed superfluous use of const.
Replaced const std::shared_ptr<T> with const std::shared_ptr<T> & in function parameters and ranged for-loops.
2020-09-30 22:56:28 -07:00
Dmitry Orlov
38fd05f655 Minor fix: apply Monday bonuses to heroes who have slept overnight 2020-09-28 01:32:33 +03:00
laikh
edc1d06f4e Random Map Generator Option: Allow having more computer only players than human/computer players
Remove unused variable humanPlayersCount and function getHumanOnlyPlayerCount()
2020-07-07 19:45:53 +08:00
laikh
90e2ab58a8 Include header SDL_Compat.h in AdventureMapClasses.cpp 2020-07-05 21:10:29 +08:00
Victor Luchits
f68b449e5e More formatting 2020-05-17 11:21:49 +03:00
Victor Luchits
604246bc7a VS 2019/Windows 10 Kit fix 2020-05-05 15:25:07 +03:00
Victor Luchits
febbeaeeed Close the global log targets on exit, flushing log files to disk 2020-05-05 15:25:07 +03:00
Arseniy Lartsev
fca9bcdd7f
Fixed possible freezes while dragging visible area on minimap (#638) 2020-05-03 01:26:30 +03:00
AlexVinS
55b54024a8 Cherry-picked essential fix from #631. This fixes https://bugs.vcmi.eu/view.php?id=3074. 2020-03-18 00:06:07 +03:00
Alexander Shishkin
00de1fd734
Merge pull request #625 from Toneyisnow/toneyisnow/Battle_Clone_Effect
Implement the Clone Effect in battle.
2020-01-27 13:42:58 +03:00
toneyisnow
1319175bdc Removed the create functions in the ColorShifter classes. 2020-01-27 00:34:59 -08:00
toneyisnow
a03e696ec0 Updated const. 2020-01-26 16:18:07 -08:00
toneyisnow
8db638c054 Fix tiny space issue and remove reference of SDL.h 2020-01-26 00:05:38 -08:00
toneyisnow
468584d469 Update the originalPalette, and use SDL_Palette methods to improve memory management. 2020-01-26 00:01:48 -08:00
toneyisnow
0f4a9e5106 Updated resolved some issues. 2020-01-25 18:49:53 -08:00
toneyisnow
0f3dabab9a Initialize the change:
1. Make color shifter for CAnimation, and use that in the clone effect.
2. Update the original position of the cloned object.
2020-01-25 01:21:26 -08:00
Alexander Shishkin
304b6e2fb2
Merge pull request #624 from Toneyisnow/toneyisnow/Fixbug_LobbyScreen_LoadGame
Fix bug: LobbyScreen UI has a bug on the Difficulty toggle group.
2020-01-23 16:13:51 +03:00
toneyisnow
8341ba3c27 Update according to comments. 2020-01-22 23:07:20 -08:00
toneyisnow
01ca21ae67 Fix bug: LobbyScreen UI has a bug on the Difficulty toggle group.
Scenario: In LoadGame Lobby screen, the difficulty toggle group is showing multiple choices, but actually only one valid is working.

The reason is, in the Lobby screen Initialization code will set the difficulty = 0, and each time the player changes a map in the selection, the toggle group control is not resetting the difficulty buttons to disabled state.

How fix:
Add a new method to ToggleGroup class: setSelectedOnly, which will disable all other buttons and then set the selected button.

Note:
During the game loading time, the client is loading the map, and send a NetPack to server: LobbySetMap, and send a NetPack to Interface: LobbyUpdateState.
In the LobbyUpdateState it sets the map difficulty.
2020-01-21 01:09:08 -08:00
toneyisnow
0fe3c0a569 Initialize the change. 2020-01-19 04:12:59 +00:00
Alexander Shishkin
5afcb070fa
Merge pull request #621 from sztupy/android_fix_sdl_letterboxing
Fix SDL letterboxing on Android builds
2020-01-08 10:17:03 +03:00
Zsolt Sz. Sztupák
e6f1ab6539 Fix SDL letterboxing on Android builds
On Android calling `SDL_RenderSetLogicalSize` with dimensions having a different aspect ratio than the screen will cause letterboxing with blinking garbage data in that areas (instead of having black bars). This is annoying and makes the game really hard to play.

This change will make sure that on Android `SDL_RenderSetLogicalSize` will always be called with dimensions where the aspect ratio is the same as the screen to make sure there is no letterboxing.

The only problem with this is that during drawing the adventure map nothing will clear out the areas that would have been letterboxes, so there is an added explicit clear screen command for `totalRedraw()`.

The changes are only applied to Android builds in order not to affect PC builds - but some changes, especially clearing the screen could be easily added to the PC builds as well
2020-01-06 18:46:56 +00:00
Zsolt Sz. Sztupák
3c5194a232 Add support for the Android App to notify if the server has been closed
When winning the campaign there is a lock that waits for the old server to stop before allowing to continue with restarting the server. While the lock was released on PC builds as the server runs differently on Android this was missed making campaigns always hang the app when you win.

This change adds a new native method that can be called from the Android app to signal that the server has stopped, so the client can continue with requesting a new server and showing the new campaign scenatio screen.

Note: this change alone doesn't fix the bug but it's required for a fix on vcmi-android's side. It doesn't break anything and can be merged before the vcmi-android changes
2020-01-06 16:43:02 +00:00
JakubK
a8d5081895 More mouse scrolling fixes
Defect:
After my previous change that enabled map layer (`CAdvMapInt`) to listen to all mouse move events via `strongInterest` bool, I noticed that there are a few scenario that start scrolling the map unexpectedly. The two that were the easiest to reproduce were using keyboard arrows to move the hero or dimissing a popup dialog.

I traced this down to unexpected mouse move event (`SDL_MouseMotionEvent`) that SDL seems to dispatch in this situation. The windowID that comes with the event in this scenario is 0 (so no window with mouse focus). I don't know why SDL dispatches this mysterious (to me) mouse move event in that case (note that there is no actual mouse movement in either repro case).

Fix:
Don't handle the mouse move event if the windowID of the mouse motion event is 0.

Notes:
Impacts scrolling of the game map. Did some play testing and didn't notice the scrolling not working when expected. The two specific cases where the map would scroll unexpectedly (move a hero with keyboard arrows or dismiss a popup dialog) no longer move the map.
2020-01-04 22:45:33 -08:00
JakubK
09cd4c072a Defect:
In fullscreen mode, when the adventure window size does not fill the entire monitor (leaving black bars on each side), mouse movement is ignored in these areas. This results in difficulty scrolling the map in fullscreen mode, since you have to be exactly within [0,15] of the edge of the adventure window.

Fix:
Have the adventure map element, CAdvMapInt, subscribe to all mouse move events by setting the `strongInterest` bool to true. This will extend the scroll region to [min, 15], eliminating the dead mouse move space on the side of the window.

Notes:
Impacts adventure window mouse move event handling. Manually validated the scrolling the map now works without having to precisely aim for the edge of the window.
2019-12-26 10:10:39 -08:00
Dydzio
54550b50de Update VS files to 2019, partially fix test project 2019-06-09 17:28:55 +02:00
Dydzio
492d6504b4 Fix all common victory/defeat crashes 2019-06-08 16:59:04 +02:00
Dydzio
fd9f16142d Revert old statusbar hackfix 2019-06-06 22:56:14 +02:00
Alexander Shishkin
5ccc411971
Merge pull request #601 from dydzio0614/HotseatFreezeFix2
Fix dialog showing for losing player
2019-06-02 02:54:58 +03:00
Dydzio
61ae6ce286 Remove useless and wrong recruit conditions 2019-06-01 20:29:49 +03:00
Dydzio
eb19806cf5
Fix dialog showing for losing player 2019-06-01 19:28:21 +02:00
AlexVinS
1f2ee843aa [C::B] Switched to boost shared linkage 2019-05-30 20:55:40 +03:00
Dydzio
5470f9cafe Re-fix map hero movement speed, was too fast on land 2019-05-26 17:11:57 +02:00
Alexander Shishkin
54bbf2abb3
Merge pull request #595 from dydzio0614/BattleConsoleButtons
Fix wrong battle console button image
2019-05-21 10:05:01 +03:00
Alexander Shishkin
6ddebfd43e
Merge pull request #594 from dydzio0614/HeroSpeedFix
Fix hero/boat speed on adventure map
2019-05-19 21:49:53 +03:00
Alexander Shishkin
26e70a236e
Merge pull request #593 from dydzio0614/PerformanceTweak
Tweak statusbar options, fixes mouse stuttering
2019-05-19 21:48:36 +03:00
Dydzio
2c0b0b8cf9 Fix wrong battle console button image 2019-05-19 19:58:53 +02:00
Dydzio
8df015b3ad Fix hero/boat speed on adventure map 2019-05-19 19:08:32 +02:00
Dydzio
a06ca4b5cf Tweak statusbar options, fixes mouse stuttering 2019-05-19 16:19:16 +02:00
Dydzio
cd78779d9c Remove false warning indicating something is wrong 2019-05-19 12:22:41 +02:00
Ewilhan
1afbdf7027 CSoundHandler: fix "unmutable" game (#588)
After a sound fade, now uses current volume instead of setting it to 100.

Fixes #3050.
2019-05-07 06:30:44 +03:00
Ewilhan
b5243602ca Fix wrong savefiles shown while playing Hotseat Mode (#585)
* Fix wrong save files shown in HotSeat mode

Previous condition only checked for players' connection ID. HotSeat mode does not use multiple connection IDs, so getLoadMode() thought it was SPMode.
Now checking number of interfaces to cover offline-multiplayer.
2019-05-04 16:56:17 +03:00
Dydzio
54e6e42c46 Fix no player interface swap on being attacked 2019-05-04 10:07:52 +03:00
Dydzio
e50efdc279 Creature spellcast refactor (#569)
* Move some logic to lib
* Mouse action priority queue enhancement
* Get rid of siegehandler dependency
* Improve AI offensive spellcasting
* CBattleInterface cleanup
2019-05-04 06:42:55 +03:00
Dydzio
d50add0246 Remove apparently useless code 2019-05-03 16:50:36 +02:00
Ewilhan
42114fa4fc Fixed wrongCursorOnFriendlyDwelling
Added else condition that covers cases "ObjectAtTile that is not enemy nor is Town nor is current Hero". This should cover all cases of friendly dwellings/mines not having the correct cursor.
2019-05-03 06:20:32 +01:00
ArseniyShestakov
fd2a33bc36
Merge pull request #571 from dydzio0614/VictoryCrashFix
Victory crash/freeze fix
2019-04-22 08:50:00 +03:00
Dydzio
f7262730b1 Defer SDL mixer free on 1st handler release (#578) 2019-04-21 22:09:14 +03:00
Dydzio
c428e326b9 Optimize button responsiveness during pregame options 2019-04-20 18:26:54 +02:00
Dydzio
1cc2ef537b Add proper thread synchronization for campaigns 2019-03-30 00:28:33 +01:00
Dydzio
2b6fe9298a Hackfix for campaigns 2019-03-29 23:29:48 +01:00
Dydzio
97869fc36f Fixed single map victory crash 2019-03-29 22:01:51 +01:00
Michał Kalinowski
ec536e613c CMake more transitive
-Moving AIs cmake to target focusing code
-Beign explicit when link libraries
2019-03-28 16:56:51 +03:00
Alexander Shishkin
34f934370b
Merge pull request #565 from dydzio0614/moralewaitfix
Fix lack of unit action with morale+wait
2019-03-24 10:49:49 +03:00
Alexander Shishkin
9ad71b200f
Merge pull request #562 from dydzio0614/BattleIntroFix
Battle action start on client after intro sound
2019-03-24 10:36:01 +03:00
Dydzio
9e4619c08d Fix lack of unit action with morale+wait 2019-03-23 23:51:50 +01:00
Dydzio
68992fbbb8 Minor fix 2019-03-23 12:12:25 +01:00
Dydzio
262057ad1c Battle action start on client after intro sound 2019-03-22 21:39:53 +01:00
Dydzio
e1bf821c27
Tweak effect / spell animation speed
After reducing the value by half effect / spell projectile speed is really close to original H3 compared to other actions on same speed setting.
2019-03-22 14:21:27 +01:00
AlexVinS
9311966706 [C::B] Switch to MinGW 7.3 2019-02-19 14:59:10 +03:00
Mikko
02c109f9cf
Update CAdvmapInterface.cpp 2019-01-24 15:34:58 +00:00
Mikko
f8ab2db0ea
Update CAdvmapInterface.cpp 2019-01-24 15:30:09 +00:00
Mikko
5b8ff278b9
Fix implicit cast from tribool to bool. 2019-01-24 14:45:40 +00:00
Michał Kalinowski
a0d1808b62 CMake transitive compile dependency
Moving to more target focusing code that provides better transitive scope
2019-01-19 17:38:54 +03:00
Alexander Shishkin
b00e935e4d
Warnings fixes (#538)
Warnings fixes
* Suppress `missing-braces` for Clang
* Fixed many C4275 warnings
* Fixed almost all Clang/GCC warnings
* Silence most frequent MSVC warning.
* Fixed some pessimizing-move warnings
* Fixed some unused capture warnings
2019-01-19 13:52:02 +03:00
AlexVinS
4b5910c2f4 VCAI performance improvements
* Node graph initialization optimized.
* Fixed "Unathorized obstacle access".
* Pathfinding tracing disabled with ifdef.
* Misc bonus calculation optimizations.
* Removed timestamp from log lines. Date formatting eats too much CPU.
* Paths for all heroes in Client are now cached
2019-01-17 10:50:56 +03:00
Dydzio
216d50788b Fix AI build, update default Windows SDK version for projects 2018-12-31 15:18:42 +01:00
Dydzio
c3088e293a Workaround linker bug, set higher optimization by default 2018-11-17 11:34:39 +01:00
Alexander Shishkin
2748650a57
Merge pull request #521 from dydzio0614/BattleMemoryLeak
Fix creature animation callback circular reference
2018-11-15 02:17:20 +03:00
Dydzio
0fd729fd86 Fix creature animation callback circular reference 2018-11-14 23:36:38 +01:00
AlexVinS
614cde4a55 Fixed two memory leaks 2018-11-14 20:58:37 +03:00
AlexVinS
5693e72442 fixed crash on quit 2018-11-07 11:11:07 +03:00
Dydzio
9f3d718e3b Allow AI to be aware of invisible heroes deletion 2018-11-02 16:35:25 +01:00
Alexander Shishkin
e5397c1e23
Merge pull request #504 from janisozaur/shadow-var
Prevent shadowing of global variable in function argument
2018-10-30 06:37:12 +03:00
Alexander Shishkin
3d1bb9850b
Merge pull request #506 from janisozaur/shadow-var2
Prevent shadowing of function arguments by local vars
2018-10-30 05:07:40 +03:00
Michał Janiszewski
aa28fc4794 Remove empty branch from LobbyClientConnected::applyOnLobbyScreen (#507)
It was empty ever since introduction in ac66fc7f42

[ci skip]
2018-10-30 04:59:02 +03:00
Alexander Shishkin
a3a38a6120
Merge pull request #502 from vcmi/StatusbarFix
Fix not responding statusbar, issue 3009
2018-10-30 04:56:34 +03:00
Michał Janiszewski
7be9aa4868 Prevent shadowing of function arguments by local vars 2018-10-29 16:56:14 +01:00
Michał Janiszewski
53d75684ee Prevent shadowing of global variable in function argument 2018-10-29 16:34:03 +01:00
Dydzio
22ce535a2a Fix not responding statusbar 2018-10-29 14:12:07 +01:00
godric3
7ded9dbda8 Fix crash when generating random map with random number of players 2018-10-27 18:18:08 +02:00
Dydzio
57b687a094 Fix crash on portal teleport when it's 1st action in movement (#491) 2018-09-16 17:01:36 +03:00
Fior.in
47ba3b2476 Hero scheme: allow each hero to have a unique battle animation (#480)
* attribute for battle image added on hero class, allowing on hero schemes each hero have a unique battle .def in 'images' structures sided with portraits and specialties images
2018-08-27 09:42:36 +03:00
KasyanDiGris
fa5a14e2d8 Stabilize vcmi (#488)
* Shared statusbar
* Fixed server fails on client disconnected
2018-08-26 19:09:56 +03:00
Dydzio
b61d1ac857 Fix broken RMG monster strength buttons 2018-08-24 19:20:27 +03:00
Konstantin Vukolov
96215233bc macOS: fix packet deserialization (#479) 2018-08-14 01:03:45 +03:00
yupinov
b56f862094 Yog is not able to buy a spellbook in his campaign anymore, as intended (#472)
* Yog is not able to buy a spellbook in his campaign anymore, as intended
2018-08-11 18:25:09 +03:00
AlexVinS
d1931c91d7 Fixed wrong cursor position in full screen mode 2018-08-11 17:42:28 +03:00
Alexander Shishkin
75f8c8b29a Gui cleanup4 (#446)
* use smart pointers for almost all widget fields
* use SDL2 texture for cursor
* a lot af small tweaks and formatting
* removed CompImage class, it is actually useless as long as regular SDLImage support margins
* CGuiHandler: use smart pointers for [push|pop]Int
2018-07-25 01:36:48 +03:00
Dydzio
e4a9ce3efe Do not create main menu UI for game restart (#462) 2018-07-19 00:58:38 +03:00
Dydzio
260981d586 Update project files to match vcmi code changes 2018-07-06 18:52:51 +02:00
Andrii Danylchenko
dcbcff41dc apply review comments for CAndroidVMHelper 2018-05-26 14:50:49 +03:00
Andrii Danylchenko
ee033e9c9c fix android build 2018-05-25 22:57:29 +03:00
Karlis Senko
224ea28433 Fix various memory errors related to server and connections.
* keep connection when restarting scenario
* wrong double free in Connection
* multiple use after free when stopping server
* double free of StartInfo
2018-05-01 00:04:20 +03:00
Karlis Senko
69330de89c Avoid integer overflow and conversion related UB. 2018-05-01 00:02:07 +03:00
Karlis Senko
40e6292ed2 Fix memory leaks in launcher. 2018-05-01 00:01:20 +03:00
Karlis Senko
7fb7ceaad7 Prevent out of bounds array access. 2018-04-30 23:59:36 +03:00
Johannes 'josch' Schauer
5d487c09fe
client/CPlayerInterface.cpp: initialize observerInDuelMode 2018-04-19 16:13:19 +02:00
Johannes 'josch' Schauer
337f22195c
client/CPlayerInterface.cpp: remove unused variable 2018-04-19 15:26:39 +02:00
Johannes 'josch' Schauer
ed5df13e50
client/battle/CBattleInterface.cpp: uncomment unused variable until soundh->playSound() is implemented 2018-04-19 15:20:26 +02:00
Henning Koehler
2ede3783dd Settings: savefrequency is now configurable in launcher
* Client command-line can modify arbitrary settings now
* Only launcher auto-saves to settings.json
2018-04-08 17:12:29 +07:00
karliss
ce0b4b222d Fix double free and use of dead reference when saving (#445) 2018-04-07 22:21:28 +07:00
Arseniy Shestakov
4af288aee4 Refactoring of main menu related code
We need to make sure it's not stay active during gameplay.
Proper fix would require actually removing menu interface from GH, but then GH needs refactoring too.
2018-04-07 18:44:21 +07:00
Alexander Shishkin
5c09f751b3 Gui cleanup3 - UI refactoring to use smart pointers (#440)
* Changed most gui classes to use shared pointers
* Store and use IImage as shared_ptr
* CSpellWindow redesign
* AdventureMapClasses cleanup
* CLabel: store background as smart pointer
* Store CObjectList items as smart pointers
* Removed destroy function of list item
* Store toggle buttons as smart pointers
* Use CComponent as smart pointer
* Attempt to fix artifact merchant drawing
2018-04-07 18:34:11 +07:00
AlexVinS
a8e1c51c36 [c::b] projects update 2018-04-05 21:12:21 +03:00
Arseniy Shestakov
74e5c5bf05 CGameHandler: rename CPackForClient argument and add network logging 2018-04-04 14:24:32 +07:00
Arseniy Shestakov
ac66fc7f42 Full rework of pre-game interface and networking
New features for players:
* Loading for multiplayer. Any save could be used for multiplayer.
* Restart for multiplayer. All clients will restart together.
* Loading from single save.
* Hotseat mixed with network game. Multiple players per client.
* Now connection to server could be cancelled.
* Return to menu on disconnections instead of crashes.
* Restoring of last selected map, save or campaign on next run.

TLDR on important changes in engine code:
* UI: work with server separated from UI
* UI: all explitic blitting replaced with IntObject's
* UI: all new code use smart pointers instead of DISPOSE
* Gameplay always start through lobby controlled by server.
* Threads receiving netpacks now shared for lobby and gameplay.
* Campaigns: heroes for crossover now serialized as JsonNode.
2018-04-04 14:24:26 +07:00
Arseniy Shestakov
14f03e22da CLabelGroup: add currentSize method
Might be someone will suggest me better name.
And actually I need method to clean group too.
2018-04-03 22:11:14 +07:00
Arseniy Shestakov
ab2b9086d3 CLabel: add methods getWidth, setColor, setAutoRedraw
For somethign like map list we need to change CLabel data without redrawing it.
2018-04-03 22:11:14 +07:00
Henning Koehler
6ddcb079a4 Enabled new secondary skills to be created (#438)
* Universities, Scholars and Witch Huts may offer new skills
* Moved encode/decodeSkill to CSkillHandler
* Refactored CSkill interface and CSkill::LevelInfo image storage
* Legacy game constants renamed to ORIGINAL_XXX_QUANTITY
2018-03-31 12:56:40 +07:00
AlexVinS
b09a54fa9c [tweaks] IImage * -> auto 2018-03-30 14:29:55 +03:00
AlexVinS
43acfa160b [tweaks] IImage * -> auto 2018-03-30 14:02:04 +03:00
AlexVinS
031d3204f7 Fixed "Error: accessing unavailable frame" in some cases 2018-03-30 13:40:40 +03:00
Henning Koehler
02b5a5e830 Make bonus stacking configurable + fix duplicate propagation/inheritance (#433)
Addresses several related problems:
* Propagation / unpropagation of duplicate bonuses is inconsistent, causing bugs
* Duplicate bonuses never stack, which is not always intended behaviour (e.g. multiple copies of resource generating artifacts)
* Different bonuses always stack, which is not always intended behaviour (e.g. Angel + Archangel morale bonuses)

This is addressed as follows:
* Duplicate bonuses are never eliminated during propagation/inheritance.
* Unpropagation eliminates only a single copy of duplicated bonus
* Bonus receives a new field stacking that determines stacking behaviour:
* * empty string = no stacking with duplicates (default)
* * "ALWAYS" = stacks with duplicates & everything else
* * some other value = no stacking with bonuses with same stacking value
Also Morale/Luck window now hides non-stacking bonuses.
2018-03-27 14:54:58 +07:00
AlexVinS
cac83379f5 Fixed https://bugs.vcmi.eu/view.php?id=2928 2018-03-22 12:56:15 +07:00
AlexVinS
df0aa2f69c Removes excess assertion in HeroVisit::applyCl 2018-03-17 17:10:13 +03:00
AlexVinS
03cfd2cb78 Do not use StackLocation in netpacks 2018-03-17 13:24:12 +08:00
AlexVinS
8cec07afbd Replaced CGHeroInstance and CGObjectInstance with ObjectInstanceID in NetPacks 2018-03-17 13:24:12 +08:00
Raphnalor
0f00dbf8cf Fix highlighting of a selected bonus for campaign. (#432) 2018-03-17 12:23:22 +08:00
ArseniyShestakov
079cd470c2
Merge pull request #425 from vcmi/CatapultRework
Catapult rework
2018-03-06 01:16:53 +08:00
jerryskye
dec825fdc2 redefined lctrl to lgui for macs (#426)
keyboard shortcuts for splitting armies will use left command key
instead of left control
2018-03-04 10:46:29 +08:00
Dydzio
e68a2e7ef5 Fix arrow tower destruction mechanics 2018-03-02 15:23:07 +01:00
AlexVinS
166c04e2e0 Hack fixed serializer assertion by completely disabling AI goals serialization 2018-02-28 15:00:38 +08:00
Arseniy Shestakov
434deffb54 CAdvMapInt: improve hero reminder by checking hero path
Dialog won't show up if movement points insufficient for first step on current path.
2018-02-24 21:49:42 +08:00
Nikolay Shalakin
3795985de9 Eliminate warnings / errors. Pull request #388 2018-02-11 15:17:14 +03:00
Arseniy Shestakov
8bbe747e8e Cleanup undef for min / max. NOMINMAX is already in Global.h 2018-02-11 05:42:49 +03:00
Arseniy Shestakov
324717acbe Spelling fixes: privilaged -> privileged, retreive -> retrieve 2018-02-10 21:52:23 +03:00
AlexVinS
0a2b04709f Fixed https://bugs.vcmi.eu/view.php?id=2873 2018-02-09 22:12:21 +03:00
Dydzio
d4958ff5f8 update VS files to match spellrefactoring9 changes 2018-02-09 18:53:07 +01:00
AlexVinS
0b70baa95e Spells configuration version 2 (effect-based)
* Indirect spell effects loading
* Json serializer improvements
* spell->canBeCastAt do not allow useless cast for any spell
* Added proxy caster class for spell-created obstacles
* Handle damage from spell-created obstacles inside mechanics
* Experimental GameState integration/regression tests
* Ignore mod settings and load only "vcmi" mod when running tests
* fixed https://bugs.vcmi.eu/view.php?id=2765 (with tests)
* Huge improvements of BattleAI regarding spell casts
* AI can cast almost any combat spell except TELEPORT, SACRIFICE and obstacle placement spells.
* Possible fix for https://bugs.vcmi.eu/view.php?id=1811
* CStack factored out to several classes
* [Battle] Allowed RETURN_AFTER_STRIKE effect on server side to be optional
* [Battle] Allowed BattleAction have multiple destinations
* [Spells] Converted limit|immunity to target condition
* [Spells] Use partial configuration reload for backward compatibility handling
* [Tests] Started tests for CUnitState
* Partial fixes of fire shield effect
* [Battle] Do HP calculations in 64 bits
* [BattleAI] Use threading for spell cast evaluation
* [BattleAI] Made AI be able to evaluate modified turn order (on hypothetical battle state)
* Implemented https://bugs.vcmi.eu/view.php?id=2811
* plug rare freeze when hypnotized unit shots vertically
* Correctly apply ONLY_MELEE_FIGHT / ONLY_DISTANCE_FIGHT for unit damage, attack & defense
* [BattleAI] Try to not waste a cast if battle is actually won already
* Extended JsonSerializeFormat API
* fixed https://bugs.vcmi.eu/view.php?id=2847
* Any unit effect can be now chained (not only damage like Chain Lightning)
** only damage effect for now actually uses "chainFactor"
* Possible quick fix for https://bugs.vcmi.eu/view.php?id=2860
2018-02-08 11:37:21 +03:00
Arseniy Shestakov
fc3b8b2c87 Refactoring: replace macro with variadic templates on client-side
Big thanks to @mwu-tow for helping me with this.
2018-02-05 08:14:01 +03:00
Arseniy Shestakov
69dbf339fc CGuiHandler: fix invalid read on event handling 2018-01-18 06:34:57 +03:00
FeniksFire
b85bb6ec0a Fix positioning
Fix problem for costBacground in QuickRecruitmentWindow.
Position "y" there was scaled which lead to errors with different
resolutions.
2018-01-15 18:00:41 +01:00
Alexander Shishkin
e90fcea3d3
Merge pull request #396 from FeniksFire/update
Update graphics for QuickRecruitmentWindow
2018-01-14 10:42:23 +03:00
Dydzio
38d836d1a5 Update project files to Visual Studio 2017 2018-01-13 16:33:49 +01:00
Arseniy Shestakov
da117e9255 Code style: remove void from constructors without arguments 2018-01-13 11:51:47 +03:00
FeniksFire
1331c81a8b Update graphics for QuickRecruitmentWindow
Adding graphics maded by edeksumo
2018-01-13 09:49:29 +01:00
Arseniy Shestakov
d3b3389a37 Implement configurable object sounds: ambient, visit and removal
* If there more than one sound for visit or removal random is played
* At moment only the first ambient sound will be used
2018-01-02 18:16:35 +01:00
DJWarmonger
20ac1d6880 Merge branch 'develop' of https://github.com/vcmi/vcmi into develop 2018-01-02 17:57:11 +01:00
Dydzio
707257c2c8 Update file names in vs project (#400) 2018-01-02 19:40:23 +03:00
Arseniy Shestakov
fc0ab5b970 TerrainTileObject: store ambientSound for every object
Though ambient sounds won't work for heroes objects since they added separately.
2018-01-02 09:50:05 +01:00
Arseniy Shestakov
d96a3aa5b7 CAudioBase: move mutex to base class since CSoundHandler need it 2018-01-02 09:49:04 +01:00
Arseniy Shestakov
f15cadc87b Implement configurable object sounds: ambient, visit and removal
* If there more than one sound for visit or removal random is played
* At moment only the first ambient sound will be used
2018-01-02 09:49:03 +01:00
DJWarmonger
f523ae5545 Fixed Magic resistance display. 2017-12-30 12:25:29 +01:00
FeniksFire
bf4024c3ac Adding bacground for QuickRecruitmentWindow
Adding bacground for CreaturePurchaseCard in QuickRecruitmentWindow
2017-12-23 13:15:05 +01:00
AlexVinS
368ba0e2bf fixes 2017-12-21 21:27:39 +03:00
FeniksFire
f82fd41a14 Quick Recruitment Window upgrade
Now is possible to switch by button between creatures upgrades.
Fixed small typo, rename from purhase to purchase.
2017-12-21 18:23:28 +01:00
Michał Kalinowski
26a222ac62 Change JsonType to enum class (#393)
Change enum JsonType to enum class JsonType
2017-11-27 00:18:18 +03:00
Dydzio
6ca1845515 Update VS project files to mach latest develop 2017-11-17 16:38:29 +01:00
AlexVinS
9bdd2c8d3f Implemented new debug command "convert txt"
* use it to extract essential texts in json format
2017-11-16 23:23:03 +03:00
AlexVinS
e8a7078bb1 Quick fix for #389.
* modded music support should be redone separately
2017-11-16 17:47:52 +03:00
AlexVinS
805b5215de Client threading tweak 2017-11-16 14:15:43 +03:00
AlexVinS
d7366f04a9 [Map format, PreGame] allow selection of any allowed faction 2017-11-16 02:06:07 +03:00
AlexVinS
9cf3f4fe93 Merge remote-tracking branch 'remotes/godric3/customBattleMusic' into develop 2017-11-15 22:39:14 +03:00
AlexVinS
39194a0629 Merge branch 'SplittingShortcuts' into develop 2017-11-15 22:31:55 +03:00
AlexVinS
42a2aa2020 [C::B] project update 2017-11-15 22:31:30 +03:00
FeniksFire
3c3aaa7bb5 Improvement quick recruitment window
-Position is now relative to castle interface
-The highest level of creature is now presented.
-Improve positioning of creature card, now it's look like in hd mod.
2017-11-15 19:44:54 +01:00
FeniksFire
f2b7c85811 Adding object construction macro with parameter
- Adding macro "OBJECT_CONSTRUCTION_CAPTURING" that take as parameter
action flag.
- Fixed minor errors
2017-11-14 08:52:33 +01:00
FeniksFire
a4f701014b Quick Army Purhase in Town Screen
Mouse click on castle icon (it is now clickable) - quick recruit of all
available creatures.
2017-11-12 17:37:08 +01:00
godric3
76eed8682c Allow mods to add music played during battles and ai turn 2017-11-11 21:16:11 +01:00
AlexVinS
654fea56a4 Fixed memory leak in CAnimation (regression of #376) 2017-11-04 06:03:43 +03:00
AlexVinS
97d73f47b0 Fixed https://bugs.vcmi.eu/view.php?id=2817 2017-11-03 18:39:43 +03:00
Arseniy Shestakov
75c3e30404 CMake: further improvements for generated VS solutions
* Set vcmiclient as VS_STARTUP_PROJECT so it's will be default debug target instead of ALL_BUILD.
* Add AIs and server as dependencies for client so VS will suggest to rebuild them before debugging.
2017-10-31 09:30:58 +03:00
Alexander Shishkin
fd4ecbd40b
Merge pull request #385 from Chocimier/altar
Fixed "Altar of Sacrifice only sacrifices creatures one kind at a time"
* https://bugs.vcmi.eu/view.php?id=2607
2017-10-28 14:04:34 +03:00
Piotr Wójcik
7171fa7ad4 Formatting 2017-10-28 11:04:55 +02:00
AlexVinS
c39cd5f951 Town building build mode fixes
* CGameHandler::buildStructure was using wrong requirements for buildings in auto mode.
* Build mode loading was wrong in case of omitted value
* Show town hall slot for not built building only if it have normal build mode
2017-10-28 03:27:39 +03:00
FeniksFire
86021f0bda Add keyboard shortcuts for quick army management from HD mod.
Just want add fast some really nice shortcuts from HD mod.
1) [LShift] + LClick – splits a half units from the selected stack into
an empty slot. WARNING: The second behaviour ("smart split, ignores
single creatures") of this HD mod option is not done.
2) [LCtrl] + LClick – splits a single unit from the selected stack into
an empty slot.
3) [LCtrl] + [LShift] + LClick – split single units from the selected
stack into all empty hero/garrison slots
2017-10-27 05:21:33 +02:00
Piotr Wójcik
78e5d39ea0 Change variables type 2017-10-18 21:02:23 +02:00
Piotr Wójcik
f9ed952869 Properly calculate experience on altar 2017-10-14 22:10:59 +02:00