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

178 Commits

Author SHA1 Message Date
DjWarmonger
e54c816c92 Treasure piles can now cover several tiles. 2014-06-05 17:19:11 +02:00
Ivan Savenko
1d17d60449 gcc update:
- removed support for 4.6
- compilation fixes for 4.7
2014-05-29 13:42:05 +03:00
Macron1Robot
2d425666d7 Update Global.h
Removed commented row
2014-04-27 13:48:22 +04:00
Macron1Robot
8ec7a9b919 Moved "max heroes on map per player", "max heroes available for player" to "defaultMods.json" 2014-04-27 10:43:46 +04:00
Macron1Robot
907caedb13 Added "produce" section in "building" structure. Changed dailyIncome. 2014-04-26 18:23:35 +04:00
beegee1
1d57b75bc5 - random number generation refactoring
- fixed mantis #1743
2014-04-10 19:22:32 +02:00
Ivan Savenko
9c0df68cb8 Fixing spelling mistakes. Patch from josch, fixes #1759 2014-03-23 12:59:03 +00:00
beegee1
95034b9fa0 - Updated PCH to use our StdInc.h as the prefix header (not generated one from cotire) -> no exclude headers from ffmpeg/etc... statements required
- Fixed compilation error (VCAI ResourceSet logging)
2014-02-05 20:25:36 +00:00
beegee1
df0a28d9cb - added PCH compilation for CMake using cotire module (PCH is OFF per default, can be enabled with ENABLE_PCH=ON) 2014-02-01 13:37:26 +00:00
beegee1
b8eddcd9a8 - Moved place bonus hero before normal random hero and starting hero placement -> same behaviour as in OH3
- Moved placing campaign heroes before random object generation -> same behaviour as in OH3
- Refactored pickHero into pickNextHeroType (hero generation sequence) and pickUnusedHeroTypeRandomly
- Added a SIGSEV violation handler to vcmiserver executable for logging stacktrace (for convenience only)
- Fixed Fuzzy.cpp and VCAI.h compilation on Clang
- Added a handleException function in addition to our macros (no use of macros, enables debugging support, does not re-throw, catches ...-case too)
2013-12-28 12:47:55 +00:00
beegee1
69eee05ccc - Partially fixed mantis #1065 (Gate with hex 95 can't be attacked)
- Fixed 'catapult tried to attack non-catapultable hex!' problem, now catapult attacks attackable wall parts only
- Fixed problem that the server performed applying damage on a wall part twice
- Added methods for checking what wall parts are attackable and if a wall part is potentially attackable
- Added functionality to trace net packages
- Added functionality to trace std::vectors
- Added tracing for CatapultAttack(CPack)
- Updated various toString methods to use {} instead of []
- Refactoring
2013-12-08 17:54:13 +00:00
DjWarmonger
b3b523b768 Compile fixes for MVS. 2013-12-03 15:24:13 +00:00
Ivan Savenko
3560bbb7f3 two patches/pull requests from janisozaur
- replace our custom bmap with std::map::at()
- compile fixes for editor
2013-11-12 10:45:42 +00:00
Ivan Savenko
55577d0ac4 - fixed missing DLL_LINKAGE
- use precalculated checksum for zip files
- UNUSED macro to silence some warnings
2013-11-09 13:49:36 +00:00
Ivan Savenko
dd73573c5c - vcmi can now calculate crc32 checksum of a file
- reorganized internal filesystem structure - all files from one mod are
now grouped in same FS node
- modhandler will now calculate crc32 checksum for each mod
- modhandler now knows validation status of each mod

todo - use checksum to determine mods that have not changed since last
start and disable validation for them.
2013-11-08 20:36:26 +00:00
Ivan Savenko
208df34fc2 bigfixing & new file: launcher/jsonutils.cpp
- launcher uses json parser from vcmi lib instead of one from Qt #1469
- fixed abilities overrides for some creatures #1476
- fixed hero portraits in seer huts #1402
- ttf fonts will render text in utf-8 mode. Not really useful at this point
- new settings entry, available in launcher: encoding. Unused for now.
2013-09-21 18:29:26 +00:00
Michał W. Urbańczyk
b62bb096a7 Fixed #1430, work-around to make #1435 non-crashing.
Fixed at least one of the #1428 infinite turns cases.
2013-09-11 21:57:08 +00:00
Michał W. Urbańczyk
dd72261193 Fixed #1437. 2013-09-05 22:11:13 +00:00
Michał W. Urbańczyk
3b42cff3ec #1409 should not crash anymore.
Fixed crash on serializing empty path. [How did it got there...?]
operator<< for boost::optional.
2013-08-18 15:46:28 +00:00
Michał W. Urbańczyk
58ccaa2e93 The cmath "fix" was not needed after all, the includes order decides. 2013-08-02 08:28:52 +00:00
Michał W. Urbańczyk
d8a27d8f3c Refactored player-specific data into single struct BattleState. 2013-07-21 22:01:29 +00:00
Michał W. Urbańczyk
516684aaab Visual 2012 compile fixes.
Unfortunately no C99 math nor uniform initialization till VS 2013.
2013-07-07 08:27:27 +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
Michał W. Urbańczyk
4576719abe Visual Studio 2013 Preview compile fixes:
* 0 is not convertible to std::function, nullptr should be used
* std::ref(rand) is not convertible to function<int()>, used lambdas (why we dont just pass "rand" ? )
* CFunctionList needs to be constructible from nullptr
* move constructor for CMapInfo (Visual cannot generate them :( )
* #ifdefed some stuff that is not needed anymore since cmath is updated with C99 stuff
* using std::make_unique instead of our vstd implementation

CSelector: 
* introduced a class in place of typedef
* Having an overloaded && || operators over sth that is convertible to bool… Wasn't a good idea after all. Purged the operators, replaced  with And/Or methods (chaining-style).
* constructor that is present only when constructing from class or function (SFINAE). std::function has an implicit converting constructor from T causing ambiguities (even if the overload would cause compile error in the body)
2013-07-02 12:08:30 +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
cb9a750701 - reverted one macro change 2013-06-26 11:33:21 +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
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
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
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
03c2aa9153 - Refactored CMapEditManager(added structure for undo functionality) - Refactored CMap(terrain pointer is private, safe access via getTile) 2013-04-19 11:43:11 +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
e6bb9d3887 - Integrated the logger API into the ERM project 2013-04-11 12:04:44 +00:00
beegee1
abf96a5b66 - Integrated the logging API into the AI subprojects - Added macros for tracing the control flow - Added methods isDebug/TraceEnabled for performance-critical sections 2013-04-10 16:28:14 +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
Ivan Savenko
0d3ec3c6da clang compile\warning fixes 2013-04-05 21:27:24 +00:00
beegee1
0baa261dfc - Implemented the new logging API(not used currently) - Added lock typedefs to Global.h - Some layout updates to Global.h 2013-04-05 10:29:46 +00:00
Ivan Savenko
b4e54f76ea - split heroes.json in manner similar to creatures\factions
- string ID's for H3 heroes
- data in vcmi configs for heroes will replace data in h3 txt's
2013-03-03 18:00:37 +00:00
Ivan Savenko
5a8787b74d - fixed some compiler warnings, gcc\clang work fine
- better handling of innoextract in vcmibuilder.
2013-02-11 22:36:12 +00:00
mateuszb
d540723739 * refactoring 2013-02-11 14:42:09 +00:00
Michał W. Urbańczyk
2f39db2375 Hero portraits in campaign bonus selection. 2013-02-09 19:19:14 +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
DjWarmonger
e63747d2d2 Fixed #860 and #1169
Imprisoned heroes as well as their commanders will get full level ups, with updated specialty, mana and movement.
2013-02-04 12:32:53 +00:00
mateuszb
8769f67c5d * JsonReader can convert to enums
* refactoring
2013-02-03 21:05:44 +00:00
beegee1
1cab54b87a - Fixed bug when starting random map with 1 player - Refactoring - Fixed compile bug - Heroes can be selected in map selection screen(RMG map) - Main town gen 2013-01-20 14:43:58 +00:00
beegee1
0311e5e6f5 - Added basic mock/test generation - Added stub for terrain editing 2013-01-06 19:30:12 +00:00
beegee1
c05c05962d * Fixed bug #1142 (GCC 4.7.0 and 4.7.1 aren't supported) 2012-10-24 15:29:54 +00:00
Ivan Savenko
f113f9573d - CPack support. Works on my side, needs tweaks for Win 2012-10-05 12:38:17 +00:00
mateuszb
652ea4036e * artifact bonuses are read from config file now
* removed two commented-out methods
2012-10-03 18:11:19 +00:00
mateuszb
657ed41088 * fixed bug in campaigns
* turned off artifacts.json creation
* minor changes
2012-09-29 17:36:48 +00:00
Michał W. Urbańczyk
95b866c131 * Further work on Battle AI. Now it is able to cast a number of offensive spells. Battle callback exposes more spell-casting info.
* Took down the one Boost.Assign usage offending VC11. I'm getting impatient I guess...
2012-09-23 23:10:56 +00:00
Michał W. Urbańczyk
62e63d45b1 Work in progress on BattleAI. Related changes:
* battle AIs receive ptr to CBattleCallback (not sure why it was CPlayerBattleCallback, likely mistake)
* reworked some battle callback methods to be more generic and able to handle some hypothetic scenarios
* for testing purposes in duel mode the first AI will be taken fro mconfig and the second will remain stupid ai
* minor changes
2012-09-20 16:55:21 +00:00
mateuszb
473fbb4a31 * check for boost version before using thread v3 (brings back compatibility for boost 1.49 and older) 2012-09-16 15:49:22 +00:00
alexvins
369f0ae9c6 [PLATFORM] MinGW support added
* disabled features unsupported by MinGW
* fixed issues with DLL_LINKAGE
! BOOST_THREAD_VERSION in now 3 workaround for existing code added, consider refactoring.
* some small tweaks ("-fpedantic" warnings)
2012-09-15 19:16:16 +00:00
Ivan Savenko
d69f4b7632 - build system update
- fixed gcc\clang warnings
2012-08-26 09:59:07 +00:00
Michał W. Urbańczyk
d390113c23 * New files for lib: CBattleCallback.cpp and CBattleCallback.h
* Updated MSVC project files
* Filesystem: My version of .SND archive does not have \0 after WAV extension. Fixed (though hardcoded 3-char extension length).
* New bonus types: BLOCK_MAGIC_ABOVE for blocking casting spells above given level and BLOCK_ALL_MAGIC for blocking all magic.
* Heavy rewrite of battle callbacks. Fixed some minor bugs. Code reusage between lib/client/server (removed proxy calls). Better access control and support for various perspectives.
* Fixed #1031
* Fixed Orb of Inhibition and Recanter's Cloak (they were incorrectly implemented). Fixed #97.
* Fleeing hero won't lose artifacts. Spellbook won't be captured. Fixed #980.
* Fixed crash when attacking stack dies before counterattack (ie. because of Fire Shield)
* Server does some basic checks if action requests during battle are valid
* Minor stuff.
2012-08-26 09:07:48 +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
28f0263298 - compile fixes
- filesystem tweaks
2012-08-08 10:17:46 +00:00
Michał W. Urbańczyk
cd63c177e2 * std::unordered_map implementation in MSVC 10 has terribly slow destructor. Since bug is fixed only in VC11, I replaced it with boost::unordered_map.
* fixed crash with invalid .lod archive (some H3 installations have fake 1 byte .lod "archives"
* fixed crash when parsing invalid map file
* minor random optimizations (rv-refs, etc)
2012-08-08 08:25:27 +00:00
Ivan Savenko
708ad6ac7f - music player uses URI's instead of enum from music base
- #1045 and #1046 should be fixed
- moved pregame backgrounds to config/mainmenu
- animation can be overriden with .json multiple times
2012-08-06 07:34:37 +00:00
beegee1
1ed91077f7 * Implementation of the new filesystem API (msvc project files needs to be updated) 2012-07-22 15:02:13 +00:00
Michał W. Urbańczyk
54ca71d598 Update to Boost.Filesystem version 3, since Boost 1.50 drops support for version 2.
Check http://forum.vcmi.eu/viewtopic.php?t=518
2012-07-02 09:04:05 +00:00
Ivan Savenko
47945383da gcc-4.5 compatibility 2012-06-23 17:19:50 +00:00
Ivan Savenko
9d2711fb51 - rewrote most of classes from adventure map window
-- new files: client/AdventureMapClasses.*
-- implemented all missing details from infobox
- textinput can handle numbers as input
- fixed several bugs caused by CIntObject changes
- fixed #988
2012-06-13 13:04:06 +00:00
Michał W. Urbańczyk
e7d82a9702 Rewritten CLoadFile::openNextFile to be cleaner and not leak. Desperate messing around for #989. 2012-06-08 00:12:31 +00:00
Ivan Savenko
61ccabde53 - vcmi can be compiled with clang-3.1 2012-05-27 19:06:35 +00:00
Michał W. Urbańczyk
5449546447 Advanced work on support for Quicksand and Land Mine spells. 2012-05-04 21:16:39 +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
Ivan Savenko
f426a48d09 - fixes for gcc-4.7
- added missing virtual destructors (new warning from gcc)
2012-04-08 10:34:23 +00:00
Michał W. Urbańczyk
3bf76cb719 Fixed #216 and #907.
* CTRL+T will open marketplace window
* T in adventure map will switch to next town
* T in castle window will open a tavern window (if available)
* G will open thieves guild window if player owns at least one town with tavern
* various minor changes
2012-04-08 01:15:18 +00:00
DjWarmonger
9518474ec7 First attempt to replace rule-of-a-thumb behavior with actual reasoning
- GATHER_ARMY goal replaces wander function
- Heroes will remember their own goals until they are fulfilled
- Goal search handles mutual dependency
- AI will recruit multiple heroes for exploration
- Lots of tweaks
2012-03-13 12:47:47 +00:00
Michał W. Urbańczyk
d0e259864e * Replaced boost::shared_ptr with std::shared_ptr.
* Brought shared_ptr and unique_ptr and their factories (make_shared, make_unique) to the global scope. 
* Removed excessive usage of shared_ptr in bonus system interface. 
* Fixed bonus system limiters/caching interactions. That covers #823, #859 and a number of rare edge-cases. 
* Implemented multiple-step limiters applying, fixing hasAnotherBonusLimiter  and allowing transitional dependencies between bonuses. 
* Bonus system should be slightly faster, since we cache limited bonuses. Some rare usages (limiting query against a foreign node) however can't use caching.
2012-03-06 16:59:55 +00:00
DjWarmonger
cd0ed39fbf Implemented rule-based evaluation of tactical advantage between armies.
AI will creep more agressively and smarter.
2012-03-04 10:43:46 +00:00
Ivan Savenko
9ce3c78387 - fix for compilation with gcc-4.5
- fix for #881
2012-02-28 11:26:08 +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
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
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