Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
325 commits
Select commit Hold shift + click to select a range
1d2bf26
add a basic test to see if level gen is deterministic across platforms
wheybags Apr 30, 2019
07272c2
Fixed mistake where we called rand twice on one line
wheybags Apr 30, 2019
fa3833b
auto symlink resources folder
wheybags Apr 30, 2019
36a197e
Don't allow closing a door on top of an actor
wheybags May 26, 2019
abc6dfd
Don't crash if we get an input for a player that died
wheybags May 27, 2019
68d327e
Don't let a player register twice
wheybags May 27, 2019
d20791d
Fix mistake in heuristic
akuskis Jun 10, 2019
66bb57a
Merge pull request #438 from wheybags/mp_bug_fixes
wheybags Jul 17, 2019
b76dd45
use redirection in ini file instead of symlinks (#441)
wheybags Jul 17, 2019
6fcd24d
Check that there would be enought space for gold
akuskis Aug 15, 2019
3ec0ad8
Merge branch 'master' into check_pockets_before_selling_items
akuskis Aug 15, 2019
922258a
Add non-menu entry to menus and text colors
vieiraa Nov 24, 2019
f052627
Fix spacing
vieiraa Nov 24, 2019
a1a85c1
Remove comments and fix minor bug
vieiraa Nov 24, 2019
358606e
Add menuentry.h to CMakeLists
vieiraa Nov 24, 2019
09e296c
Fix which items receive red color
vieiraa Nov 24, 2019
8609afd
Add buy/sell confirm dialog
vieiraa Nov 24, 2019
841c4d8
Fix compilation error on g++.
vieiraa Nov 30, 2019
37f4d4b
Don't select non-clickable menus with mouse.
vieiraa Nov 30, 2019
0e76364
Fix crash.
vieiraa Nov 30, 2019
4dd6ca5
Add proper color handling
vieiraa Dec 6, 2019
034c884
Add MD5 check on MPQ
vieiraa Dec 13, 2019
92347c1
Add endianness
vieiraa Dec 14, 2019
c6cf944
decisions.md: Fix broken link to akazlou article (#449)
lanodan Jan 23, 2020
15c6151
autoformat
wheybags Jan 23, 2020
bf08822
Merge pull request #448 from vieiraa/validate
wheybags Jan 23, 2020
a187f7c
missing initialisers fix
wheybags Jan 23, 2020
3fe9421
remove namespace end comments
wheybags Jan 23, 2020
3ab5d48
Merge pull request #447 from vieiraa/confirm
wheybags Jan 23, 2020
b96408d
autoformat
wheybags Jan 23, 2020
42b4bde
Allow compilation with VS2017 (#445)
vieiraa Jan 23, 2020
349495b
Merge remote-tracking branch 'origin/master' into check_pockets_befor…
wheybags Jan 23, 2020
b7fcceb
add testing function
wheybags Jan 23, 2020
2f8d72c
Merge pull request #443 from akuskis/check_pockets_before_selling_items
wheybags Jan 23, 2020
ad284e8
Merge pull request #439 from akuskis/fix_pathfinder
wheybags Jan 23, 2020
e4e54b8
Merge pull request #431 from grantramsay/feat/45/vector-movement
wheybags Jan 23, 2020
3dd200c
Merge remote-tracking branch 'origin/master' into feat/45/missiles
wheybags Jan 23, 2020
42b977a
rename function
wheybags Jan 23, 2020
599a845
format fix
wheybags Jan 23, 2020
c1d8ff2
set FixNamespaceComments to false
wheybags Jan 23, 2020
c5194e3
Merge pull request #423 from grantramsay/feat/45/missiles
wheybags Jan 23, 2020
e155fb1
Merge branch master
vieiraa Jan 23, 2020
a771c00
Merge branch master
vieiraa Jan 23, 2020
ac90d38
Fix ConfirmDialog clickable entry
vieiraa Jan 23, 2020
87a7dca
Remove namespace comments
vieiraa Jan 23, 2020
a7abc9e
Fix copy-paste error, and autoformat
vieiraa Jan 23, 2020
0e4b5ba
Remove usage of boost md5 lib
vieiraa Jan 23, 2020
89ae09b
Add workaround for paths containing spaces
vieiraa Jan 23, 2020
6e92445
Change loop
vieiraa Jan 23, 2020
f34810c
Autoformat
vieiraa Jan 23, 2020
5c3a929
Add early loop exit
vieiraa Jan 24, 2020
814786e
Escape spaces.
vieiraa Jan 24, 2020
a5dfef3
Merge pull request #450 from vieiraa/md5
wheybags Jan 24, 2020
9c4029b
Merge pull request #446 from vieiraa/menus_colors
wheybags Jan 24, 2020
462ddd3
Properly escape paths on Windows (#452)
vieiraa Jan 25, 2020
8c013f2
Add gossip and quest text addresses
vieiraa Jan 25, 2020
0af7a77
Add talk dialog
vieiraa Jan 25, 2020
24337ab
Fix typo
vieiraa Jan 26, 2020
39572be
Add text popup
vieiraa Jan 26, 2020
2340dcc
Add autoscroll
vieiraa Jan 27, 2020
ee2c316
Move class to new file
vieiraa Jan 27, 2020
3f00e75
Add NPCs voices
vieiraa Jan 27, 2020
41a2dff
Autoformat
vieiraa Jan 27, 2020
2e99c95
Fix compilation error
vieiraa Jan 27, 2020
0555481
Stop sounds before opening TalkDialoguePopup
vieiraa Jan 27, 2020
7f9edff
Move NPCs dialogs to their own files
vieiraa Jan 28, 2020
6365859
Comment quest dialog fetching for now.
vieiraa Jan 28, 2020
df27dc4
Merge pull request #454 from vieiraa/talk
wheybags Jan 28, 2020
f7c9695
some small refactorings of melee combat code
wheybags Oct 12, 2019
7896049
FixedPoint tweaks
wheybags Nov 4, 2019
680de02
MSVC macro fixes + release mode error fix
wheybags Nov 18, 2019
4b781d5
Add unified ActorStats class and start to use it
wheybags Jan 24, 2020
55c509c
Use ActorStats for all player attacking code
wheybags Jan 24, 2020
3e280a7
Fix incorrect derived stats calculation
wheybags Jan 28, 2020
5ae5da2
Merge pull request #444 from wheybags/combat_improvements
wheybags Jan 28, 2020
5c2678c
Clear atlas texture when changing levels to reduce memory usage
grantramsay Feb 1, 2020
a1f682b
get rid of MonsterStats, use ActorStats for monsters too
wheybags Feb 3, 2020
1deadc7
account for armor class on attacks
wheybags Feb 3, 2020
ac975d1
Switch to recalculating stats at need based on a cache
wheybags Feb 3, 2020
ecd3d6f
allow specifying seed manually with --seed
wheybags Feb 3, 2020
35e7c0a
correct formula for deciding when to do hit recovery
wheybags Feb 3, 2020
28fa6ec
Add some tests for combat formulas
wheybags Feb 5, 2020
6a1cfb4
Merge pull request #456 from wheybags/combat_improvements_2
wheybags Feb 6, 2020
ba3670c
Squashed 'extern/filesystem/' content from commit 4efd2628
wheybags Feb 6, 2020
03cd84b
Merge commit 'ba3670cee60e069fc44909cc1f8afb206cabe040' as 'extern/fi…
wheybags Feb 6, 2020
645eb9f
remove boost::filesystem
wheybags Feb 6, 2020
e3ec63b
Squashed 'extern/cxxopts/' content from commit e6858d34
wheybags Feb 6, 2020
107c031
Merge commit 'e3ec63bcdd4af6efd3a7a8cb7cb1bcefd4ea0693' as 'extern/cx…
wheybags Feb 6, 2020
0cb6cea
make cxxopts::ParseResult default constructable
wheybags Feb 7, 2020
7ea6246
remove boost::program_options in favour of cxxopts
wheybags Feb 7, 2020
f7948c0
simpler + working implementation of copy_file
wheybags Feb 7, 2020
84a93e2
travis tweaks
wheybags Feb 7, 2020
23fa993
autoformat
wheybags Feb 7, 2020
88951ba
Squashed 'extern/optional-lite/' content from commit 86db12f3
wheybags Feb 7, 2020
f8210bc
Merge commit '88951ba9582b2b424b5e054656f7cc335f43a1c8' as 'extern/op…
wheybags Feb 7, 2020
a26764d
get rid of boost::optional
wheybags Feb 7, 2020
f8480bb
copy boost::make_unique implementation into misc.h
wheybags Feb 7, 2020
0899807
remove boost::signals2
wheybags Feb 7, 2020
f9e9288
remove usage of boost::algorithm
wheybags Feb 7, 2020
df51879
Squashed 'extern/fmt/' content from commit f94b7364
wheybags Feb 7, 2020
3230016
Merge commit 'df518796ee02a907ba068a4ccba424ea0dfbb2fa' as 'extern/fmt'
wheybags Feb 7, 2020
2f743db
remove use of boost::format
wheybags Feb 7, 2020
2913efd
Squashed 'extern/SPSCQueue/' content from commit 22191c03
wheybags Feb 7, 2020
c34cd94
Merge commit '2913efd724ce93af83cd61f2ad7226a4e4d7bc2d' as 'extern/SP…
wheybags Feb 7, 2020
3e99dd3
remove usage of boost::lockfree
wheybags Feb 7, 2020
7c8cc5e
remove a bunch of misc boost header includes
wheybags Feb 7, 2020
ec1afc3
remove boost::multiprecision usage
wheybags Feb 8, 2020
8799b8f
remove the single use we had of boost::variant
wheybags Feb 8, 2020
cde18e5
remove the last use of boost
wheybags Feb 8, 2020
456e7be
autoformat
wheybags Feb 8, 2020
220ec8e
windows compile fix
wheybags Feb 8, 2020
3366fc9
disable warnings in SPSCQueue header
wheybags Feb 8, 2020
707cd71
get rid of some unnecessary FixedPoint from-string construction
wheybags Feb 8, 2020
1bcf237
Merge pull request #458 from wheybags/no_boost
wheybags Feb 8, 2020
fa72397
removed some last instances of boost
wheybags Feb 9, 2020
32d5674
Merge pull request #459 from wheybags/no_boost_2
wheybags Feb 9, 2020
a2a4f99
Squashed 'extern/enet/' content from commit 0eaf48ee
wheybags Feb 9, 2020
76f9070
Merge commit 'a2a4f9957acd3a3bc31b1a352c1601f2464ded21' as 'extern/enet'
wheybags Feb 9, 2020
81dc7bf
use enet from extern folder
wheybags Feb 9, 2020
bcaf1f1
Squashed 'extern/SDL_mixer/' content from commit 7a636c6aa
wheybags Feb 9, 2020
aa043f9
Merge commit 'bcaf1f10ceab13160cefe1cd9cc69c78ef44e57b' as 'extern/SD…
wheybags Feb 9, 2020
a95b6af
use SDL_mixer from extern folder
wheybags Feb 9, 2020
7e8a7f9
Squashed 'extern/libpng/' content from commit 0c440812d
wheybags Feb 9, 2020
bbe7d9c
Merge commit '7e8a7f9f685578e1894c1e45709a26bceb0089d5' as 'extern/li…
wheybags Feb 9, 2020
27e4c9b
import libpng changes from https://github.com/hunter-packages/libpng/…
wheybags Feb 9, 2020
b569850
fix broken windows check in enet cmake
wheybags Feb 9, 2020
fb6cb36
Squashed 'extern/zlib/' content from commit a8895ac22
wheybags Feb 9, 2020
92d5264
Merge commit 'fb6cb365a274b8285f36df9da27f445c7683beeb' as 'extern/zlib'
wheybags Feb 9, 2020
eddf36e
import zlib changes from https://github.com/hunter-packages/zlib/rele…
wheybags Feb 9, 2020
5ae4ae9
Squashed 'extern/SDL_image/' content from commit 918e93dec
wheybags Feb 9, 2020
d44148f
Merge commit '5ae4ae9b3ed8d02275d656ef5d9672c6f7a626f6' as 'extern/SD…
wheybags Feb 9, 2020
e5d7373
import SDL_image changes from https://github.com/hunter-packages/SDL_…
wheybags Feb 9, 2020
dbccfd0
Squashed 'extern/SDL2/' content from commit 9333e80281
wheybags Feb 9, 2020
5b37ea7
Merge commit 'dbccfd02d21d6621e8cf238b6b0482bb03d20bd8' as 'extern/SDL2'
wheybags Feb 9, 2020
3b4ebcf
import SDL2 changes from https://github.com/hunter-packages/SDL2/rele…
wheybags Feb 9, 2020
27625e4
cleaned up extern cmake a bit
wheybags Feb 9, 2020
b261400
Squashed 'extern/StormLib/' content from commit bd203c036b
wheybags Feb 9, 2020
3e5bd19
Merge commit 'b261400051b962c22a9bc382f0ee09cb543ac655' as 'extern/St…
wheybags Feb 9, 2020
a788e24
use stormlib from extern instead of hunter
wheybags Feb 9, 2020
d30e519
Squashed 'extern/gtest/' content from commit 703bd9caab
wheybags Feb 9, 2020
46b6a6a
Merge commit 'd30e51966a60ffb3da857826ba2821592b7008e6' as 'extern/gt…
wheybags Feb 9, 2020
5084538
use gtest from extern
wheybags Feb 9, 2020
76fd724
remove hunter
wheybags Feb 9, 2020
c672eeb
autoformat
wheybags Feb 9, 2020
9b0c1fb
remove hunter cache on appveyor
wheybags Feb 9, 2020
b0f48b4
osx build fix
wheybags Feb 9, 2020
240414c
windows build fixes
wheybags Feb 9, 2020
148bad0
Merge pull request #460 from wheybags/vendor_deps
wheybags Feb 9, 2020
6b210b2
update build + CI scripts to use c++17
wheybags Feb 6, 2020
9f63b9c
added a real constexpr string constructor to FixedPoint
wheybags Feb 9, 2020
6459c6e
replace optional-lite with std::optional
wheybags Feb 12, 2020
80d808a
replace nonstd::make_unique with std::make_unique
wheybags Feb 12, 2020
7c37d0d
allow running clang-format locally
wheybags Feb 12, 2020
346a485
Merge pull request #457 from wheybags/cpp17
wheybags Feb 13, 2020
04058ea
fix broken hover text
wheybags Feb 14, 2020
d7b5b91
Fix crash when enter hit twice on SelectHeroMenuScreen
grantramsay Feb 14, 2020
7c93675
Fix some Clang-Tidy (static analysis) warnings in EngineMain
grantramsay Feb 14, 2020
f7e1851
Fix minor save/load bug
grantramsay Feb 15, 2020
df18dfc
Don't pass GUI clicks to game engine
grantramsay Feb 15, 2020
d74df33
Add basic handling of spells
grantramsay Feb 16, 2020
6ecdcfb
Add spellbook GUI
grantramsay Feb 16, 2020
457dda1
Autoformat
grantramsay Feb 16, 2020
2a15ddb
Merge pull request #462 from grantramsay/fix/select-hero-menu-crash
wheybags Feb 16, 2020
a789f9e
Tidy other minor inconsistencies
grantramsay Feb 15, 2020
450da98
Set player active spell through player input interface
grantramsay Feb 19, 2020
74bfedc
Merge pull request #464 from grantramsay/fix/392/drag-off-gui
wheybags Feb 19, 2020
72d6f2a
Merge branch 'feat/45/spells'
wheybags Feb 19, 2020
d4cab6a
add links to Jarulf's Guide
wheybags Feb 14, 2020
b968e82
Add damage bonuses of weapon / enemy type combos
wheybags Feb 14, 2020
5620a96
add in melee bonus when using a shield with no weapon
wheybags Feb 14, 2020
c9d350b
fix up messy includes
wheybags Feb 14, 2020
19e9a6b
paralyse while recovering from a hit
wheybags Feb 14, 2020
d4d212f
Add blocking
wheybags Feb 20, 2020
e552f05
force clang-format-7
wheybags Feb 20, 2020
30e3aef
add calculation of weapon / spell attack speeds
wheybags Feb 20, 2020
20f943f
enum for monster attack type
wheybags Feb 20, 2020
19fa65f
fix reversed comparison bug in blocking
wheybags Feb 20, 2020
2f616a6
Fix a bug where you could close a door on top of yourself
wheybags Feb 20, 2020
3c5351e
Correct animation speed for most animations
wheybags Feb 20, 2020
ba9f233
some fixes to hit interruption
wheybags Feb 20, 2020
0834098
Correct hit frames for monsters and (I think?) players too
wheybags Feb 20, 2020
efbadca
Remove unused spell hotkeys
grantramsay Feb 21, 2020
8634586
Merge pull request #467 from grantramsay/fix/remove-spell-hotkeys
wheybags Feb 21, 2020
8ed0bc6
randomise monster spawn health
wheybags Feb 21, 2020
1a13317
monsters don't attack immediately after finishing an attack
wheybags Feb 21, 2020
f2e2fe0
Merge pull request #461 from wheybags/combat_improvements_3
wheybags Feb 21, 2020
d04d5b0
merge Vec2Fix and Vec2 template class
wheybags Feb 21, 2020
a65f557
merge Misc::Point with Vec2
wheybags Feb 21, 2020
a93068b
fix missing M_PI on windows
wheybags Feb 21, 2020
1745ad0
use two build threads on travis
wheybags Feb 21, 2020
852ee95
allow initialising a Vec2 from another type of Vec2 explicitly
wheybags Feb 21, 2020
a0edf6f
Add spell selection menu
grantramsay Feb 23, 2020
d226062
Add "s" hotkey to toggle spell selection menu
grantramsay Feb 23, 2020
5744cc7
Pass around a Vec2Fix instead of a base Vec2i and scaled offset Vec2i
wheybags Feb 21, 2020
932aaf1
Modify Position class to be based of an internal fractional position
wheybags Feb 21, 2020
3eef8c8
Optimised FixedPoint
wheybags Feb 23, 2020
4ed3c12
Show fps in the title bar
vieiraa Feb 24, 2020
19d420e
Add spell hotkeys and move "active spell" to player behaviour
grantramsay Feb 23, 2020
390396c
Clang-format
grantramsay Feb 24, 2020
5711972
Fix bug with spell selection blocking bottom menu buttons
grantramsay Feb 24, 2020
00baeed
Merge pull request #472 from grantramsay/feat/spell-selection-menu
wheybags Feb 25, 2020
67283aa
Merge pull request #471 from vieiraa/fps
wheybags Feb 25, 2020
77a56ca
Rename audio.h to fa_audio.h
akuskis Feb 26, 2020
0a3fd17
Merge pull request #470 from akuskis/reduce_components_visibility
wheybags Feb 27, 2020
a661b7b
fix use-after-free in menus
wheybags Feb 27, 2020
30de380
Correct movement speeds for player + monsters
wheybags Feb 27, 2020
0c873ad
Fix animation stuttering when walking
wheybags Feb 27, 2020
3fc51ef
remove unnecessary check
wheybags Feb 27, 2020
25c84f8
Merge pull request #468 from wheybags/movement_speed
wheybags Feb 28, 2020
9a7a955
fix menu handler blockign game input
wheybags Feb 28, 2020
ff59cb2
valgrind fixes + misc refactoring
wheybags Feb 28, 2020
adec374
bunch of changelog edits
wheybags Feb 28, 2020
13b2b14
Add animations for casting spells and fire arrows for ranged weapons
grantramsay Feb 29, 2020
763fae8
Tidy missile class composition
grantramsay Mar 1, 2020
f7fec51
Tidy namespaces
grantramsay Mar 1, 2020
909b60b
Allow setting different speeds for missiles
grantramsay Mar 1, 2020
fa63c7a
Format
grantramsay Mar 1, 2020
15a2a35
Allow missile graphics to be on different levels
grantramsay Mar 1, 2020
9a3de11
Add town portal spell
grantramsay Mar 2, 2020
367c560
Fix build
grantramsay Mar 2, 2020
311e294
PR updates
grantramsay Mar 3, 2020
aaa6347
Put missile max range within missile movement
grantramsay Mar 3, 2020
438e688
Merge pull request #474 from grantramsay/feat/cast-spell-animations
wheybags Mar 4, 2020
2c1ef6f
PlayerClass fixes
wheybags Mar 4, 2020
edfe119
fix travis suddenyl using the wrong osx image (#476)
wheybags Mar 4, 2020
9af28f5
force static libstdc++ and libgcc on linux
wheybags Mar 5, 2020
ec73394
Make freeablo work from an installed dir
wheybags Mar 5, 2020
c11319b
extern/filesystem: isolate use of windows.h because of miscrosft weir…
wheybags Mar 6, 2020
23332ed
Merge pull request #477 from wheybags/install
wheybags Mar 6, 2020
c912d5b
consistently use "Sorceror" over "Sorcerer", since that's what the or…
wheybags Mar 6, 2020
eaac98a
fix call to system() when brackets present in path
wheybags Mar 6, 2020
87c4ce5
release v0.4 (at long last)
wheybags Mar 6, 2020
f1f86e9
Merge remote-tracking branch 'origin/master' into feat/missile-class-…
grantramsay Mar 6, 2020
d55b60a
PR updates
grantramsay Mar 7, 2020
9665dcf
Tidy up save method const correctness
grantramsay Mar 8, 2020
e69dc55
Merge pull request #475 from grantramsay/feat/missile-class-composition
wheybags Mar 12, 2020
8dfcb8c
Merge remote-tracking branch 'origin/master' into fix/save-const-corr…
wheybags Mar 12, 2020
aaeec34
Merge pull request #479 from grantramsay/fix/save-const-correctness
wheybags Mar 12, 2020
bea6ecd
Fix item targetting issue
wheybags Mar 12, 2020
1a2cbf1
get rid of unnecessary Tile class
wheybags Mar 12, 2020
dd9b476
Fix potential save / load instability
wheybags Mar 12, 2020
c4a2f47
remove unused methods
wheybags Mar 12, 2020
0f4f26a
Merge pull request #480 from wheybags/fixes
wheybags Mar 12, 2020
6aaca91
Update readme.md
wheybags Mar 12, 2020
3b4c1fb
Merge remote-tracking branch 'origin/master' into test/textureAtlasBa…
wheybags Mar 12, 2020
450ecef
format fixes
wheybags Mar 12, 2020
a1a60c1
fix line endings (CRLF->LF)
wheybags Mar 12, 2020
7f8f83e
line endings
wheybags Mar 12, 2020
b67df78
Merge branch 'master' into test/textureAtlasBatchRender
wheybags Mar 12, 2020
ba86dfe
post-merge fixes
wheybags Mar 12, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 3 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ AlignAfterOpenBracket: Align
DerivePointerAlignment: false
PointerAlignment: Left

# WISHLIST: for all the below, and "allow" option, instead of just true or false
FixNamespaceComments: false

# WISHLIST: for all the below, an "allow" option, instead of just true or false
# This would preserve alignment if it's already aligned, but not force it if it
# wasn't. Without that option, the amount of false positives make these useless
#AlignConsecutiveAssignments
Expand Down
12 changes: 4 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@ branches:
- master

sudo: false
dist: trusty
dist: bionic

cache:
directories:
- $HOME/.hunter

addons:
apt:
packages:
- python3-pip
- libgl1-mesa-dev
- clang-format-7

matrix:
include:
Expand All @@ -23,6 +21,7 @@ matrix:
- os: linux
env: JOB=clang-format
- os: osx
osx_image: xcode11.3 # macos 10.14 + xcode 11.3
env: JOB=build

script: ./travis.sh
Expand All @@ -36,6 +35,3 @@ notifications:
email:
on_success: change
on_failure: always
env:
global:
secure: b9143BbjFmQvaxruDHiUy1sW4InyZGejs4S/xgb4W1fFTzea9EMpzjWgwospBI3NPpe6xadctdypL9UbzJMXfD0PAZ39FbMIgl56pFkoZv1G9vwLOjG6ka0wXT7Pr6yP2FHkIdrQWECvvc1shTFXU9Yeystl0ISPwgphWUlwFZU=
100 changes: 21 additions & 79 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,109 +1,46 @@
cmake_minimum_required (VERSION 3.8)

set(
HUNTER_CACHE_SERVERS
"https://github.com/wheybags/hunter-cache"
CACHE
STRING
"Default cache server"
)

set(
HUNTER_PASSWORDS_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Hunter/passwords.cmake"
CACHE
FILEPATH
"Hunter passwords"
)

string(COMPARE EQUAL "$ENV{GITHUB_USER_PASSWORD}" "" password_is_empty)

if (NOT password_is_empty)
option(HUNTER_RUN_UPLOAD "Upload cache binaries" ON)
endif()
cmake_minimum_required (VERSION 3.11)

## Windows Config ##
if (WIN32)
set (CMAKE_SYSTEM_VERSION 8.1 CACHE TYPE INTERNAL FORCE)
set (CMAKE_SYSTEM_VERSION 8.1 CACHE STRING INTERNAL FORCE)

set(desired_generator "Visual Studio 14 2015 Win64")
set(desired_generators "Visual Studio 16 2019")

string(COMPARE EQUAL "${CMAKE_GENERATOR}" "${desired_generator}" generator_is_correct)
if (NOT generator_is_correct)
message(FATAL_ERROR "Incorrect generator, please run cmake with: -G \"${desired_generator}\"")
if (NOT "${CMAKE_GENERATOR}" IN_LIST desired_generators)
message(FATAL_ERROR "Incorrect generator, please run cmake with: -G GENERATOR, where GENERATOR is one of: ${desired_generators}")
endif()

set(HUNTER_CMAKE_GENERATOR "${desired_generator}")
endif()


# cmake policies
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.11)
cmake_policy(SET CMP0074 NEW) # find_library calls use $LIB_ROOT variables. Shouldn't affect us much/at all, but silences warnings
ENDIF()

include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.20.64.tar.gz"
SHA1 "7b830dfda7a094b2af15f44b24ebd2489404d880"
LOCAL
)

project (Freeablo)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

hunter_add_package(SDL2)
find_Package(SDL2 CONFIG REQUIRED)

hunter_add_package(SDL_image)
find_package(SDL_image CONFIG REQUIRED)

hunter_add_package(SDL_mixer)
find_package(SDL_mixer CONFIG REQUIRED)

hunter_add_package(PNG)
find_package(PNG CONFIG REQUIRED)

hunter_add_package(enet)
find_package(enet CONFIG REQUIRED)

hunter_add_package(ZLIB)
find_package(ZLIB CONFIG REQUIRED)

hunter_add_package(stormlib)
find_package(stormlib CONFIG REQUIRED)

hunter_add_package(Boost COMPONENTS filesystem system program_options date_time regex)
find_package(Boost CONFIG REQUIRED filesystem system program_options date_time regex)
set(HUNTER_BOOST_LIBS Boost::filesystem Boost::system Boost::program_options Boost::date_time Boost::regex)

set(OpenGL_GL_PREFERENCE LEGACY)
Find_Package(OpenGL REQUIRED)

set(FA_COMPILER_FLAGS "")

# Use C++11
if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "--std=gnu++11 ${CMAKE_CXX_FLAGS}")
endif ()
else ()
set (CMAKE_CXX_STANDARD 11)
endif ()
set (CMAKE_CXX_STANDARD 17)

if(WIN32)
add_definitions(-DNOMINMAX) # http://stackoverflow.com/questions/5004858/stdmin-gives-error
endif()

option (FA_TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors")

if(UNIX)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(FA_COMPILER_FLAGS "${FA_COMPILER_FLAGS} -Wall -pedantic -Wextra -Wno-unknown-pragmas -Wno-missing-braces")
SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
if (FA_TREAT_WARNINGS_AS_ERRORS)
set(FA_COMPILER_FLAGS "${FA_COMPILER_FLAGS} -Werror")
endif()
endif()

if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
SET(GCC_LINKER_FLAGS "-static-libstdc++ -static-libgcc")

SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_LINKER_FLAGS}")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${GCC_LINKER_FLAGS}")
endif()

if(MSVC)
set(FA_COMPILER_FLAGS "${FA_COMPILER_FLAGS} /MP /W4 /D_CRT_SECURE_NO_WARNINGS /wd4244 /wd4100 /wd4611 /wd4458 /wd4459 /wd4127 /wd4800 /wd4267 /wd4172")
# 4244 - e.g. 'argument': conversion from 'const long double' to 'double' -- boost headers
Expand Down Expand Up @@ -158,3 +95,8 @@ if(MSVC)
set_property(TARGET launcher PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
set_property(TARGET unit_tests PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
endif()

install(DIRECTORY resources/ DESTINATION resources
PATTERN "settings-user.ini" EXCLUDE)

install(FILES changelog.md DESTINATION .)
8 changes: 4 additions & 4 deletions apps/celview/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ add_executable(celview
main.cpp
)

target_link_libraries(celview NuklearMisc)
target_link_libraries(celview NuklearMisc SDL2main fmt::fmt)
if (MINGW)
target_link_libraries(celview -lmingw32 SDL2::SDL2main)
else ()
target_link_libraries(celview SDL2::SDL2main)
target_link_libraries(celview -lmingw32)
endif ()
set_target_properties(celview PROPERTIES COMPILE_FLAGS "${FA_COMPILER_FLAGS}")

install(TARGETS celview DESTINATION bin)
27 changes: 18 additions & 9 deletions apps/celview/main.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
//#include "mainwindow.h"
//#include <QApplication>

#include "../components/settings/settings.h"
#include <boost/format.hpp>
#include <chrono>
#include <faio/fafileobject.h>
#include <fmt/format.h>
#include <input/inputmanager.h>
#include <nfd.h>
#include <nuklearmisc/inputfwd.h>
#include <nuklearmisc/standaloneguispritehandler.h>
#include <nuklearmisc/widgets.h>
#include <render/render.h>

int main(int, char**)
int main(int argc, char** argv)
{
Misc::saveArgv0(argv[0]);

if (argc > 2)
message_and_abort_fmt("Usage: %s [filename]", argv[0]);

Render::RenderSettings renderSettings;
renderSettings.windowWidth = 800;
renderSettings.windowHeight = 600;
Expand All @@ -24,7 +26,7 @@ int main(int, char**)
nk_context* ctx = guiHandler.getNuklearContext();

Settings::Settings settings;
settings.loadFromFile("resources/celview.ini");
settings.loadFromFile(Misc::getResourcesPath().str() + "/celview.ini");

bool faioInitDone = false;
std::string listFile = settings.get<std::string>("celview", "listFile", "Diablo I.txt");
Expand Down Expand Up @@ -74,9 +76,9 @@ int main(int, char**)

if (image)
{
nk_label(ctx, (boost::format("Number of Frames: %1%") % image.get()->getSprite()->size()).str().c_str(), NK_TEXT_LEFT);
nk_label(ctx, (boost::format("Width: %1%") % image->getSprite()->getWidth()).str().c_str(), NK_TEXT_LEFT);
nk_label(ctx, (boost::format("Height: %1%") % image->getSprite()->getHeight()).str().c_str(), NK_TEXT_LEFT);
nk_label(ctx, fmt::format("Number of Frames: {}", image.get()->getSprite()->size()).c_str(), NK_TEXT_LEFT);
nk_label(ctx, fmt::format("Width: {}", image->getSprite()->getWidth()).c_str(), NK_TEXT_LEFT);
nk_label(ctx, fmt::format("Height: {}", image->getSprite()->getHeight()).c_str(), NK_TEXT_LEFT);
frame = nk_propertyi(ctx, "Frame", 0, frame, image->getSprite()->size(), 1, 0.2f);

if (nk_button_label(ctx, "save as png"))
Expand Down Expand Up @@ -158,6 +160,13 @@ int main(int, char**)
settings.save();

faioInitDone = true;

if (argc > 1)
{
selectedImage = argv[1];
frame = 0;
nextImage = std::unique_ptr<NuklearMisc::GuiSprite>(guiHandler.getSprite(new Render::SpriteGroup(selectedImage)));
}
}
}

Expand Down
11 changes: 6 additions & 5 deletions apps/exedump/main.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include <diabloexe/diabloexe.h>

#include <iostream>

#include "settings/settings.h"
#include <diabloexe/diabloexe.h>
#include <faio/fafileobject.h>
#include <iostream>
#include <misc/misc.h>

int main(int, char**)
int main(int, char** argv)
{
Misc::saveArgv0(argv[0]);

Settings::Settings settings;
settings.loadUserSettings();

Expand Down
3 changes: 3 additions & 0 deletions apps/fontgenerator/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <faio/fafileobject.h>
#include <iostream>
#include <vector>
#include <algorithm>

void help(char** argv)
{
Expand All @@ -16,6 +17,8 @@ void help(char** argv)

int main(int argc, char** argv)
{
Misc::saveArgv0(argv[0]);

if (argc < 2)
{
help(argv);
Expand Down
Loading