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

436 Commits

Author SHA1 Message Date
Arseniy Shestakov
eeff7ee315 Few minor code improvements
* All command line options now case insensetive.
* SDL_VIDEO_X11_DGAMOUS unused in SDL2 so it's removed.
* Added current year into the --help output for client and server.
* Moved DO_NOT_START_SERVER into session settings.
2017-06-26 04:56:28 +03:00
Fay
01e5f992d3 Android: possible solution for sdl2 colors problem 2017-06-17 00:34:18 +03:00
Arseniy Shestakov
1a60c1a94b Shared memory refactoring and command line control options
Now client accept following options:
 --disable-shm - disable shared memory usage
 --enable-shm-uuid - use UUID for shared memory identifier
UUID is useful when a lot of clients starting simultaneously.
Needed for testing and was easier to implement than alternatives.
2017-06-06 07:30:16 +03:00
Arseniy Shestakov
a2284c3209 Automated testing: graceful shutdown for when game is ended
Before when CloseServer / LeaveGame applied there was no thread sync on server.
Now server use std::atomic bool for synchronization and graceful shutdown.
2017-06-06 07:30:16 +03:00
Arseniy Shestakov
18161d3688 Client: implement spectator mode via command-line options
If running with --spectate/-s CPlayerInterface will appear even without human players.
Following command-line options also available:
 --spectate-ignore-hero
 --spectate-hero-speed=N
 --spectate-battle-speed=N
 --spectate-skip-battle
 --spectate-skip-battle-result
Boolean options can also be changed in runtime via client console:
 set spectate-ignore-hero on / off
Spectator mode also:
 - Work with --onlyAI option when starting game or loading saves.
 - Allow to use any cheat codes.
 - Give recon on towns and heroes.
2017-06-06 07:30:16 +03:00
Arseniy Shestakov
d95c74941b Client: add onlyAI option support for saved games
When --onlyAI option used all human players will be replaced with AIs during loading.
2017-06-06 07:30:16 +03:00
Arseniy Shestakov
f7f7fe1d32 Client: fix headless mode and add automated testing mode
Command-line option --noGUI replaced with --headless.
Added option --testmap that will run specified map with AI players
2017-06-06 07:30:16 +03:00
Arseniy Shestakov
6642816b1e Client: server port and testing options cleanup
Now we only pass port as ui16 instead of std::string
2017-06-04 08:49:23 +03:00
Arseniy Shestakov
cc163c4e05 Refactoring of networking code on server and client
* Avoid server crash on dummy connect / disconnect.
* Avoid server crash when host left from PreGame.
* Server print it's state with name when it's waiting for connection or in pregame.
* Server will use random port if specified port is busy.
2017-06-02 02:44:39 +03:00
Fay
b5daa24982 Android support (#299)
* AI libs registering shenanigans on android;
* Fixed resolution aspect + mouse event scaling;
* Proper server init/deinit (through android IPC);
Enabled threaded init in CMT;
* Prevented a deadlock in logger on some devices;
* Fixed frozen intro frame after interrupting the video;
Added android progressbar displaying during initial data loading;
* Hacky fix for choppy animations during heroes movement (should look better now, but it's definitely not a good solution);
* Changes/fixes for new android launcher building process;
* Fixed app hang after getting SDL_QUIT when activity was destroyed;
* Functioanal, configurable advmap swiping support;
* VCMI changes cleanup;
Added few missing VCMI_ANDROID guards on swipe mechanics;
* Removed unneeded sleep in server startup code for android;
* Removed android ioapi hack (fixed in newest ndk);
* Removed unused android's library loading logic;
* Added android's swipe option to settings schema;
* Moved NO_STD_TOSTRING to be defined in global.h instead of build files;
2017-05-25 20:57:20 +03:00
Dydzio
88952aefff Restart button fix (#288) 2017-03-19 16:58:46 +03:00
FeniksFire
46a06ce184 Change the year from 2016 to 2017 in help description. 2017-03-10 19:28:01 +01:00
AlexVinS
204ee37ae4 boost/program_options has only 2 uses, and unlikely will be used more -> removed form Global.h. 2016-11-28 21:38:17 +03:00
AlexVinS
9094c99759 Fixed CID 1366403 2016-11-28 02:50:40 +03:00
AlexVinS
3216422307 Fixed a few CWE-457 2016-11-27 22:07:01 +03:00
AlexVinS
80666fb134 Tweaks 2016-11-25 22:12:22 +03:00
AlexVinS
20de754141 def2bmp CLI command converted to CAnimation 2016-11-25 15:23:28 +03:00
AlexVinS
3c9695abcc Fixed CID 1366310 2016-11-25 13:58:20 +03:00
DjWarmonger
9db3bfcbf2 Merge pull request #212 from vcmi/refactoring/serialization2
Apparently it works - both new and old saves load at least.
2016-11-01 17:25:39 +01:00
Alexander Shishkin
0cf5a10bd1 Merge pull request #243 from vcmi/guiCleanup
Gui cleanup
2016-10-28 08:53:03 +03:00
Ivan Savenko
5b76c3f4eb Rebase of codebase changes for refactored serializer
Some of newer fixes not yet merged there and save compatibility a bit off.
2016-10-27 18:12:20 +03:00
Arseniy Shestakov
15b4774076 Logging: always print version of client and server in the begining 2016-10-27 17:14:20 +03:00
AlexVinS
3dddbcf2e8 try to use CAnimation for Hero path 2016-10-27 16:34:15 +03:00
AlexVinS
8505a909e1 free Graphics object on quit. 2016-10-27 16:34:13 +03:00
Arseniy Shestakov
99dcb44851 Add option hideSystemMessages to hide server messages on client
Use "set hideSystemMessages on" in client console to activate.
2016-09-26 16:05:27 +03:00
Arseniy Shestakov
9963b9e02b New command line option for testing: testingsavefrequency
Saving is slowest part of VCMI and for testing purposes like benchmarking it's helpful to create saves less often.
When --testingsavefrequency=N is specified client going to save only once in N days.

Option only active if other testing options are specified too.
2016-09-22 03:43:30 +03:00
Arseniy Shestakov
1cbe9e1b8b Client: add donotstartserver option. Alternative way to start a game
Option is useful for server profiling also let me test MP over network and much more.
Also there is issues with boost::interprocess on some systems under Windows and this is the way to bypass them.
2016-09-16 20:01:44 +03:00
Piotr Wójcik
88ba42f91d Fix choosing display 2016-09-08 21:33:47 +02:00
Krzesimir Nowak
12f2006fbf Show the game window on the configured display
This basically starts respecting the displayIndex setting. When
changing the fullscreen setting in-game, we read the display index
from the already existing window.
2016-08-31 11:12:59 +02:00
AlexVinS
1c9dd41188 Removed unused STOP_CLIENT SDL event 2016-08-30 03:54:46 +03:00
AlexVinS
4bc27194dd do not leak screen surface etc. on quit 2016-08-30 03:43:49 +03:00
AlexVinS
2018b4d406 Rewritten video mode check.
* check only for current desktop display mode, because we are not using actual fullscreen
* also old check was wrong
2016-08-30 03:27:53 +03:00
AlexVinS
fb7ff8c7fa Do not use std::atexit. Modified patch from PR #204 by @krnowak.
std::atexit generally does not play nice with static objects in other
translation units/libraries - there are no guarantees about the order
of destruction of static objects and atexit functions coming from
different translation units/libraries. Removing calls to atexit fixes
crashes when quitting the game. The crash happened during the dispose
function somewhere inside boost's locale library that is used
indirectly by the logger - some locale function tried to lock a static
mutex that was already destroyed.
2016-08-30 01:26:05 +03:00
Arseniy Shestakov
452e28d183 Remove some useless includes found by cppclean
This of course was tested and shouldn't break anything
2016-08-26 04:42:16 +03:00
Arseniy Shestakov
948cca02cc Fixes to some crashes on exit and to have cleaner valgrind output 2016-08-18 06:52:10 +03:00
Arseniy Shestakov
10dbbead2d Fix indentation of logging code and around it
That wouldn't be as big issue if problem affected few files, but it everywhere in codebase.
Fixed it everywhere since in most files that is the only code with wrong indentation.
2016-03-12 04:46:21 +03:00
Arseniy Shestakov
4f7664926e New console commands for AI debugging: gosolo and controlai
gosolo: make AI to take over every human player in game. Second command would give control back to CPlayerInterface.
controlai: give control of one or all AI players to CPlayerInterface. Command "controlai orange" turn orange to human player while "controlai" without color specified make all AIs human controlled players.
2016-02-25 00:38:10 +03:00
AlexVinS
d7c0c3759a Merge branch 'Zyx-develop' into develop
Conflicts:
	lib/filesystem/AdapterLoaders.h
2016-01-27 18:53:41 +03:00
Vadim Markovtsev
7c7bb39904 Enable right mouse button click emulation on MacOSX 2016-01-18 16:07:17 +03:00
Zyx-2000
43b364bcd4 compilation fixes... 2016-01-16 19:00:53 +01:00
ArseniyShestakov
1ec7d14637 Client: add command line options to simplify multi-instance testing
Use these when you need to run multiple instances of VCMI simultaneously.
--testingport is port used to start server. Override port number from configuration files.
--testingfileprefix is prefix for auto save filenames.
Both options has to be set in order to work.
2015-12-13 22:14:37 +03:00
ArseniyShestakov
f940e3ed42 Fix issue 2239. Pillarbox when restored after alt-tab in fullscreen
This isn't best solution and all SDL-related code need refactoring, but it's works.
2015-11-29 01:56:18 +03:00
ArseniyShestakov
a49950e958 Fix 2292. Fix chat on adventure map, increase maxOutputPerLine 2015-11-08 22:16:58 +03:00
Sandy Carter
9d62a2f0a1 Buttons: Add CVolumeSlider widget
New widget specifically for volume settings.
Replace previous implementation using 10 toggle buttons.
Enable indicator animation
Fix indicator ghosting when drag and releasing
Add scroll capability to volume
Volume now can be adjusted from 0 - 99 with the mouse or the scroll wheel
2015-08-22 12:40:14 -04:00
AlexVinS
f58148cd94 Capture SDL log
* just a stub for now
2015-06-22 22:19:32 +03:00
AlexVinS
a8c45df732 Merge branch 'SDL1Wipe' into develop 2015-06-22 14:24:00 +03:00
AlexVinS
f81116e04d Fix mantiss #2208 2015-06-21 20:30:19 +03:00
AlexVinS
dca1e28bc1 SDL1 wipe, part 1. Untested. 2015-06-21 01:59:30 +03:00
AlexVinS
685deddac1 Start spell-relatet files reorganisation
* moved existing files to separate directory
-> todo: split mechanics
2015-02-26 08:39:48 +03:00
Ilya Zhuravlev
3eb3996241 Fix android build. 2014-11-02 16:19:14 +03:00
Patrick Simmons
cfa6f46d62 VERY buggy, unusable, but progress is being made... 2014-10-25 19:05:49 -04:00
Ivan Savenko
9a4aa8749f Fall back to first available resolution if config contains invalid value.
Fixes crash on starting game with unavailable resolution
2014-09-18 14:20:53 +03:00
Ivan Savenko
b551bdb725 Final part of the merge
Merging VCMI Dirs refactoring + GUI refactoring with current develop
2014-09-04 20:59:07 +03:00
Ivan Savenko
de9c5b1af7 Merge branch 'develop' of github.com:karol57/vcmi into karol57-develop 2014-09-04 20:29:24 +03:00
DjWarmonger
0edaf4fa8a Merge pull request #26 from vcmi/FFMpeg
Let's do this, way too many branches running now.
2014-09-01 10:35:30 +02:00
Karol
37bd4790f7 VCMIDirs update #6 fix
- Apple compilation fix
- Removed unnecessary macros
- Updated macros indent style
- Fixed 1. warning.
2014-08-30 15:04:00 +02:00
Karol
53ab0593b7 VCMIDirs update #6
- Minor fixes
- CLoadFile updated to boost::filesystem::path
2014-08-27 12:31:58 +02:00
Karol
1b6f2ea3b7 VCMIDirs update #5 fix
- Updated old OS detect macros.
- Fixed 1 misspell.
2014-08-26 12:19:04 +02:00
Karol
2da6d9e7dd VCMIDirs update #4 fix 2014-08-11 21:24:31 +02:00
Karol
a302f6c7ad VCMIDirs update #3
bfs = boost::filesystem;
- Updateting filenames (std::string -> bfs::path) #1
- Added platform detection, and some specyfic boost::filesystem includes
to Global.h
- Updated CBasicLogConfigurator. Now class uses bfs::path pathes.
2014-08-10 23:42:39 +02:00
Ivan Savenko
a115406fa3 Fixed data presence check 2014-08-10 10:58:56 +03:00
Ivan Savenko
b1285bc506 Merged GUI refactoring into develop, fixed conflicts 2014-08-09 15:01:55 +03:00
beegee1
5139378319 - migrated boost::function/ref/bind to std:: variants 2014-08-04 20:33:59 +02:00
Ivan Savenko
00cda400a1 Miscellaneous improvements for Launcher UI:
- Implemented "show intro" toggle in settings
- Install/Update/Enable buttons are now visible even when mod info is hidden
- Fixed behaviour of show mod info switch, added more obvious button to enable it
- Removed no longer used "Enable mods on install" switch
- Added buttons to open data, user data and temporary directories
2014-08-04 14:03:57 +03:00
Ivan Savenko
731aedf3a1 Split CIntObjectClasses into multiple smaller files. This should be the last change in files 2014-07-15 10:14:49 +03:00
Ivan Savenko
647b9c683f Reorganized client source tree:
- client/widgets for reusable GUI elements
- client/windows for independent windows
- client/gui for base GUI classes which should remain internal
2014-07-13 20:53:37 +03:00
AlexVinS
679dd64ff9 Make scale a parameter of "open" methods 2014-07-10 14:18:21 +04:00
AlexVinS
18f34e14f8 set scale to off by default 2014-07-08 22:01:01 +04:00
AlexVinS
8a488aeb86 Cleanup 2014-07-03 19:57:21 +04:00
AlexVinS
ecc7b8e05a Draw cursor on each frame. Fix TTF rendering under cursor. 2014-07-03 18:05:07 +04:00
AlexVinS
c948891fc6 Fix threaded handlers initialization, cleanup 2014-07-03 12:26:15 +04:00
AlexVinS
5a029c88d1 cleanup 2014-07-02 23:53:23 +04:00
AlexVinS
195eae48ca Merge branch 'develop' into SDL2
Conflicts:
	client/CPlayerInterface.cpp
2014-07-02 17:15:12 +04:00
Ivan Savenko
a0689fa377 Refactoring of hoverText from objects:
- removed hoverText field
- split getHoverText() method into 3:
- - getObjectName() for generic name
- - getHoverText(Player) for player-specific text
- - getHoverText(Hero) for hero-specific strings
2014-06-24 20:39:47 +03:00
AlexVinS
3b8d0e44d4 Merge branch 'develop' into SDL2 2014-06-24 14:09:44 +04:00
AlexVinS
d707e55472 restore inGuiThread flag 2014-06-13 07:55:50 +04:00
AlexVinS
41a0319985 remove separate GUI thread
+ this fixes OGL
- has some issues(f.e. hero movement)
2014-06-13 07:55:49 +04:00
AlexVinS
15fe37133c Fix compilation with SDL1
+ seems to be fully backward compatible (need more testing)
2014-06-13 07:55:48 +04:00
Ivan Savenko
8eb661461c - vcmi compiles with SDL2 on Linux, video player is disabled for now 2014-06-13 07:55:45 +04:00
AlexVinS
3db7fb4f63 Still try to fix opengl backend
- no success
+ make backend selection configurable
2014-06-13 07:55:45 +04:00
AlexVinS
d289c6a34a Prefere opengl rendering
- broken ...
2014-06-13 07:55:44 +04:00
AlexVinS
5bb3d859eb Nice fullscreen mode++ 2014-06-13 07:55:44 +04:00
AlexVinS
ac2896da42 Implemented SDL2 unicode input. Hotkeys are sill broken. 2014-06-13 07:55:42 +04:00
AlexVinS
d50976bf4a restore some SDL1 code in CMT.XXX 2014-06-13 07:55:41 +04:00
AlexVinS
0ef16feca9 Refactoring towards backward compatibility (WiP) 2014-06-13 07:55:41 +04:00
AlexVinS
1597254399 just a few tweaks and it works!
* enable video again
* set default bpp to 32 - SDL2 dont like 24 bit resolution
* now almost everything looks as expected (some issues are present though)
2014-06-13 07:55:40 +04:00
AlexVinS
cd81e85a61 fix loading to pregame. Looks awful. More work to do.
* video temprorary disabled
* multithread loading seems to be broken - disabled
2014-06-13 07:55:39 +04:00
AlexVinS
e072b2664f fix pixel format
* now it shows intro video (but then crash ...)
2014-06-13 07:55:39 +04:00
AlexVinS
62d42465de fix compilation
* may not even run
* text input disabled
2014-06-13 07:55:38 +04:00
Ivan Savenko
b2e8c92383 Cleanup:
- removed commented-out #includ'es
- renamed some files to match name of class
2014-06-05 20:26:50 +03:00
Ivan Savenko
652ceb2bde Finally shattered CObjectHandler.cpp into tiny bits
- This file is now split into multiple smaller files in mapObjects
directory
- CObjectHandler itself now contains only core classes (Handler itself,
CGObject and interfaces)
- Cleaned up excessive #include's through whole project
2014-06-05 19:52:14 +03:00
Ivan Savenko
0afdfa529c Moved all object-related files to lib/mapObjects directory.
Renamed some classes to more readable names
2014-06-05 14:19:47 +03:00
Ivan Savenko
32b6568b65 Merged changes from upstream and fixed compilation caused by API changes 2014-06-03 22:45:18 +03:00
Ivan Savenko
7f276185bd Moving files:
- new config for objects (config/objects/generic.json)
- renamed lib/CDefObjectHandler to lib/CObjectClassesHandler
2014-05-24 02:07:54 +03:00
Ilya Zhuravlev
db7cd79cf7 Android port.
Conflicts:
	lib/vcmi_endian.h
2014-05-16 23:24:29 +04:00
Ivan Savenko
9c0df68cb8 Fixing spelling mistakes. Patch from josch, fixes #1759 2014-03-23 12:59:03 +00:00
Ivan Savenko
760ae7d44a Changes related to Debian packaging, based on josch patch
- AUTHORS file is now in UTF-8
- tags for desktop files
- fixed some typos
- better reaction on --help and --version commands
- vcmibuilder should work with both avconf and ffmpeg
2014-03-20 18:17:40 +00:00
alexvins
065b8366fb [Spells] Added basic support for icons and sounds
* few changes in spell format
* save format changed
2014-03-10 16:00:58 +00:00
Ivan Savenko
d2ae847ecf - files in local directories (saves & configs) now always have higher
priority than mods. Fixes #1685 and #1733
- fixed possible crash on exit in dispose() function
- (vcmibuilder) fixes problem with partial mp3 -> ogg conversion
2014-03-08 16:05:23 +00:00
alexvins
4203d69525 Part 2 of new spell configuration
1) spell handler refactored to support modding in general way
2) imunnity icons moved to WoG as they depends on wog`s graphics
3) introduced new class template for handlers (todo: use this in other handlers)
4) save format changed
5) introduced "absolute immunity" - unaffected by "the Orb" etc. (todo: use it in config)
6) new format documented on wiki, added json schema.

* more split of registertypes - fixes 32 mingw build
2014-03-07 13:21:09 +00:00
Ivan Savenko
5cbec833c2 - (linux) XDG filesystem support
BIG NOTE TO LINUX USERS
All user data has been moved according to XDG specs:
- Game data (H3 files and mods) and saves: from ~/.vcmi to ~/.local/
- Temporary files, including logs: from ~/.vcmi to ~/.cache/vcmi
- Config files: from ~/.vcmi/config to ~/.config/vcmi

For compatibility VCMI will read game data from ~/.vcmi as well but this
is temporary behavior and will be removed
2014-03-04 14:51:10 +00:00
Michał W. Urbańczyk
f6c2c96cdc Copyright update. 2014-03-01 18:46:54 +00:00
Michał W. Urbańczyk
93856dbe98 Quick solution for #1688. 2014-02-27 20:44:20 +00:00
Michał W. Urbańczyk
55271e621b Possibility to switch autoskip in the runtime. 2014-02-02 14:39:32 +00:00
alexvins
a740f7989c [c::b] update projects, disable PHC for now, +few fixes (still wip) 2014-01-05 17:48:50 +00:00
Ivan Savenko
2c4c964a45 Large rewrite of adventure map objects:
- replaced CDefObjInfo with ObjectTemplate class
- ObjectTempate is a direct member of objects instead of pointer with
shared ownership across CMap, handler and game objects
- simplified handling of objects that can change appearance (e.g. towns)
- all object queries regarding object appearance/blockmaps use h3m pos
instead of relative positions
- removed need of modhandler::reload
- cleanup of some old code
2014-01-02 23:48:38 +00:00
Ivan Savenko
29f4a12814 - fixed some evil memory leaks
- fixed recursive dependency of castles
2013-12-19 19:43:16 +00:00
beegee1
d1002f7e8f - Fixed starting another map from campaign bonus selection screen while playing a campaign mission 2013-12-17 12:12:25 +00:00
beegee1
b9b25ef552 - Fixed mantis #1422 (starting another scenario crashes VCMI for now)
- Refactoring
2013-12-16 18:39:56 +00:00
beegee1
f2cc630e2c - Show confirmation dialog when pressing Alt + F4 to quit the game 2013-12-07 18:26:15 +00:00
beegee1
c786a3076a - Refactored victory loss condition checks
- Added toString() method to EVictoryLossCheckResult enum class to improve debugging
- Removed mostly unused CFunctionList2
- Added missing header files for vcmiclient project to CMakeLists
- Tweaked SDL suggests bpp message a bit
- Added showInfoDialogAndWait (info dialog and waits, used from client thread) and showOkDialog (callback to ok click, used from GUI thread) to player interface
- Added showOkDialog method to CInfoWindow (unused for now, but may be used later)
2013-11-30 09:43:31 +00:00
Ivan Savenko
84dea676f2 compile fix, fixes missing end-of-line #1483 2013-09-28 13:32:49 +00:00
Ivan Savenko
e13dc872e0 - support for Chinese fonts (GBK 2-byte encoding)
- fixes #1446
2013-09-08 16:49:23 +00:00
Ivan Savenko
6bee105d7d Some refactoring of text display widgets:
- renamed some methods/classes with better names + some consistency (no more print, setTxt and setText that do exactly same thing)
- TextBox now contains label widget instead of inheriting it
- smooth scrolling support (up/down buttons still scroll one line)
2013-08-29 13:46:27 +00:00
Ivan Savenko
77496bcea9 - fixed several cases of accessing full path to files in archives 2013-07-29 11:38:18 +00:00
Ivan Savenko
b87897096c Filesystem handling is now more flexible
- removed CResourceLoader class in favor of one that implements resource loader interface
- removed global pool of files, in favour of more dynamic approach
- renamed some files to match current situation
All these changes are needed mostly for future mod manager + .zip support
2013-07-28 14:49:50 +00:00
Ivan Savenko
91cd88ba97 - compile fix for OSX 2013-07-11 20:10:17 +00:00
Ivan Savenko
4ac2a6e8b6 minor refactoring of VCMIDirs, bugfixing
- VCMIDirs represent XDG specification more closely (partial #1310)
- Minor bugfixing, including #1327 #1328 and #1306
2013-07-08 20:55:22 +00:00
Michał W. Urbańczyk
a1f545792b Compile fixes specific for VS 2012"
* Reverted std::bind to boost::bind. std::bind on Visual 2012 doesn't work in some cases (especially with std::ref), not sure why [but it seems to be a bug, since 2013 preview compiles the same code fine]. 
 * Move assignment operator for VS 2012.
2013-07-02 15:23:32 +00:00
Ivan Savenko
f82122d9be second part of c++11 update. gcc 4.5 and VS 2010 are no longer supported
- BOOST_FOREACH -> for
- replaced several boost classes with std (e.g. unordered)
- removed gcc-4.5 workarounds
- ran clang c++11 migration tool to detect some cases:
- - pointer initialized with "0" to nullptr
- - replace for with iterators with range-based for
- - use auto in some situations (type name specified twice, avoid long iterators type names)
2013-06-29 13:05:48 +00:00
Ivan Savenko
2b45e13c5c c++03 -> c++11 switch:
- use std versions of function, bind and ref
- OVERRIDE -> override
- NULL -> nullptr
- use std versions of random distributions

NOTE: this may be last revision that supports gcc-4.5
2013-06-26 11:18:27 +00:00
Michał W. Urbańczyk
4a0587d500 More work on auto-fight.
Dynamic libraries return smart-pointers to what they create.
2013-06-22 21:47:51 +00:00
Michał W. Urbańczyk
2be2143844 Game interfaces can register another interfaces to receive info on game events. 2013-06-22 18:22:44 +00:00
Michał W. Urbańczyk
06dbdd234f Further changes for duel mode. It is possible to pass names of AIs to be used by command line. Moved things in battle AI. 2013-06-21 20:59:32 +00:00
Ivan Savenko
6737c270c9 gcc 4.5 compatibility fixes. Mostly due to lack of fully finctional nullptr class 2013-06-19 21:26:27 +00:00
Michał W. Urbańczyk
6a88604937 * fixed crash related to cammander's SPELL_AFTER_ATTACK spell id not initialized properly (text id was resolved on copy of bonus)
* fixed duels, added no-GUI mode for automatic AI testing
* minor things
2013-06-17 15:45:55 +00:00
Ivan Savenko
08b2af3ccb - fixed "get txt" console command
- command "extract" to extract file by name
- command "def2bmp" to convert def into set of frames.
2013-06-10 17:02:37 +00:00
Michał W. Urbańczyk
fc6e72dc75 * Fixed enchantments (#1265). Their effects were not properly added when reading config. Battle interface will be little less likely to block itself after corrupted spell cast.
* Fail gracefully when the file from which game is started is in invalid version.
* Bumped versions.
2013-05-19 15:14:23 +00:00
Michał W. Urbańczyk
be7c2bd07f CGHeroInstance* can be serialized over network even when hero has been defeated. Strongly typed hero type ID introduced.
Should fix #1260.
2013-05-18 22:30:48 +00:00
Ivan Savenko
8be801a6dc - CMappedFileLoader class to remap WoG files to h3 names
- WoG should be optional, all remapped files are listed in WoG/config/wogFileOverrides.json
- fixed several cases of incorrect positioning of creatures in battles
- some missing sounds for battle effects
- negative luck support, disabled by default
- a bit hackish detection of WoG presence, VCMI should work on SoD-only installs
2013-05-04 13:14:23 +00:00
Ivan Savenko
3285f1910b - finally, solution for imageIndex fields. All image lists will be generated in runtime
- iconIndex fields from json are no longer used
- simple check for missing icons on startup
2013-04-22 19:51:22 +00:00
Ivan Savenko
c6cc6e6301 Large changeset, first part of editing H3 objects via mods feature. Changes:
- loading of all objects (including H3 objects) will be directed by mod handlers
- common base for all handlers accessible from mod system (IHanderBase)
- json format changes: use struct with string ID's instead of vector

- fixed some gcc/clang errors and warnings
- fixed several cases of memory leaks and invalid memory access (mostly related to usage of bonus system and/or identifiers resolution)

Note that right now loading is much slower than before due to excessive json validation (or not fast enough validator)
2013-04-21 12:49:26 +00:00
Michał W. Urbańczyk
d1d67caa0b Get rid of some old serialization workaround code that is not needed because serializer was improved in the meantime.
Fixing #1254.
Fixed possible race causing corruption of the server savegame.
2013-04-20 18:44:55 +00:00
Michał W. Urbańczyk
e8354908c3 Big change: Introduced new mechanism to handle queries. It should not cause any visible changes ATM apart from fixing several long-standing bugs realted to handling post-visit/battle/levelup callback, including infamous creature bank issues: #955, #1053, #1063, #1191. Needs testing.
Minor changes:
* default log level set to trace
* LOG_TRACE raii guardian lifetime will last till the end of block
* compile fixes
* minor refactorings
2013-04-20 11:34:01 +00:00
beegee1
c10266ed97 - Reduced complexity to use the CMapGenerator(simpler interface) - Removed h3m.txt and tchar_amigaos4.h 2013-04-14 18:52:05 +00:00
beegee1
f10ba48c77 - Fully integrated new logging API(ERM, Editor, missing parts) - Removed old logger 2013-04-11 15:58:01 +00:00
beegee1
6827fcdb53 - Integrated the logging API into the server project - Simplified CBasicLogConfigurator usage(exception handling, logging, log file appending) 2013-04-10 17:18:01 +00:00
beegee1
c7c2686379 - Integrated the logging API into the client and the lib - Remove some more comments and switched to /// style - Fixed recursive locks - Added Global.h to CMakeLists(now visible in qt-creator) - Removed usage of shared_mutex - Added unique_ptr to CLogger targets 2013-04-09 14:31:36 +00:00
beegee1
30bcec42c6 - Renamed client/BattleInterface to client/battle and client/UIFramework to client/gui 2013-04-07 11:52:07 +00:00
beegee1
ee51c5beb5 - Renamed /lib subfolders to lowercase 2013-04-07 10:48:07 +00:00
Ivan Savenko
c927913f5f - Improved json validation. Now it support most of features from latest json schema draft
- Set of schemas in config/schemas directory that are used to validate input from mods.
2013-04-02 17:06:43 +00:00
Ivan Savenko
5082dafd62 - h3 hero classes and artifacts can be modified via json
- commander artifacts are now merged into main artifacts.json, todo - split 2.5k file into something manageable
2013-03-12 14:56:23 +00:00
mateuszb
dbec99ffc7 * PlayerColor and TeamID refactoring 2013-03-03 17:06:03 +00:00
Ivan Savenko
b5fcefe455 - moved all system-specific handling of filesystem to VCMIDirs.cpp (new file)
- fixed #1128, artifact constituents are now stored as pointers
2013-03-02 18:41:25 +00:00
Michał W. Urbańczyk
8c7c4789ca Attempt to apply patch from stopiccot. 2013-03-01 21:32:26 +00:00
Ivan Savenko
74ac44662c - a bit less memory usage during compilation with gcc, new file - RegisterTypes.cpp
- fixed several issues related to visiting town by ally
- fixed #1215
2013-02-23 12:22:23 +00:00
mateuszb
bda766b697 * refactoring 2013-02-12 19:49:40 +00:00
mateuszb
af5287c193 * fixed opening custom campaign selection window
* artifact positions refactored
* vstd::advance allows moving between enum values
2013-02-06 23:24:43 +00:00
Ivan Savenko
56ffd05648 patch from stoppicot:
1. vcmiclient now usese custom Info.plist 
 2. Original H3 game data is now also stored in Application Support folder
2013-02-06 15:39:34 +00:00
Michał W. Urbańczyk
17755caa10 * fixed #1199
* fixed advancing between misisons in campaigns
2013-02-05 20:06:13 +00:00
Ivan Savenko
46eb0b3daf - wrokaround/fix for #1177
- removed assert in Fonts.cpp (can be triggered a lot by old pregame\battles code)
- fixed battle console text positioning
- fixed some new compiler warnings
2013-01-20 22:49:34 +00:00
Michał W. Urbańczyk
5b919d88eb "More stable" opening AI. 2013-01-20 12:06:49 +00:00
Ivan Savenko
62e99a1ae5 - basic loading screen, no progress bar
- startGame() call will run in separate thread if loading screen is used (looks OK so far)
2012-12-17 18:01:17 +00:00
Ivan Savenko
423a226e31 OS X patch from stopiccot 2012-12-15 07:24:25 +00:00
Ivan Savenko
04358ed0c6 multiple changes in config system, breaks existing mods. See upcoming post on forums.
- filesystem initialization works in conjuction with modHandler
- (config) split buildings.json in multiple files in "factions" directory
- (mods) merged filesystem.json and config/mod.json into mod.json
2012-12-12 11:13:57 +00:00
Ivan Savenko
c9dd80ea6d - moved json-related functions (e.g. ParseBonus) into JsonUtils namespace
- replaced JsonNode::toStdVector with more universal convertTo
- some renaming in StartInfo
2012-12-02 12:21:44 +00:00
Ivan Savenko
2643762f08 Mac OS patch from stopiccot 2012-12-01 06:30:52 +00:00
Ivan Savenko
f7915d9e61 - removed creature-related code from ModHandler
- new towns can be loaded as mods
 - removed separate DefInfos for towns\capitals
 - a bit simpler handling of adventure map def's
2012-11-13 11:52:23 +00:00
Michał W. Urbańczyk
f8a27a9fdb * Moved CConfigHandler from client to lib, CMake/Makefile need updating. I believe other projects besides client also need access to settings. (surprisingly there was a "server" category used only by client... and now VCAI.)
* It is possible to set the battle ai that'll be used by neutrals by typing in VCMI console:
setBattleAI <AIName>
VCAI also respects that setting and uses given AI as its battle back-end.
2012-09-29 10:59:43 +00:00
mateuszb
18bd898cb1 * fixed bug when starting certain maps in campaigns
* introduced TPlayerColor typedef
2012-09-24 16:14:53 +00:00
DjWarmonger
e2bfd53c98 - Fixed some issues and crashes
- Simplified projectile handling. New creatures can now shoot.
2012-09-21 19:49:35 +00:00
mateuszb
8e3de98059 * restoring campaign features
* minor improvements
2012-09-21 17:59:54 +00:00
mateuszb
4010978a91 * a bit of work on campaigns 2012-09-19 17:41:22 +00:00
mateuszb
fb2f19b4c5 * some work on campaigns 2012-09-18 17:47:52 +00:00
Michał W. Urbańczyk
96a92d0f45 * fixed remaining part of #1071 — the screen surface has always to be created in the main thread
* hold events in the queue by value (less ptr jugglery)
2012-09-11 14:25:19 +00:00
Michał W. Urbańczyk
d935e87dd8 #1071 should be fixed. 2012-09-09 23:57:22 +00:00
Ivan Savenko
deb22b3674 - (linux) use empty video player if av_register_protocol function was not found 2012-08-18 10:29:54 +00:00
Ivan Savenko
e67f8afdd9 - removed multiple unused files
- config folder with all json files is used via new FS API
- fixed campaigns loading. Replaced "detect h3m starts" heuristics with CCompessedStream::getNextBlock()
2012-08-02 11:03:26 +00:00
Ivan Savenko
b3c17d2788 large filesystem update. Filesysytem is now fully functional, everything should work.
- completely replaced CLodHandler, removed bitmaph and spriteh
- replaced CLodStream in favour of CCompressedStream (2 new files)
- renamed CResourceLoaderFactory and ResourceIndetifier to shorter names
NOTES:
- campaign loading is currently broken. Will fix.
- I am going to remove several unused files in several days (e.g. LodHandler)
2012-08-01 12:02:54 +00:00
Michał W. Urbańczyk
79f8e0ea3c Fail gracefully when file pointed by --start path doesn't exist. 2012-07-20 20:57:18 +00:00
Ivan Savenko
235cf458d7 - fixed text duplication in choice windows
- fixed compile issues
- added unused and untested for now CComponentBox
2012-07-02 21:51:48 +00:00
Ivan Savenko
770a6e077c - handling of incorrect or missing configuration files (settings.json\defaultSettings.json)
- better code for recruitment window, fixes #1013
- minor tweak to adv.map classes
2012-06-22 11:40:16 +00:00
Ivan Savenko
d60f2d57a0 - first part of CIntObject API clean-up.
- - mostly remove usage of (de)activateSomething functions
- - CIntObject's can be safely deleted in active state or without removing from parent first
- - Added CWindowObject to use as base of all windows (will be required for such features as shadows)

Report any crashes or glitches - it should not cause any issues apart from more console output. 

TODO:
- remove redundant (de)activate and show(All) calls
- decrease usage of blitAtLoc\printAtLoc methods
- switch all windows to new base
2012-06-02 15:16:54 +00:00
Ivan Savenko
49495c9caf - possibly fixed #966 and #958
- fixed crash on shutdown 
- fixed compile issue #973
2012-05-25 11:49:56 +00:00
Michał W. Urbańczyk
ee6e9fcc7f Fixed #947. 2012-05-22 21:08:16 +00:00
Ivan Savenko
45c2809a40 - pregame will use same resolution as main game
- disabled most of now unused code for changing resolution
- added missing spell effect sounds
- adventure map spells sounds
- remaining fixes for big endian systems
2012-05-18 17:35:46 +00:00
Ivan Savenko
90ff99d4eb - fixed ancient #31
- fixed #603
2012-05-14 16:29:06 +00:00
Ivan Savenko
82b60c00a2 - fixed compile issues. Renamed several "battleobstacleSplaced" to "battleobstacleplaced"
- implemented --disable-video command line switch
2012-05-05 08:32:55 +00:00
Michał W. Urbańczyk
017013a5a4 Throwing runtime_errors instead of string (or even char*) objects. 2012-04-22 07:32:45 +00:00
Michał W. Urbańczyk
722ec55384 Redid stack artifacts. Broken save compatibility. Added serializer support for boost::variant and sending CStackInstace* over network by implicitly passing IDs. Moved seeds and checksum to StartInfo. Various minor changes. 2012-04-14 02:20:22 +00:00
Michał W. Urbańczyk
8baec8b093 Implemented #715 (load game from sys options). Fixed #224. Minor improvements. 2012-04-09 02:53:50 +00:00
Michał W. Urbańczyk
d9064f4f7d Implemented #714 — restart functionality, including quick restart tweak (bound to CTRL+R). 2012-04-08 03:06:27 +00:00
Michał W. Urbańczyk
d6223dd137 Fixed #686.
Minor changes.
2012-04-08 02:29:11 +00:00
Michał W. Urbańczyk
b874295b3a Really fixed #918. 2012-04-08 01:43:40 +00:00
Michał W. Urbańczyk
6db3c5bc7e * VCAI: can't request actions from action handling thread
* Save game screen and returning to main menu will work if game was started with --start option
* GUI controls can selectively capture keyboard events. CTextInput won't capture Enter. Fixes #654.
2012-03-11 16:29:01 +00:00
Michał W. Urbańczyk
77b13404c0 Fixed #888. 2012-03-01 13:36:58 +00:00
Michał W. Urbańczyk
f2642cb62c Added VCAI and EmptyAI to the VS solution. Removed from it GeniusAI.
Fixed #329, #884, #885.
2012-02-29 01:31:48 +00:00
Ivan Savenko
2018fc09a4 - fullscreen config option will take effect immediately
- fixed bug with highlightable buttons
- added several missing spells sounds
2012-02-24 20:41:14 +00:00
Michał W. Urbańczyk
e4dc00abac * new file lib/UnlockGuard.h — unlock_guard is for unlocking a mutex for the scope time (RAII)
* all lock/unlock and unlock/lock pairs are done by RAII guards now
* fixed two possible crashes at the end of battle when last stack was killed by spell. That should fix #749 and #752.
* fixed a very nasty race condition, eliminating possible deadlock at the start of battle when human hero has tactics
* fixed #422
2012-02-19 21:03:43 +00:00
Michał W. Urbańczyk
1abf089bc7 Missed fixed for #858 (TortoiseSVN tricked me...)
Fixed #852.
2012-02-16 21:46:28 +00:00
Ivan Savenko
0c3e88226f - (linux) replaced Genius with VCAI
- gcc set to c++0x mode
- most of gcc warnings fixed
- replaced boost::assign with initialization lists (if available in compiler)
- new cheat code: vcmiarmenelos - build everything
- updated linux readme
- minor fixes, applied patch for #98
2012-02-16 17:10:58 +00:00
Ivan Savenko
86e7d96b39 - setting system: replaced settings.txt + sysopt.bin with json-based system (defaultSetting.json + settings.json)
- some work on system settings window
- new menu for selecting resolution (reused town portal graphics), can be opened from system settings
2012-01-12 15:23:00 +00:00
Michał W. Urbańczyk
046e54563c * fixed project files for RD configuration
* fixed crash when creature is casting Hypnosis (ie. exped Vampire Lords)
* fixed crash when creature is casting Cure before attack (ie. exped Unicorns)
* fixed crash when creature is summoning elemental (TODO fix it)
* fixed crash when doing a bonus system operation with a hero liberated from prison (ie. entering town or battle)
* fixed deadlock when StupidAI tried to assault the turrets
* fixed never ending siege when StupidAI has to use catapult (no more deadlocks on AI-AI siege)
* fixed deadlock when a hero received a level during another player's turn (ie. when he successfully defended)
* AI can win the game by defeating all enemies if there is a specific victory condition applying only to human players
* added options to help testing adventure map AI (--onlyAI, --autoSkip and --oneGoodAI).
* many minor changes
2012-01-03 01:55:26 +00:00
beegee1
156aa6e4d9 * Updated class - file - handling
* Renamed color constants
* Renamed class AdventureMapButton to CAdventureMapButton
* Moved basic controls like CTextBox from GuiClasses to CIntObjectClasses
* Moved new creature window from GuiClasses to CCreatureWindow
2011-12-22 13:05:19 +00:00
beegee1
2f5d6f2684 * CHexField renamed to CBattleHex
* CHexFieldControl renamed to CClickableHex
* CCreatureAnimation.cpp/.h moved to BattleInterface/CCreatureAnimation.cpp/.h
* Removed unused project files
* Added VCMI_client filters file for VS 2010
* Gathered common parts of StdInc.h in Global.h
* Boost.Spirit has been included in PCH for ERM project
* StopWatch renamed to CStopWatch
* GuiBase.cpp split up in UIFramework/...
2011-12-17 18:59:59 +00:00
beegee1
7f04ed990b Major refactoring. First part: BattleInterface
Introduction of pre compiled headers,...
2011-12-13 21:23:17 +00:00
Ivan Savenko
0f2e00c780 -(linux) Moved all (I hope) files created by VCMI to ~/.vcmi to prevents crash on launch from read-only directory
- minor fixes for #362 #835 #836
2011-11-01 12:58:01 +00:00
Frank Zago
1f9e97005f When changing resolution, both screen? and res? must be set. Fixes #813. 2011-09-25 16:39:13 +00:00
Frank Zago
6dd9d416b4 Fixed #812. 2011-09-24 01:24:11 +00:00
Frank Zago
c4b8039c1e Added a missing rturn in CGameHandler::isAllowedExchangeForQuery. Fixed several typos. 2011-09-24 01:15:36 +00:00