diff --git a/proj/xc11/BoE.xcodeproj/project.pbxproj b/proj/xc11/BoE.xcodeproj/project.pbxproj index 5d38b0f8..98f59ac5 100755 --- a/proj/xc11/BoE.xcodeproj/project.pbxproj +++ b/proj/xc11/BoE.xcodeproj/project.pbxproj @@ -164,7 +164,6 @@ 91B3EF590F969F3000BF5B67 /* scen.townout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B3EEF40F969BA700BF5B67 /* scen.townout.cpp */; }; 91B3EF5A0F969F3000BF5B67 /* scen.btnmg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B3EEF50F969BA700BF5B67 /* scen.btnmg.cpp */; }; 91B3F1850F97894A00BF5B67 /* scen.graphics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B3EEF30F969BA700BF5B67 /* scen.graphics.cpp */; }; - 91BC33821B4388E80008882C /* libz.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DCCA42011A8C467800E6A9A5 /* libz.1.dylib */; }; 91BC33831B4388E80008882C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 914B2AA118E7E500007B6799 /* Cocoa.framework */; }; 91BC33841B4388E80008882C /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 914B2AA218E7E500007B6799 /* OpenGL.framework */; }; 91BC33981B4481EF0008882C /* scen.fileio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B3EEF20F969BA700BF5B67 /* scen.fileio.cpp */; }; @@ -214,9 +213,12 @@ 91FCC8F418FF0866007026CE /* pc.appleevents.mm in Sources */ = {isa = PBXBuildFile; fileRef = 91FCC8F318FF069A007026CE /* pc.appleevents.mm */; }; 91FD417423DFC9D4003D5B8A /* boe.ui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91FD417223DFC5C1003D5B8A /* boe.ui.cpp */; }; 91FE0E3823F084B70084CA6B /* drawable_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91FE0E3523F084B70084CA6B /* drawable_manager.cpp */; }; - DCCA42021A8C467800E6A9A5 /* libz.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DCCA42011A8C467800E6A9A5 /* libz.1.dylib */; }; - DCCA42031A8C469400E6A9A5 /* libz.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DCCA42011A8C467800E6A9A5 /* libz.1.dylib */; }; - DCCA42051A8C46B500E6A9A5 /* libz.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = DCCA42011A8C467800E6A9A5 /* libz.1.dylib */; }; + E23F5D6D26FF4D5D00B3AE0C /* libzlib.1.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E23F5D6C26FF4D5D00B3AE0C /* libzlib.1.2.dylib */; }; + E23F5D6E26FF4D5D00B3AE0C /* libzlib.1.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E23F5D6C26FF4D5D00B3AE0C /* libzlib.1.2.dylib */; }; + E23F5D6F26FF4D5D00B3AE0C /* libzlib.1.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E23F5D6C26FF4D5D00B3AE0C /* libzlib.1.2.dylib */; }; + E23F5D7026FF4D5E00B3AE0C /* libzlib.1.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E23F5D6C26FF4D5D00B3AE0C /* libzlib.1.2.dylib */; }; + E23F5D7126FF4D5E00B3AE0C /* libzlib.1.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E23F5D6C26FF4D5D00B3AE0C /* libzlib.1.2.dylib */; }; + E23F5D872707291E00B3AE0C /* universe.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91AC61C50FA2729900EEAE67 /* universe.cpp */; }; E2513E862453439C0066C6B1 /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2513E7F2453439B0066C6B1 /* OpenAL.framework */; }; E2513E872453439C0066C6B1 /* ogg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2513E802453439B0066C6B1 /* ogg.framework */; }; E2513E882453439C0066C6B1 /* FLAC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2513E812453439B0066C6B1 /* FLAC.framework */; }; @@ -252,7 +254,6 @@ E2AE6DB524CC879300792E44 /* libboost_system-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E2AE6DB324CC879300792E44 /* libboost_system-mt.dylib */; }; E2AE6DB624CC879300792E44 /* libboost_system-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E2AE6DB324CC879300792E44 /* libboost_system-mt.dylib */; }; E2AE6DB724CC879300792E44 /* libboost_system-mt.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E2AE6DB324CC879300792E44 /* libboost_system-mt.dylib */; }; - E2AE6DB824CC89EA00792E44 /* libz.1.dylib in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = DCCA42011A8C467800E6A9A5 /* libz.1.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; E2AE6DBB24CC89EA00792E44 /* sfml-audio.framework in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = E2513E8E245343E30066C6B1 /* sfml-audio.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; E2AE6DBC24CC89EA00792E44 /* sfml-graphics.framework in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = E2513E8D245343E30066C6B1 /* sfml-graphics.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; E2AE6DBD24CC89EA00792E44 /* sfml-network.framework in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = E2513E91245343E30066C6B1 /* sfml-network.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; @@ -283,8 +284,6 @@ E2AE6DD624CDB05C00792E44 /* vorbisfile.framework in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = E2513E852453439C0066C6B1 /* vorbisfile.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; E2AE6DD724CDB05C00792E44 /* libboost_filesystem-mt.dylib in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = E2AE6DAE24CC876500792E44 /* libboost_filesystem-mt.dylib */; }; E2AE6DD824CDB05C00792E44 /* libboost_system-mt.dylib in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = E2AE6DB324CC879300792E44 /* libboost_system-mt.dylib */; }; - E2AE6DD924CDB06700792E44 /* libz.1.dylib in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = DCCA42011A8C467800E6A9A5 /* libz.1.dylib */; }; - E2AE6DEA24D489B100792E44 /* libz.1.dylib in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = DCCA42011A8C467800E6A9A5 /* libz.1.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; E2AE6DED24D489B100792E44 /* sfml-audio.framework in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = E2513E8E245343E30066C6B1 /* sfml-audio.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; E2AE6DEE24D489B100792E44 /* sfml-graphics.framework in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = E2513E8D245343E30066C6B1 /* sfml-graphics.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; E2AE6DEF24D489B100792E44 /* sfml-network.framework in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = E2513E91245343E30066C6B1 /* sfml-network.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; @@ -318,6 +317,7 @@ E2B4A69624541D7100857D44 /* sfml-system.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2513E8F245343E30066C6B1 /* sfml-system.framework */; }; E2B4A69724541D7100857D44 /* sfml-window.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2513E90245343E30066C6B1 /* sfml-window.framework */; }; E2B4A69824541D7100857D44 /* SFML.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2513E92245343E40066C6B1 /* SFML.framework */; }; + E2FE7CB127142B07008D567E /* boe.minimap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E2FE7CB027142B07008D567E /* boe.minimap.cpp */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -456,7 +456,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - E2AE6DB824CC89EA00792E44 /* libz.1.dylib in Copy Libraries and Frameworks */, E2AE6DBB24CC89EA00792E44 /* sfml-audio.framework in Copy Libraries and Frameworks */, E2AE6DBC24CC89EA00792E44 /* sfml-graphics.framework in Copy Libraries and Frameworks */, E2AE6DBD24CC89EA00792E44 /* sfml-network.framework in Copy Libraries and Frameworks */, @@ -482,7 +481,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - E2AE6DD924CDB06700792E44 /* libz.1.dylib in Copy Libraries and Frameworks */, E2AE6DCA24CDB05C00792E44 /* sfml-audio.framework in Copy Libraries and Frameworks */, E2AE6DCB24CDB05C00792E44 /* sfml-graphics.framework in Copy Libraries and Frameworks */, E2AE6DCC24CDB05C00792E44 /* sfml-network.framework in Copy Libraries and Frameworks */, @@ -508,7 +506,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - E2AE6DEA24D489B100792E44 /* libz.1.dylib in Copy Libraries and Frameworks */, E2AE6DED24D489B100792E44 /* sfml-audio.framework in Copy Libraries and Frameworks */, E2AE6DEE24D489B100792E44 /* sfml-graphics.framework in Copy Libraries and Frameworks */, E2AE6DEF24D489B100792E44 /* sfml-network.framework in Copy Libraries and Frameworks */, @@ -836,7 +833,7 @@ 91FE0E3623F084B70084CA6B /* drawable_manager.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = drawable_manager.hpp; sourceTree = ""; }; 91FE0E3723F084B70084CA6B /* event_listener.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = event_listener.hpp; sourceTree = ""; }; 91FE0E3B23F084C60084CA6B /* drawable.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = drawable.hpp; sourceTree = ""; }; - DCCA42011A8C467800E6A9A5 /* libz.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.1.dylib; path = /usr/lib/libz.1.dylib; sourceTree = ""; }; + E23F5D6C26FF4D5D00B3AE0C /* libzlib.1.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libzlib.1.2.dylib; sourceTree = ""; }; E2513E7F2453439B0066C6B1 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = /usr/local/SFML/extlibs/OpenAL.framework; sourceTree = ""; }; E2513E802453439B0066C6B1 /* ogg.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ogg.framework; path = /usr/local/SFML/extlibs/ogg.framework; sourceTree = ""; }; E2513E812453439B0066C6B1 /* FLAC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FLAC.framework; path = /usr/local/SFML/extlibs/FLAC.framework; sourceTree = ""; }; @@ -858,9 +855,11 @@ E26D459726FCBBCE007984E6 /* container.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = container.cpp; sourceTree = ""; }; E26D459F26FCBBF4007984E6 /* keycodes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = keycodes.cpp; sourceTree = ""; }; E26D45A026FCBBF4007984E6 /* keycodes.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = keycodes.hpp; sourceTree = ""; }; - E2AE6DAE24CC876500792E44 /* libboost_filesystem-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_filesystem-mt.dylib"; path = "/usr/local/Cellar/boost/1.72.0_3/lib/libboost_filesystem-mt.dylib"; sourceTree = ""; }; - E2AE6DB324CC879300792E44 /* libboost_system-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_system-mt.dylib"; path = "/usr/local/Cellar/boost/1.72.0_3/lib/libboost_system-mt.dylib"; sourceTree = ""; }; + E2AE6DAE24CC876500792E44 /* libboost_filesystem-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_filesystem-mt.dylib"; path = "/usr/local/Cellar/boost/1.75.0_2/lib/libboost_filesystem-mt.dylib"; sourceTree = ""; }; + E2AE6DB324CC879300792E44 /* libboost_system-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_system-mt.dylib"; path = "/usr/local/Cellar/boost/1.75.0_2/lib/libboost_system-mt.dylib"; sourceTree = ""; }; E2DF0BFA2538C031000C7A1A /* texture.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = texture.hpp; sourceTree = ""; }; + E2FE7CB027142B07008D567E /* boe.minimap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = boe.minimap.cpp; sourceTree = ""; }; + E2FE7CB727142B16008D567E /* boe.minimap.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = boe.minimap.hpp; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -870,7 +869,6 @@ files = ( E2513E9B245350180066C6B1 /* sfml-audio.framework in Frameworks */, E2513E9A24534FD40066C6B1 /* SFML.framework in Frameworks */, - DCCA42031A8C469400E6A9A5 /* libz.1.dylib in Frameworks */, E2AE6DAF24CC876500792E44 /* libboost_filesystem-mt.dylib in Frameworks */, E2513E9C245350180066C6B1 /* sfml-graphics.framework in Frameworks */, E2513E9D245350180066C6B1 /* sfml-network.framework in Frameworks */, @@ -880,6 +878,7 @@ 914B2AA618E7E50D007B6799 /* OpenGL.framework in Frameworks */, 911F2D991B98F43B00E3102E /* libCommon.a in Frameworks */, E2513E9F245350180066C6B1 /* sfml-window.framework in Frameworks */, + E23F5D6E26FF4D5D00B3AE0C /* libzlib.1.2.dylib in Frameworks */, 911F2D9E1B98F44700E3102E /* libCommon-Party.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -907,6 +906,7 @@ E2513E892453439C0066C6B1 /* vorbisenc.framework in Frameworks */, E2513E96245343E40066C6B1 /* sfml-window.framework in Frameworks */, E2513E98245343E40066C6B1 /* SFML.framework in Frameworks */, + E23F5D6D26FF4D5D00B3AE0C /* libzlib.1.2.dylib in Frameworks */, E2513E862453439C0066C6B1 /* OpenAL.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -916,7 +916,6 @@ buildActionMask = 2147483647; files = ( E2B4A68A24541C8E00857D44 /* sfml-system.framework in Frameworks */, - DCCA42021A8C467800E6A9A5 /* libz.1.dylib in Frameworks */, 914B2AA418E7E509007B6799 /* Cocoa.framework in Frameworks */, E2AE6DB024CC876500792E44 /* libboost_filesystem-mt.dylib in Frameworks */, 914B2AA718E7E50E007B6799 /* OpenGL.framework in Frameworks */, @@ -927,6 +926,7 @@ 911F2D9A1B98F43C00E3102E /* libCommon.a in Frameworks */, 911F2D9F1B98F44700E3102E /* libCommon-Party.a in Frameworks */, E2B4A68B24541C8E00857D44 /* sfml-window.framework in Frameworks */, + E23F5D6F26FF4D5D00B3AE0C /* libzlib.1.2.dylib in Frameworks */, E2B4A68824541C8E00857D44 /* sfml-graphics.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -935,13 +935,13 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DCCA42051A8C46B500E6A9A5 /* libz.1.dylib in Frameworks */, E2B4A68D24541C8F00857D44 /* sfml-audio.framework in Frameworks */, E2AE6DB124CC876500792E44 /* libboost_filesystem-mt.dylib in Frameworks */, 914B2AA518E7E50A007B6799 /* Cocoa.framework in Frameworks */, 914B2AA818E7E50E007B6799 /* OpenGL.framework in Frameworks */, 911F2D9B1B98F43C00E3102E /* libCommon.a in Frameworks */, E2AE6DB624CC879300792E44 /* libboost_system-mt.dylib in Frameworks */, + E23F5D7026FF4D5E00B3AE0C /* libzlib.1.2.dylib in Frameworks */, E2B4A69124541C8F00857D44 /* sfml-window.framework in Frameworks */, E2B4A69024541C8F00857D44 /* sfml-system.framework in Frameworks */, E2B4A68E24541C8F00857D44 /* sfml-graphics.framework in Frameworks */, @@ -955,7 +955,6 @@ buildActionMask = 2147483647; files = ( E2B4A69624541D7100857D44 /* sfml-system.framework in Frameworks */, - 91BC33821B4388E80008882C /* libz.1.dylib in Frameworks */, E2B4A69324541D7100857D44 /* sfml-audio.framework in Frameworks */, E2B4A69424541D7100857D44 /* sfml-graphics.framework in Frameworks */, E2AE6DB224CC876500792E44 /* libboost_filesystem-mt.dylib in Frameworks */, @@ -966,6 +965,7 @@ E2B4A69724541D7100857D44 /* sfml-window.framework in Frameworks */, 911F2D9C1B98F43C00E3102E /* libCommon.a in Frameworks */, E2B4A69824541D7100857D44 /* SFML.framework in Frameworks */, + E23F5D7126FF4D5E00B3AE0C /* libzlib.1.2.dylib in Frameworks */, 911F2DA01B98F44700E3102E /* libCommon-Party.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1116,7 +1116,7 @@ 914B2AA018E7E4A3007B6799 /* Linked Frameworks */ = { isa = PBXGroup; children = ( - DCCA42011A8C467800E6A9A5 /* libz.1.dylib */, + E23F5D6C26FF4D5D00B3AE0C /* libzlib.1.2.dylib */, 914B2AA118E7E500007B6799 /* Cocoa.framework */, 914B2AA218E7E500007B6799 /* OpenGL.framework */, E2513E8E245343E30066C6B1 /* sfml-audio.framework */, @@ -1521,6 +1521,7 @@ 2BF04AFA0BF51924006C0831 /* boe.locutils.cpp */, 2BF04ACB0BF51923006C0831 /* boe.main.cpp */, 912DFE8E18E2872300B00D75 /* boe.menus.mac.mm */, + E2FE7CB027142B07008D567E /* boe.minimap.cpp */, 2BF04AFC0BF51924006C0831 /* boe.monster.cpp */, 2BF04AFE0BF51924006C0831 /* boe.newgraph.cpp */, 2BF04B000BF51924006C0831 /* boe.party.cpp */, @@ -1550,6 +1551,7 @@ 2BF04AFB0BF51924006C0831 /* boe.locutils.hpp */, 2BF04ACC0BF51923006C0831 /* boe.main.hpp */, 9191460118E6591F005CF3A4 /* boe.menus.hpp */, + E2FE7CB727142B16008D567E /* boe.minimap.hpp */, 2BF04AFD0BF51924006C0831 /* boe.monster.hpp */, 2BF04AFF0BF51924006C0831 /* boe.newgraph.hpp */, 2BF04B010BF51924006C0831 /* boe.party.hpp */, @@ -1938,6 +1940,7 @@ 2BF04B1C0BF51924006C0831 /* boe.combat.cpp in Sources */, 2BF04B1D0BF51924006C0831 /* boe.dlgutil.cpp in Sources */, 2BF04B230BF51924006C0831 /* boe.infodlg.cpp in Sources */, + E2FE7CB127142B07008D567E /* boe.minimap.cpp in Sources */, 2BF04B250BF51924006C0831 /* boe.items.cpp in Sources */, 2BF04B260BF51924006C0831 /* boe.locutils.cpp in Sources */, 2BF04B270BF51924006C0831 /* boe.monster.cpp in Sources */, @@ -2105,6 +2108,7 @@ 91E128E61BC19DA400C8BE1D /* init.cpp in Sources */, 9176FEC71D550EFE006EF694 /* out_legacy.cpp in Sources */, 9176FEC81D550EFE006EF694 /* scen_legacy.cpp in Sources */, + E23F5D872707291E00B3AE0C /* universe.cpp in Sources */, 9176FECB1D550EFE006EF694 /* talk_legacy.cpp in Sources */, 9176FECC1D550EFE006EF694 /* town_legacy.cpp in Sources */, 91C548F81D8B2FE400FE6A7B /* pc_read.cpp in Sources */, @@ -2228,7 +2232,7 @@ HEADER_SEARCH_PATHS = ( /opt/local/include, /usr/local/SFML/include, - /usr/local/Cellar/boost/1.72.0_3/include/, + /usr/local/Cellar/boost/1.75.0_2/include/, ); LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -2303,7 +2307,7 @@ HEADER_SEARCH_PATHS = ( /opt/local/include, /usr/local/SFML/include, - /usr/local/Cellar/boost/1.72.0_3/include/, + /usr/local/Cellar/boost/1.75.0_2/include/, ); LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks"; LIBRARY_SEARCH_PATHS = ( @@ -2356,7 +2360,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - /usr/local/Cellar/boost/1.72.0_3/lib, + /usr/local/Cellar/boost/1.75.0_2/lib, ); OTHER_LDFLAGS = ( "-lboost_system-mt", @@ -2387,7 +2391,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - /usr/local/Cellar/boost/1.72.0_3/lib, + /usr/local/Cellar/boost/1.75.0_2/lib, ); OTHER_LDFLAGS = ( "-lboost_system-mt", @@ -2465,6 +2469,10 @@ "DEBUG=1", "$(inherited)", ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -2480,6 +2488,10 @@ /usr/local/SFML/extlibs, /usr/local/SFML/Frameworks, ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -2499,7 +2511,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - /usr/local/Cellar/boost/1.72.0_3/lib, + /usr/local/Cellar/boost/1.75.0_2/lib, ); OTHER_LDFLAGS = ( "-lboost_system", @@ -2527,7 +2539,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - /usr/local/Cellar/boost/1.72.0_3/lib, + /usr/local/Cellar/boost/1.75.0_2/lib, ); OTHER_LDFLAGS = ( "-lboost_system", @@ -2555,7 +2567,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - /usr/local/Cellar/boost/1.72.0_3/lib, + /usr/local/Cellar/boost/1.75.0_2/lib, ); OTHER_LDFLAGS = ( "-lboost_system", @@ -2584,7 +2596,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - /usr/local/Cellar/boost/1.72.0_3/lib, + /usr/local/Cellar/boost/1.75.0_2/lib, ); OTHER_LDFLAGS = ( "-lboost_system", @@ -2612,7 +2624,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - /usr/local/Cellar/boost/1.72.0_3/lib, + /usr/local/Cellar/boost/1.75.0_2/lib, ); OTHER_LDFLAGS = ( "-lboost_system", @@ -2633,7 +2645,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - /usr/local/Cellar/boost/1.72.0_3/lib, + /usr/local/Cellar/boost/1.75.0_2/lib, ); PRODUCT_NAME = "$(TARGET_NAME)"; }; diff --git a/src/game/boe.actions.cpp b/src/game/boe.actions.cpp index adda44aa..a78ecc95 100644 --- a/src/game/boe.actions.cpp +++ b/src/game/boe.actions.cpp @@ -12,6 +12,7 @@ #include "boe.fileio.hpp" #include "boe.dlgutil.hpp" #include "boe.locutils.hpp" +#include "boe.minimap.hpp" #include "boe.town.hpp" #include "boe.text.hpp" #include "boe.party.hpp" @@ -98,9 +99,6 @@ extern location center; extern short combat_active_pc; extern eStatMode stat_screen_mode; -extern bool map_visible; -extern sf::RenderWindow mini_map; - extern std::shared_ptr text_sbar,item_sbar,shop_sbar; extern short shop_identify_cost; @@ -1107,7 +1105,7 @@ bool handle_action(const sf::Event& event) { case TOOLBAR_SCROLL: case TOOLBAR_MAP: if(overall_mode == MODE_OUTDOORS || overall_mode == MODE_TOWN) - display_map(); + minimap::set_visible(true); break; case TOOLBAR_BAG: case TOOLBAR_HAND: @@ -1442,7 +1440,6 @@ static void advance_time(bool did_something, bool need_redraw, bool need_reprint } void handle_monster_actions(bool& need_redraw, bool& need_reprint) { - draw_map(true); play_ambient_sound(); if(is_combat() && overall_mode != MODE_LOOK_COMBAT) { @@ -1600,9 +1597,8 @@ bool handle_keystroke(const sf::Event& event){ obscureCursor(); return false; } - if(map_visible && (overall_mode != MODE_TALKING) && (overall_mode != MODE_SHOPPING)) { - mini_map.setVisible(false); - map_visible = false; + if(minimap::is_visible() && (overall_mode != MODE_TALKING) && (overall_mode != MODE_SHOPPING)) { + minimap::set_visible(false); mainPtr.setActive(); return false; } @@ -1836,7 +1832,7 @@ bool handle_keystroke(const sf::Event& event){ univ.party.end_split(0); overall_mode = MODE_OUTDOORS; position_party(univ.party.outdoor_corner.x,univ.party.outdoor_corner.y,univ.party.out_loc.x,univ.party.out_loc.y); - clear_map(); + minimap::draw(true); add_string_to_buf("Debug: Reunite party and leave town."); print_buf(); redraw_screen(REFRESH_ALL); @@ -1964,7 +1960,7 @@ bool handle_keystroke(const sf::Event& event){ for(short j = 0; j < 64; j++) make_explored(i,j); } - clear_map(); + minimap::draw(true); add_string_to_buf("Debug: Magic Map."); print_buf(); break; @@ -2044,7 +2040,7 @@ bool handle_keystroke(const sf::Event& event){ break; case 'a': // Show automap if(overall_mode == MODE_TOWN || overall_mode == MODE_OUTDOORS) - display_map(); + minimap::set_visible(true); break; case 'u': // Use space @@ -2217,7 +2213,6 @@ void post_load() { print_buf(); - clear_map(); adjust_spell_menus(); adjust_monst_menu(); } @@ -2919,7 +2914,7 @@ bool outd_move_party(location destination,bool forced) { if((store_corner.x != univ.party.outdoor_corner.x) || (store_corner.y != univ.party.outdoor_corner.y) || (store_iwc.x != univ.party.i_w_c.x) || (store_iwc.y != univ.party.i_w_c.y)) - clear_map(); + minimap::add_pending_redraw(); return true; } @@ -2941,7 +2936,7 @@ bool outd_move_party(location destination,bool forced) { if((store_corner.x != univ.party.outdoor_corner.x) || (store_corner.y != univ.party.outdoor_corner.y) || (store_iwc.x != univ.party.i_w_c.x) || (store_iwc.y != univ.party.i_w_c.y)) - clear_map(); + minimap::add_pending_redraw(); return true; } @@ -2987,7 +2982,7 @@ bool outd_move_party(location destination,bool forced) { if((store_corner.x != univ.party.outdoor_corner.x) || (store_corner.y != univ.party.outdoor_corner.y) || (store_iwc.x != univ.party.i_w_c.x) || (store_iwc.y != univ.party.i_w_c.y)) - clear_map(); + minimap::add_pending_redraw(); return true; } diff --git a/src/game/boe.dlgutil.cpp b/src/game/boe.dlgutil.cpp index 435c16e6..fb1d855c 100644 --- a/src/game/boe.dlgutil.cpp +++ b/src/game/boe.dlgutil.cpp @@ -51,7 +51,6 @@ extern long ed_flag,ed_key; extern location center; extern std::shared_ptr text_sbar,item_sbar,shop_sbar; extern std::shared_ptr done_btn, help_btn; -extern bool map_visible; extern cUniverse univ; extern sf::Texture pc_gworld; extern std::map skill_max; diff --git a/src/game/boe.fileio.cpp b/src/game/boe.fileio.cpp index 9f408780..5106b6bf 100644 --- a/src/game/boe.fileio.cpp +++ b/src/game/boe.fileio.cpp @@ -5,6 +5,7 @@ #include "boe.global.hpp" #include "universe.hpp" #include "boe.fileio.hpp" +#include "boe.minimap.hpp" #include "boe.text.hpp" #include "boe.town.hpp" #include "boe.items.hpp" @@ -29,8 +30,6 @@ extern bool party_in_memory; extern location center; extern long register_flag; extern sf::RenderWindow mainPtr; -extern bool map_visible; -extern sf::RenderWindow mini_map; extern short which_combat_type; extern short cur_town_talk_loaded; extern cUniverse univ; @@ -116,6 +115,7 @@ void finish_load_party(){ center = univ.party.town_loc; } + minimap::set_visible(false); redraw_screen(REFRESH_ALL); univ.cur_pc = first_active_pc(); loaded_yet = true; diff --git a/src/game/boe.graphics.cpp b/src/game/boe.graphics.cpp index ba99fd6e..587fed85 100644 --- a/src/game/boe.graphics.cpp +++ b/src/game/boe.graphics.cpp @@ -12,6 +12,7 @@ #include "boe.graphics.hpp" #include "boe.newgraph.hpp" #include "boe.graphutil.hpp" +#include "boe.minimap.hpp" #include "boe.monster.hpp" #include "boe.locutils.hpp" #include "boe.text.hpp" @@ -71,8 +72,6 @@ extern short fast_bang; extern tessel_ref_t bg[]; extern cUniverse univ; extern cCustomGraphics spec_scen_g; -extern sf::RenderWindow mini_map; -bool map_visible = false; extern std::string save_talk_str1, save_talk_str2; extern cDrawableManager drawable_mgr; @@ -103,7 +102,6 @@ sf::RenderTexture item_stats_gworld; sf::RenderTexture text_area_gworld; sf::RenderTexture terrain_screen_gworld; sf::RenderTexture text_bar_gworld; -sf::RenderTexture map_gworld; rectangle terrain_screen_rect; rectangle text_area_rect; @@ -462,8 +460,7 @@ void arrow_button_click(rectangle button_rect) { void reload_startup() { - mini_map.setVisible(false); - map_visible = false; + minimap::set_visible(false); mainPtr.setActive(); init_startup(); diff --git a/src/game/boe.items.cpp b/src/game/boe.items.cpp index 982c1ed0..80d1557c 100644 --- a/src/game/boe.items.cpp +++ b/src/game/boe.items.cpp @@ -34,10 +34,7 @@ extern bool boom_anim_active; extern rectangle d_rects[80]; extern short d_rect_index[80]; -extern bool map_visible; -extern sf::RenderWindow mini_map; extern sf::Texture pc_gworld; -extern sf::RenderTexture map_gworld; extern cUniverse univ; short selected; @@ -679,30 +676,6 @@ short get_num_of_items(short max_num) { return minmax(0,max_num,numPanel.getResult()); } -void init_mini_map() { - float ui_scale = get_float_pref("UIMapScale", 1.0); - if (ui_scale < 0.1) ui_scale = 1.0; - if (mini_map.isOpen()) mini_map.close(); - mini_map.create(sf::VideoMode(ui_scale*296,ui_scale*277), "Map", sf::Style::Titlebar | sf::Style::Close); - mini_map.setPosition(sf::Vector2i(52,62)); - sf::View view; - view.reset(sf::FloatRect(0, 0, ui_scale*296,ui_scale*277)); - view.setViewport(sf::FloatRect(0, 0, ui_scale, ui_scale)); - mini_map.setView(view); - mini_map.setVisible(false); - map_visible=false; - setWindowFloating(mini_map, true); - makeFrontWindow(mainPtr); - - // Create and initialize map gworld - if(!map_gworld.create(384, 384)) { - play_sound(2); - throw std::string("Failed to initialized automap!"); - } else { - map_gworld.clear(sf::Color::White); - } -} - void place_glands(location where,mon_num_t m_type) { cItem store_i; cMonster monst; diff --git a/src/game/boe.items.hpp b/src/game/boe.items.hpp index 59a8e21c..0c229e0d 100644 --- a/src/game/boe.items.hpp +++ b/src/game/boe.items.hpp @@ -24,7 +24,6 @@ short custom_choice_dialog(std::array& strs,short pic_num,ePicTy void custom_pic_dialog(std::string title, pic_num_t bigpic); void story_dialog(std::string title, str_num_t first, str_num_t last, eSpecCtxType which_str_type, pic_num_t pic, ePicType pt); short get_num_of_items(short max_num); -void init_mini_map(); void draw_help_dialog_item_buttons(cDialog& dialog,short item); void draw_help_dialog_forcefields(cDialog& dialog,short item); void place_glands(location where,mon_num_t m_type); diff --git a/src/game/boe.locutils.cpp b/src/game/boe.locutils.cpp index eb14b662..89fbfb88 100644 --- a/src/game/boe.locutils.cpp +++ b/src/game/boe.locutils.cpp @@ -1,13 +1,15 @@ #include "mathutil.hpp" -#include "boe.global.hpp" - #include "universe.hpp" -#include "boe.locutils.hpp" -#include "boe.text.hpp" -#include "boe.monster.hpp" #include "utility.hpp" +#include "boe.global.hpp" +#include "boe.locutils.hpp" +#include "boe.minimap.hpp" +#include "boe.monster.hpp" +#include "boe.text.hpp" +#include "boe.town.hpp" + bool combat_pt_in_light(); location obs_sec; location which_party_sec; @@ -29,16 +31,20 @@ bool is_explored(short i,short j) { else return univ.town.is_explored(i,j); } -void make_explored(short i,short j) { - if(is_out()) - univ.out.out_e[i][j] = 1; - else univ.town.set_explored(i,j,true); -} - -void take_explored(short i,short j) { - if(is_out()) - univ.out.out_e[i][j] = 0; - else univ.town.set_explored(i,j,false); +void make_explored(short i,short j, short val) { + if(is_out()) { + if (univ.out.out_e[i][j] != val) { + minimap::add_pending_redraw(); + univ.out.out_e[i][j] = val; + } + } + else { + bool bVal=bool(val); + if (bool(univ.town.is_explored(i,j)) != bVal) { + minimap::add_pending_redraw(); + univ.town.set_explored(i,j,bVal); + } + } } bool is_out() { @@ -237,34 +243,31 @@ bool is_container(location loc) { void update_explored(location dest) { if(cartoon_happening) return; - location shortdest,look; - - location look2; - - shortdest.x = (short) dest.x; - shortdest.y = (short) dest.y; - - which_party_sec.x = univ.party.outdoor_corner.x + univ.party.i_w_c.x; - which_party_sec.y = univ.party.outdoor_corner.y + univ.party.i_w_c.y; if(is_out()) { - univ.out.out_e[dest.x][dest.y] = 2; + location shortdest((short) dest.x,(short) dest.y); + + which_party_sec.x = univ.party.outdoor_corner.x + univ.party.i_w_c.x; + which_party_sec.y = univ.party.outdoor_corner.y + univ.party.i_w_c.y; + make_explored(dest.x,dest.y,2); + + location look; for(look.x = shortdest.x - 4; look.x < shortdest.x + 5; look.x++) for(look.y = shortdest.y - 4; look.y < shortdest.y + 5; look.y++) { // TODO: Windows had an extra check, is this needed? //if((look.x == minmax(0,95,(int)look.x)) && (look.y == minmax(0,95,(int)look.y))) { - if(look.x>=0 && look.y>=0 && look.x<96 && look.y<96 && univ.out.out_e[look.x][look.y] == 0) + if(look.x>=0 && look.y>=0 && look.x<96 && look.y<96 && univ.out.out_e[look.x][look.y] == 0) { if(can_see_light(shortdest, look, sight_obscurity) < 5) - univ.out.out_e[look.x][look.y] = 1; - //} + make_explored(look.x, look.y); + } } } else { make_explored(dest.x,dest.y); + location look2; for(look2.x = max(0,dest.x - 4); look2.x < min(univ.town->max_dim,dest.x + 5); look2.x++) for(look2.y = max(0,dest.y - 4); look2.y < min(univ.town->max_dim,dest.y + 5); look2.y++) - if(!is_explored(look2.x,look2.y)) - if((can_see_light(dest, look2,sight_obscurity) < 5) && (pt_in_light(dest,look2))) - make_explored(look2.x,look2.y); + if(!is_explored(look2.x,look2.y) && can_see_light(dest, look2,sight_obscurity) < 5 && pt_in_light(dest,look2)) + make_explored(look2.x,look2.y); } } diff --git a/src/game/boe.locutils.hpp b/src/game/boe.locutils.hpp index ecf6e0c5..72700e44 100644 --- a/src/game/boe.locutils.hpp +++ b/src/game/boe.locutils.hpp @@ -3,8 +3,7 @@ #include "location.hpp" bool is_explored(short i,short j); -void make_explored(short i,short j); -void take_explored(short i,short j); +void make_explored(short i,short j, short val=1); bool is_out(); bool is_town(); bool is_combat(); diff --git a/src/game/boe.main.cpp b/src/game/boe.main.cpp index dad35d2f..7100cea3 100644 --- a/src/game/boe.main.cpp +++ b/src/game/boe.main.cpp @@ -7,6 +7,7 @@ #include #include #include "boe.graphics.hpp" +#include "boe.minimap.hpp" #include "boe.newgraph.hpp" #include "boe.fileio.hpp" #include "boe.actions.hpp" @@ -59,7 +60,6 @@ long start_time; short on_spell_menu[2][62]; short on_monst_menu[256]; -extern bool map_visible; extern sf::View mainView; extern rectangle shop_frame; @@ -78,7 +78,6 @@ eItemWinMode stat_window = ITEM_WIN_PC1; bool monsters_going = false,boom_anim_active = false; bool finished_init = false; -sf::RenderWindow mini_map; short which_item_page[6] = {0,0,0,0,0,0}; // Remembers which of the 2 item pages pc looked at short current_ground = 0; eStatMode stat_screen_mode; @@ -248,7 +247,7 @@ void init_boe(int argc, char* argv[]) { cPlayer::give_help = give_help; init_fileio(); init_spell_menus(); - init_mini_map(); + minimap::init(); redraw_screen(REFRESH_NONE); showMenuBar(); } @@ -290,24 +289,23 @@ void handle_events() { menuChoiceId=-1; } #endif - while(mainPtr.pollEvent(currentEvent)) { + while(!changed_display_mode && mainPtr.pollEvent(currentEvent)) { need_redraw=true; handle_one_event(currentEvent); + if(!changed_display_mode && minimap::need_redraw()) minimap::draw(true); } // It would be nice to have minimap inside the main game window (we have lots of screen space in fullscreen mode). // Alternatively, minimap could live on its own thread. // But for now we just handle events from both windows on this thread. - while(map_visible && mini_map.pollEvent(currentEvent)) { - need_redraw = true; - handle_one_minimap_event(currentEvent); - } + while(!changed_display_mode && minimap::pollEvent()) + ; // actually, we only check gain focus and close event if(changed_display_mode) { need_redraw = true; changed_display_mode = false; adjust_window_mode(); - init_mini_map(); + minimap::init(); } // Still no idea what this does. It's possible that this does not work at all. @@ -402,23 +400,6 @@ void handle_one_event(const sf::Event& event) { } } -void handle_one_minimap_event(const sf::Event& event) { - if(event.type == sf::Event::Closed) { - mini_map.setVisible(false); - map_visible = false; - } else if(event.type == sf::Event::GainedFocus) { - makeFrontWindow(mainPtr); - } else if(event.type == sf::Event::KeyPressed) { - switch(event.key.code) { - case sf::Keyboard::Escape: - mini_map.setVisible(false); - map_visible = false; - break; - default: break; - } - } -} - static bool update_terrain_animation() { static const long fortyTicks = time_in_ticks(40).asMilliseconds(); @@ -449,7 +430,7 @@ bool update_everything() { void redraw_everything() { redraw_screen(REFRESH_ALL); - if(map_visible) draw_map(false); + minimap::draw(false); } void Mouse_Pressed(const sf::Event& event) { @@ -682,7 +663,8 @@ void handle_menu_choice(eMenu item_hit) { if(!prime_time()) { ASB("Finish what you're doing first."); print_buf(); - } else display_map(); + } else + minimap::set_visible(true); set_cursor(sword_curs); break; case eMenu::HELP_TOC: diff --git a/src/game/boe.main.hpp b/src/game/boe.main.hpp index c985b2b3..dc25f5bb 100644 --- a/src/game/boe.main.hpp +++ b/src/game/boe.main.hpp @@ -21,5 +21,4 @@ void show_logo(); void plop_fancy_startup(); void handle_events(); void handle_one_event(const sf::Event&); -void handle_one_minimap_event(const sf::Event &); diff --git a/src/game/boe.minimap.cpp b/src/game/boe.minimap.cpp new file mode 100644 index 00000000..55268761 --- /dev/null +++ b/src/game/boe.minimap.cpp @@ -0,0 +1,367 @@ +// +// boe.minimap.cpp +// Blades of Exile +// +// Created by alonso on 10/10/2021. +// + +#include +#include + +#include "cursors.hpp" +#include "gfxsheets.hpp" +#include "pict.hpp" +#include "prefs.hpp" +#include "render_image.hpp" +#include "render_shapes.hpp" +#include "render_text.hpp" +#include "res_image.hpp" +#include "sounds.hpp" +#include "tiling.hpp" +#include "universe.hpp" +#include "winutil.hpp" + +#include "boe.minimap.hpp" + +#include "boe.consts.hpp" +#include "boe.infodlg.hpp" +#include "boe.locutils.hpp" + +extern eGameMode overall_mode, store_pre_shop_mode, store_pre_talk_mode; +extern short which_combat_type; +extern cUniverse univ; + +extern sf::RenderWindow mainPtr; +extern cCustomGraphics spec_scen_g; + +namespace minimap { +bool visible=false; +bool changed=false; +sf::RenderWindow windows; +sf::RenderTexture gworld; + +void init() { + float ui_scale = get_float_pref("UIMapScale", 1.0); + if (ui_scale < 0.1) ui_scale = 1.0; + if (windows.isOpen()) windows.close(); + windows.create(sf::VideoMode(ui_scale*296,ui_scale*277), "Map", sf::Style::Titlebar | sf::Style::Close); + windows.setPosition(sf::Vector2i(52,62)); + sf::View view; + view.reset(sf::FloatRect(0, 0, ui_scale*296,ui_scale*277)); + view.setViewport(sf::FloatRect(0, 0, ui_scale, ui_scale)); + windows.setView(view); + windows.setVisible(false); + visible=false; + setWindowFloating(windows, true); + makeFrontWindow(mainPtr); + + // Create and initialize map gworld + if(!gworld.create(384, 384)) { + play_sound(2); + throw std::string("Failed to initialized automap!"); + } else { + gworld.clear(sf::Color::White); + } +} + +bool need_redraw() +{ + return visible && changed; +} + +void add_pending_redraw() +{ + if (visible) + changed = true; +} + +bool is_visible() +{ + return visible; +} + +void set_visible(bool vis) +{ + if (visible==vis) + return; + if (vis) { + give_help(62,0); + + rectangle the_rect; + rectangle dlogpicrect = {6,6,42,42}; + + windows.setVisible(true); + visible = true; + draw(true); + makeFrontWindow(mainPtr); + + set_cursor(sword_curs); + } + else { + visible=false; + windows.setVisible(false); + } +} + +void draw(bool need_refresh) { + if (changed) { + need_refresh=true; + changed = false; + } + if(!visible) return; + pic_num_t pic; + rectangle the_rect; + location where; + location kludge; + rectangle draw_rect,orig_draw_rect = {0,0,6,6},ter_temp_from,base_source_rect = {0,0,12,12}; + rectangle dlogpicrect = {6,6,42,42}; + bool draw_pcs = true,out_mode; + rectangle view_rect= {0,0,48,48},tiny_rect = {0,0,32,32}, + redraw_rect = {0,0,48,48},big_rect = {0,0,64,64}; // Rectangle visible in view screen + + rectangle area_to_draw_from,area_to_draw_on = {29,47,269,287}; + ter_num_t what_ter; + bool draw_surroundings = false,expl; + short total_size = 48; // if full redraw, use this to figure out everything + rectangle custom_from; + + draw_surroundings = true; + + // view rect is rect that is visible, redraw rect is area to redraw now + // area_to_draw_from is final draw from rect + // area_to_draw_on is final draw to rect + // extern short store_pre_shop_mode,store_pre_talk_mode; + if(is_out() || (is_combat() && which_combat_type == 0) || + (overall_mode == MODE_TALKING && store_pre_talk_mode == MODE_OUTDOORS) || + (overall_mode == MODE_SHOPPING && store_pre_shop_mode == MODE_OUTDOORS)) { + view_rect.left = minmax(0,8,univ.party.loc_in_sec.x - 20); + view_rect.right = view_rect.left + 40; + view_rect.top = minmax(0,8,univ.party.loc_in_sec.y - 20); + view_rect.bottom = view_rect.top + 40; + redraw_rect = view_rect; + } + else { + total_size = univ.town->max_dim; + switch(total_size) { + case 64: + view_rect.left = minmax(0,24,univ.party.town_loc.x - 20); + view_rect.right = view_rect.left + 40; + view_rect.top = minmax(0,24,univ.party.town_loc.y - 20); + view_rect.bottom = view_rect.top + 40; + redraw_rect = big_rect; + break; + case 48: + view_rect.left = minmax(0,8,univ.party.town_loc.x - 20); + view_rect.right = view_rect.left + 40; + view_rect.top = minmax(0,8,univ.party.town_loc.y - 20); + view_rect.bottom = view_rect.top + 40; + redraw_rect = view_rect; + break; + case 32: + view_rect = tiny_rect; + redraw_rect = view_rect; + break; + } + } + if((is_out()) || ((is_combat()) && (which_combat_type == 0)) || + ((overall_mode == MODE_TALKING) && (store_pre_talk_mode == MODE_OUTDOORS)) || + ((overall_mode == MODE_SHOPPING) && (store_pre_shop_mode == MODE_OUTDOORS)) || + is_town() || is_combat()) { + area_to_draw_from = view_rect; + area_to_draw_from.width() = 40; + area_to_draw_from.height() = 40; + area_to_draw_from.left *= 6; + area_to_draw_from.right *= 6; + area_to_draw_from.top *= 6; + area_to_draw_from.bottom *= 6; + } + + if(is_combat()) + draw_pcs = false; + + const char* title_string = "Your map:"; + bool canMap = true; + + if((is_combat()) && (which_combat_type == 0)) { + title_string = "No map in combat."; + canMap = false; + }else if((is_town() && univ.town->defy_mapping)) { + title_string = "This place defies mapping."; + canMap = false; + } + else if(need_refresh) { + rectangle map_world_rect = rectangle(gworld); + gworld.setActive(); + + fill_rect(gworld, map_world_rect, sf::Color::Black); + + // Now, if shopping or talking, just don't touch anything. + if((overall_mode == MODE_SHOPPING) || (overall_mode == MODE_TALKING)) + redraw_rect.right = -1; + + if((is_out()) || + ((is_combat()) && (which_combat_type == 0)) || + ((overall_mode == MODE_TALKING) && (store_pre_talk_mode == MODE_OUTDOORS)) || + ((overall_mode == MODE_SHOPPING) && (store_pre_shop_mode == MODE_OUTDOORS))) + out_mode = true; + else out_mode = false; + + // TODO: It could be possible to draw the entire map here and then only refresh if a spot actually changes terrain type + auto const & small_ter_gworld = *ResMgr::textures.get("termap"); + for(where.x = redraw_rect.left; where.x < redraw_rect.right; where.x++) + for(where.y = redraw_rect.top; where.y < redraw_rect.bottom; where.y++) { + draw_rect = orig_draw_rect; + draw_rect.offset(6 * where.x, 6 * where.y); + + if(out_mode) + what_ter = univ.out[where.x + 48 * univ.party.i_w_c.x][where.y + 48 * univ.party.i_w_c.y]; + else what_ter = univ.town->terrain(where.x,where.y); + + ter_temp_from = base_source_rect; + + if(out_mode) + expl = univ.out.out_e[where.x + 48 * univ.party.i_w_c.x][where.y + 48 * univ.party.i_w_c.y]; + else expl = is_explored(where.x,where.y); + + if(expl != 0) { + pic = univ.scenario.ter_types[what_ter].map_pic; + bool drawLargeIcon = false; + if(pic == NO_PIC) { + pic = univ.scenario.ter_types[what_ter].picture; + drawLargeIcon = true; + } + if(pic >= 1000) { + if(spec_scen_g) { + //print_nums(0,99,pic); + Texture src_gw; + if(drawLargeIcon) { + pic = pic % 1000; + std::tie(src_gw,custom_from) = spec_scen_g.find_graphic(pic); + rect_draw_some_item(src_gw,custom_from,gworld,draw_rect); + } else { + std::tie(src_gw,custom_from) = spec_scen_g.find_graphic(pic % 1000); + custom_from.right = custom_from.left + 12; + custom_from.bottom = custom_from.top + 12; + pic /= 1000; pic--; + custom_from.offset((pic / 3) * 12, (pic % 3) * 12); + rect_draw_some_item(src_gw,custom_from, gworld, draw_rect); + } + } + } else if(drawLargeIcon) { + if(pic >= 960) { + custom_from = calc_rect(4 * ((pic - 960) / 5),(pic - 960) % 5); + rect_draw_some_item(*ResMgr::textures.get("teranim"), custom_from, gworld, draw_rect); + } else { + int which_sheet = pic / 50; + auto const &src_gw = *ResMgr::textures.get("ter" + std::to_string(1 + which_sheet)); + pic %= 50; + custom_from = calc_rect(pic % 10, pic / 10); + rect_draw_some_item(src_gw, custom_from, gworld, draw_rect); + } + } else { + if(univ.scenario.ter_types[what_ter].picture < 960) + ter_temp_from.offset(12 * (univ.scenario.ter_types[what_ter].picture % 20), + 12 * (univ.scenario.ter_types[what_ter].picture / 20)); + else ter_temp_from.offset(12 * 20, + 12 * (univ.scenario.ter_types[what_ter].picture - 960)); + rect_draw_some_item(small_ter_gworld,ter_temp_from,gworld,draw_rect); + } + + if(is_out() ? univ.out->roads[where.x][where.y] : univ.town.is_road(where.x,where.y)) { + draw_rect.inset(1,1); + rect_draw_some_item(*ResMgr::textures.get("trim"),{8,112,12,116},gworld,draw_rect); + } + } + } + + gworld.display(); + } + + windows.setActive(false); + + // Now place terrain map gworld + TextStyle style; + style.font = FONT_BOLD; + style.pointSize = 10;; + + the_rect = rectangle(windows); + tileImage(windows, the_rect,bg[4]); + cPict theGraphic(windows); + theGraphic.setBounds(dlogpicrect); + theGraphic.setPict(21, PIC_DLOG); + theGraphic.setFormat(TXT_FRAME, FRM_NONE); + theGraphic.draw(); + style.colour = sf::Color::White; + style.lineHeight = 12; + rectangle const map_title_rect = {3,50,15,300}; + rectangle const map_bar_rect = {15,50,27,300}; + win_draw_string(windows, map_title_rect,title_string,eTextMode::WRAP,style); + win_draw_string(windows, map_bar_rect,"(Hit Escape to close.)",eTextMode::WRAP,style); + + if(canMap) { + rect_draw_some_item(gworld.getTexture(),area_to_draw_from,windows,area_to_draw_on); + + // Now place PCs and monsters + if(draw_pcs) { + if((is_town()) && (univ.party.status[ePartyStatus::DETECT_LIFE] > 0)) + for(short i = 0; i < univ.town.monst.size(); i++) + if(univ.town.monst[i].active > 0) { + where = univ.town.monst[i].cur_loc; + if((is_explored(where.x,where.y)) && + ((where.x >= view_rect.left) && (where.x < view_rect.right) + && where.y >= view_rect.top && where.y < view_rect.bottom)){ + + draw_rect.left = area_to_draw_on.left + 6 * (where.x - view_rect.left); + draw_rect.top = area_to_draw_on.top + 6 * (where.y - view_rect.top); + draw_rect.right = draw_rect.left + 6; + draw_rect.bottom = draw_rect.top + 6; + + fill_rect(windows, draw_rect, Colours::GREEN); + frame_circle(windows, draw_rect, Colours::BLUE); + } + } + if((overall_mode != MODE_SHOPPING) && (overall_mode != MODE_TALKING)) { + where = (is_town()) ? univ.party.town_loc : global_to_local(univ.party.out_loc); + + draw_rect.left = area_to_draw_on.left + 6 * (where.x - view_rect.left); + draw_rect.top = area_to_draw_on.top + 6 * (where.y - view_rect.top); + draw_rect.right = draw_rect.left + 6; + draw_rect.bottom = draw_rect.top + 6; + fill_rect(windows, draw_rect, Colours::RED); + frame_circle(windows, draw_rect, sf::Color::Black); + + } + } + } + windows.setActive(); + windows.display(); + + // Now exit gracefully + mainPtr.setActive(); +} + +bool pollEvent() +{ + if (!visible) + return false; + + sf::Event event; + if (!windows.pollEvent(event)) + return false; + if(event.type == sf::Event::Closed) + set_visible(false); + else if(event.type == sf::Event::GainedFocus) + makeFrontWindow(mainPtr); + else if(event.type == sf::Event::KeyPressed) { + switch(event.key.code) { + case sf::Keyboard::Escape: + set_visible(false); + break; + default: break; + } + } + + return true; +} + +} diff --git a/src/game/boe.minimap.hpp b/src/game/boe.minimap.hpp new file mode 100644 index 00000000..472fd646 --- /dev/null +++ b/src/game/boe.minimap.hpp @@ -0,0 +1,23 @@ +// +// boe.minimap.hpp +// Blades of Exile +// +// Created by alonso on 10/10/2021. +// + +#ifndef boe_minimap_hpp +#define boe_minimap_hpp + +namespace minimap { + void init(); // create the map world + bool is_visible(); + void set_visible(bool visible); // set the map windows visible/hidden + + void draw(bool need_refresh); // redraw the map content, if need_refresh recompute it + + bool need_redraw(); + void add_pending_redraw(); + + bool pollEvent(); +} +#endif /* boe_minimap_hpp */ diff --git a/src/game/boe.party.cpp b/src/game/boe.party.cpp index 3ee62a19..e63ceb44 100644 --- a/src/game/boe.party.cpp +++ b/src/game/boe.party.cpp @@ -19,6 +19,7 @@ #include #include #include "boe.party.hpp" +#include "boe.minimap.hpp" #include "boe.monster.hpp" #include "boe.town.hpp" #include "boe.combat.hpp" @@ -602,7 +603,6 @@ void do_mage_spell(short pc_num,eSpell spell_num,bool freebie) { for(where.y = 0; where.y < 64; where.y++) if(dist(where,univ.party.town_loc) <= 2) make_explored(where.x,where.y); - clear_map(); break; case eSpell::SUMMON_BEAST: @@ -703,7 +703,6 @@ void do_mage_spell(short pc_num,eSpell spell_num,bool freebie) { for(short i = 0; i < 64; i++) for(short j = 0; j < 64; j++) make_explored(i,j); - clear_map(); } break; } @@ -880,7 +879,7 @@ void do_priest_spell(short pc_num,eSpell spell_num,bool freebie) { case eSpell::DETECT_LIFE: add_string_to_buf(" Monsters now on map."); univ.party.status[ePartyStatus::DETECT_LIFE] += 6 + get_ran(1,0,6); - clear_map(); + minimap::draw(false); if(!freebie) univ.party[pc_num].cur_sp -= (*spell_num).cost; break; diff --git a/src/game/boe.specials.cpp b/src/game/boe.specials.cpp index 28ccebf0..d47a2c3d 100644 --- a/src/game/boe.specials.cpp +++ b/src/game/boe.specials.cpp @@ -1,36 +1,37 @@ +#include #include #include #include #include -#include "boe.global.hpp" - -#include "universe.hpp" -#include "boe.party.hpp" -#include "boe.town.hpp" -#include "boe.text.hpp" -#include "boe.infodlg.hpp" -#include "boe.items.hpp" -#include "boe.combat.hpp" -#include "boe.monster.hpp" -#include "boe.locutils.hpp" -#include "boe.actions.hpp" -#include "sounds.hpp" -#include "boe.townspec.hpp" -#include "boe.graphics.hpp" -#include "boe.fileio.hpp" -#include "boe.specials.hpp" -#include "boe.newgraph.hpp" -#include "boe.dlgutil.hpp" #include "mathutil.hpp" -#include "boe.main.hpp" #include "strdlog.hpp" #include "choicedlog.hpp" #include "fileio.hpp" -#include #include "spell.hpp" +#include "sounds.hpp" +#include "universe.hpp" + +#include "boe.actions.hpp" +#include "boe.combat.hpp" +#include "boe.fileio.hpp" +#include "boe.global.hpp" +#include "boe.graphics.hpp" +#include "boe.infodlg.hpp" +#include "boe.items.hpp" +#include "boe.locutils.hpp" +#include "boe.main.hpp" #include "boe.menus.hpp" +#include "boe.minimap.hpp" +#include "boe.monster.hpp" +#include "boe.newgraph.hpp" +#include "boe.party.hpp" +#include "boe.text.hpp" +#include "boe.town.hpp" +#include "boe.townspec.hpp" +#include "boe.specials.hpp" +#include "boe.dlgutil.hpp" extern sf::RenderWindow mainPtr; extern eGameMode overall_mode; @@ -44,7 +45,6 @@ extern cOutdoors::cWandering store_wandering_special; extern eSpell spell_being_cast, town_spell; extern eSpecCtxType spec_target_type; extern short spell_caster, spec_target_fail, spec_target_options; -extern sf::RenderWindow mini_map; extern short fast_bang; extern bool end_scenario; extern cUniverse univ; @@ -1375,7 +1375,7 @@ void teleport_party(short x,short y,short mode) { do_explosion_anim(5,2); end_missile_anim(); } - draw_map(true); + minimap::add_pending_redraw(); } @@ -1728,7 +1728,7 @@ void push_things() { univ.party.town_loc = l; update_explored(l); ter = univ.town->terrain(univ.party.town_loc.x,univ.party.town_loc.y); - draw_map(true); + minimap::add_pending_redraw(); if(univ.town.is_barrel(univ.party.town_loc.x,univ.party.town_loc.y)) { univ.town.set_barrel(univ.party.town_loc.x,univ.party.town_loc.y,false); ASB("You smash the barrel."); @@ -1768,7 +1768,7 @@ void push_things() { draw_terrain(0); univ.party[i].combat_pos = l; update_explored(l); - draw_map(true); + minimap::add_pending_redraw(); if(univ.town.is_barrel(univ.party[i].combat_pos.x,univ.party[i].combat_pos.y)) { univ.town.set_barrel(univ.party[i].combat_pos.x,univ.party[i].combat_pos.y,false); ASB("You smash the barrel."); @@ -2340,19 +2340,19 @@ void general_spec(const runtime_state& ctx) { case eSpecType::CHANGE_TER: alter_space(spec.ex1a,spec.ex1b,spec.ex2a); *ctx.redraw = true; - draw_map(true); + minimap::draw(true); check_mess = true; break; case eSpecType::SWAP_TER: swap_ter(spec.ex1a,spec.ex1b,spec.ex2a,spec.ex2b); *ctx.redraw = true; - draw_map(true); + minimap::draw(true); check_mess = true; break; case eSpecType::TRANS_TER: alter_space(spec.ex1a,spec.ex1b,univ.scenario.ter_types[coord_to_ter(spec.ex1a,spec.ex1b)].trans_to_what); *ctx.redraw = true; - draw_map(true); + minimap::draw(true); check_mess = true; break; case eSpecType::ENTER_SHOP: @@ -4329,7 +4329,7 @@ void rect_spec(const runtime_state& ctx){ ctx.next_spec = cur_node.jumpto; *ctx.redraw = true; - bool need_redraw_map=false; + bool minimap_changed=false; for(short i = spec.ex1b;i <= spec.ex2b;i++) for(short j = spec.ex1a; j <= spec.ex2a; j++) { l.x = i; l.y = j; @@ -4413,37 +4413,35 @@ void rect_spec(const runtime_state& ctx){ case eSpecType::RECT_CHANGE_TER: if(get_ran(1,1,100) <= spec.sd2){ alter_space(l.x,l.y,spec.sd1); - *ctx.redraw = need_redraw_map= true; + *ctx.redraw = minimap_changed = true; } break; case eSpecType::RECT_SWAP_TER: swap_ter(l.x,l.y,spec.sd1,spec.sd2); - *ctx.redraw = need_redraw_map= true; + *ctx.redraw = minimap_changed = true; break; case eSpecType::RECT_TRANS_TER: ter = coord_to_ter(i,j); alter_space(l.x,l.y,univ.scenario.ter_types[ter].trans_to_what); - *ctx.redraw = need_redraw_map= true; + *ctx.redraw = minimap_changed = true; break; case eSpecType::RECT_LOCK: ter = coord_to_ter(i,j); if(univ.scenario.ter_types[ter].special == eTerSpec::LOCKABLE){ alter_space(l.x,l.y,univ.scenario.ter_types[ter].flag1); - *ctx.redraw = need_redraw_map= true; + *ctx.redraw = minimap_changed = true; } break; case eSpecType::RECT_UNLOCK: ter = coord_to_ter(i,j); if(univ.scenario.ter_types[ter].special == eTerSpec::UNLOCKABLE){ alter_space(l.x,l.y,univ.scenario.ter_types[ter].flag1); - *ctx.redraw = need_redraw_map= true; + *ctx.redraw = minimap_changed = true; break; } break; case eSpecType::RECT_SET_EXPLORED: - if(spec.sd1) - make_explored(l.x, l.y); - else take_explored(l.x, l.y); + make_explored(l.x, l.y, spec.sd1 ? 1 : 0); break; default: showError("Special node type \"" + (*cur_node.type).name() + "\" is either miscategorized or unimplemented!"); @@ -4451,8 +4449,8 @@ void rect_spec(const runtime_state& ctx){ } } END: - if (need_redraw_map) - draw_map(true); + if (minimap_changed) + minimap::draw(true); if(check_mess) { handle_message(ctx); } diff --git a/src/game/boe.town.cpp b/src/game/boe.town.cpp index 7a71f022..6eaa22a8 100644 --- a/src/game/boe.town.cpp +++ b/src/game/boe.town.cpp @@ -11,6 +11,7 @@ #include "boe.newgraph.hpp" #include "boe.fileio.hpp" #include "boe.items.hpp" +#include "boe.minimap.hpp" #include "boe.monster.hpp" #include "boe.town.hpp" #include "boe.combat.hpp" @@ -40,28 +41,20 @@ extern short store_current_pc,current_ground; extern eGameMode store_pre_shop_mode,store_pre_talk_mode; extern std::queue special_queue; -extern bool map_visible; -extern sf::RenderWindow mini_map; - extern location hor_vert_place[14]; extern location diag_place[14]; extern location golem_m_locs[16]; extern cUniverse univ; extern cCustomGraphics spec_scen_g; -bool need_map_full_refresh = true,forcing_map_button_redraw = false; -extern sf::RenderTexture map_gworld; // In the 0..65535 range, this colour was {65535,65535,52428} sf::Color parchment = {255,255,205}; long pause_dummy; -location town_map_adj; short town_force = 200,store_which_shop,store_min,store_max,store_shop,store_selling_pc; short sell_offset = 0; location town_force_loc; bool shop_button_active[12]; -rectangle map_title_rect = {3,50,15,300}; -rectangle map_bar_rect = {15,50,27,300}; void force_town_enter(short which_town,location where_start) { town_force = which_town; @@ -260,7 +253,7 @@ void start_town_mode(short which_town, short entry_dir) { if((monst.x_width > 1 || monst.y_width > 1) && !monst_can_be_there(monst.cur_loc,i)) monst.active = 0; } - + handle_town_specials(town_number, (short) town_toast,(entry_dir < 9) ? univ.town->start_locs[entry_dir] : town_force_loc); // Set up field booleans, correct for doors @@ -436,12 +429,10 @@ void start_town_mode(short which_town, short entry_dir) { } } - clear_map(); reset_item_max(); town_force = 200; - // TODO: One problem with this - it paints the terrain after the town entry dialog is dismissed - // ... except it actually doesn't, because the town enter special is only queued, not run immediately. draw_terrain(1); + minimap::add_pending_redraw(); } @@ -559,14 +550,11 @@ location end_town_mode(short switching_level,location destination) { // returns update_explored(to_return); redraw_screen(REFRESH_TERRAIN | REFRESH_TEXT); - } - if(!combat_end) - clear_map(); - univ.party.town_num = 200; // should be harmless... - + minimap::add_pending_redraw(); + return to_return; } @@ -1210,251 +1198,6 @@ bool does_location_have_special(cOutdoors& sector, location loc, eTerSpec specia return univ.scenario.ter_types[terrain_index].special == special; } -// TODO: I don't think we need this -void clear_map() { - rectangle map_world_rect(map_gworld); - - fill_rect(map_gworld, map_world_rect, sf::Color::Black); - -} - -void draw_map(bool need_refresh) { - if(!map_visible) return; - pic_num_t pic; - rectangle the_rect,map_world_rect = {0,0,384,384}; - location where; - location kludge; - rectangle draw_rect,orig_draw_rect = {0,0,6,6},ter_temp_from,base_source_rect = {0,0,12,12}; - rectangle dlogpicrect = {6,6,42,42}; - bool draw_pcs = true,out_mode; - rectangle view_rect= {0,0,48,48},tiny_rect = {0,0,32,32}, - redraw_rect = {0,0,48,48},big_rect = {0,0,64,64}; // Rectangle visible in view screen - - rectangle area_to_draw_from,area_to_draw_on = {29,47,269,287}; - ter_num_t what_ter; - bool draw_surroundings = false,expl; - short total_size = 48; // if full redraw, use this to figure out everything - rectangle custom_from; - - draw_surroundings = true; - - town_map_adj.x = 0; - town_map_adj.y = 0; - - // view rect is rect that is visible, redraw rect is area to redraw now - // area_to_draw_from is final draw from rect - // area_to_draw_on is final draw to rect - // extern short store_pre_shop_mode,store_pre_talk_mode; - if((is_out()) || ((is_combat()) && (which_combat_type == 0)) || - ((overall_mode == MODE_TALKING) && (store_pre_talk_mode == MODE_OUTDOORS)) || - ((overall_mode == MODE_SHOPPING) && (store_pre_shop_mode == MODE_OUTDOORS))) { - view_rect.left = minmax(0,8,univ.party.loc_in_sec.x - 20); - view_rect.right = view_rect.left + 40; - view_rect.top = minmax(0,8,univ.party.loc_in_sec.y - 20); - view_rect.bottom = view_rect.top + 40; - redraw_rect = view_rect; - } - else { - total_size = univ.town->max_dim; - switch(total_size) { - case 64: - view_rect.left = minmax(0,24,univ.party.town_loc.x - 20); - view_rect.right = view_rect.left + 40; - view_rect.top = minmax(0,24,univ.party.town_loc.y - 20); - view_rect.bottom = view_rect.top + 40; - redraw_rect = big_rect; - break; - case 48: - view_rect.left = minmax(0,8,univ.party.town_loc.x - 20); - view_rect.right = view_rect.left + 40; - view_rect.top = minmax(0,8,univ.party.town_loc.y - 20); - view_rect.bottom = view_rect.top + 40; - redraw_rect = view_rect; - break; - case 32: - view_rect = tiny_rect; - redraw_rect = view_rect; - break; - } - } - if((is_out()) || ((is_combat()) && (which_combat_type == 0)) || - ((overall_mode == MODE_TALKING) && (store_pre_talk_mode == MODE_OUTDOORS)) || - ((overall_mode == MODE_SHOPPING) && (store_pre_shop_mode == MODE_OUTDOORS)) || - is_town() || is_combat()) { - area_to_draw_from = view_rect; - area_to_draw_from.width() = 40; - area_to_draw_from.height() = 40; - area_to_draw_from.left *= 6; - area_to_draw_from.right *= 6; - area_to_draw_from.top *= 6; - area_to_draw_from.bottom *= 6; - } - - if(is_combat()) - draw_pcs = false; - - const char* title_string = "Your map:"; - bool canMap = true; - - if((is_combat()) && (which_combat_type == 0)) { - title_string = "No map in combat."; - canMap = false; - }else if((is_town() && univ.town->defy_mapping)) { - title_string = "This place defies mapping."; - canMap = false; - } - else if(need_refresh) { - map_gworld.setActive(false); - - fill_rect(map_gworld, map_world_rect, sf::Color::Black); - - // Now, if shopping or talking, just don't touch anything. - if((overall_mode == MODE_SHOPPING) || (overall_mode == MODE_TALKING)) - redraw_rect.right = -1; - - if((is_out()) || - ((is_combat()) && (which_combat_type == 0)) || - ((overall_mode == MODE_TALKING) && (store_pre_talk_mode == MODE_OUTDOORS)) || - ((overall_mode == MODE_SHOPPING) && (store_pre_shop_mode == MODE_OUTDOORS))) - out_mode = true; - else out_mode = false; - - // TODO: It could be possible to draw the entire map here and then only refresh if a spot actually changes terrain type - auto const & small_ter_gworld = *ResMgr::textures.get("termap"); - for(where.x = redraw_rect.left; where.x < redraw_rect.right; where.x++) - for(where.y = redraw_rect.top; where.y < redraw_rect.bottom; where.y++) { - draw_rect = orig_draw_rect; - draw_rect.offset(6 * where.x, 6 * where.y); - - if(out_mode) - what_ter = univ.out[where.x + 48 * univ.party.i_w_c.x][where.y + 48 * univ.party.i_w_c.y]; - else what_ter = univ.town->terrain(where.x,where.y); - - ter_temp_from = base_source_rect; - - if(out_mode) - expl = univ.out.out_e[where.x + 48 * univ.party.i_w_c.x][where.y + 48 * univ.party.i_w_c.y]; - else expl = is_explored(where.x,where.y); - - if(expl != 0) { - pic = univ.scenario.ter_types[what_ter].map_pic; - bool drawLargeIcon = false; - if(pic == NO_PIC) { - pic = univ.scenario.ter_types[what_ter].picture; - drawLargeIcon = true; - } - if(pic >= 1000) { - if(spec_scen_g) { - //print_nums(0,99,pic); - Texture src_gw; - if(drawLargeIcon) { - pic = pic % 1000; - std::tie(src_gw,custom_from) = spec_scen_g.find_graphic(pic); - rect_draw_some_item(src_gw,custom_from,map_gworld,draw_rect); - } else { - std::tie(src_gw,custom_from) = spec_scen_g.find_graphic(pic % 1000); - custom_from.right = custom_from.left + 12; - custom_from.bottom = custom_from.top + 12; - pic /= 1000; pic--; - custom_from.offset((pic / 3) * 12, (pic % 3) * 12); - rect_draw_some_item(src_gw,custom_from, map_gworld, draw_rect); - } - } - } else if(drawLargeIcon) { - if(pic >= 960) { - custom_from = calc_rect(4 * ((pic - 960) / 5),(pic - 960) % 5); - rect_draw_some_item(*ResMgr::textures.get("teranim"), custom_from, map_gworld, draw_rect); - } else { - int which_sheet = pic / 50; - auto const &src_gw = *ResMgr::textures.get("ter" + std::to_string(1 + which_sheet)); - pic %= 50; - custom_from = calc_rect(pic % 10, pic / 10); - rect_draw_some_item(src_gw, custom_from, map_gworld, draw_rect); - } - } else { - if(univ.scenario.ter_types[what_ter].picture < 960) - ter_temp_from.offset(12 * (univ.scenario.ter_types[what_ter].picture % 20), - 12 * (univ.scenario.ter_types[what_ter].picture / 20)); - else ter_temp_from.offset(12 * 20, - 12 * (univ.scenario.ter_types[what_ter].picture - 960)); - rect_draw_some_item(small_ter_gworld,ter_temp_from,map_gworld,draw_rect); - } - - if(is_out() ? univ.out->roads[where.x][where.y] : univ.town.is_road(where.x,where.y)) { - draw_rect.inset(1,1); - rect_draw_some_item(*ResMgr::textures.get("trim"),{8,112,12,116},map_gworld,draw_rect); - } - } - } - - map_gworld.setActive(); - map_gworld.display(); - } - - mini_map.setActive(false); - - // Now place terrain map gworld - TextStyle style; - style.font = FONT_BOLD; - style.pointSize = 10;; - - the_rect = rectangle(mini_map); - tileImage(mini_map, the_rect,bg[4]); - cPict theGraphic(mini_map); - theGraphic.setBounds(dlogpicrect); - theGraphic.setPict(21, PIC_DLOG); - theGraphic.setFormat(TXT_FRAME, FRM_NONE); - theGraphic.draw(); - style.colour = sf::Color::White; - style.lineHeight = 12; - win_draw_string(mini_map, map_title_rect,title_string,eTextMode::WRAP,style); - win_draw_string(mini_map, map_bar_rect,"(Hit Escape to close.)",eTextMode::WRAP,style); - - if(canMap) { - rect_draw_some_item(map_gworld.getTexture(),area_to_draw_from,mini_map,area_to_draw_on); - - // Now place PCs and monsters - if(draw_pcs) { - if((is_town()) && (univ.party.status[ePartyStatus::DETECT_LIFE] > 0)) - for(short i = 0; i < univ.town.monst.size(); i++) - if(univ.town.monst[i].active > 0) { - where = univ.town.monst[i].cur_loc; - if((is_explored(where.x,where.y)) && - ((where.x >= view_rect.left) && (where.x < view_rect.right) - && where.y >= view_rect.top && where.y < view_rect.bottom)){ - - draw_rect.left = area_to_draw_on.left + 6 * (where.x - view_rect.left); - draw_rect.top = area_to_draw_on.top + 6 * (where.y - view_rect.top); - draw_rect.right = draw_rect.left + 6; - draw_rect.bottom = draw_rect.top + 6; - - fill_rect(mini_map, draw_rect, Colours::GREEN); - frame_circle(mini_map, draw_rect, Colours::BLUE); - } - } - if((overall_mode != MODE_SHOPPING) && (overall_mode != MODE_TALKING)) { - where = (is_town()) ? univ.party.town_loc : global_to_local(univ.party.out_loc); - - draw_rect.left = area_to_draw_on.left + 6 * (where.x - view_rect.left); - draw_rect.top = area_to_draw_on.top + 6 * (where.y - view_rect.top); - draw_rect.right = draw_rect.left + 6; - draw_rect.bottom = draw_rect.top + 6; - fill_rect(mini_map, draw_rect, Colours::RED); - frame_circle(mini_map, draw_rect, sf::Color::Black); - - } - } - } - mini_map.setActive(); - mini_map.display(); - - // Now exit gracefully - mainPtr.setActive(); - -} - - - bool is_door(location destination) { if(univ.scenario.ter_types[univ.town->terrain(destination.x,destination.y)].special == eTerSpec::UNLOCKABLE || @@ -1463,23 +1206,6 @@ bool is_door(location destination) { return false; } - -void display_map() { - // Show the automap if it's not already visible - if(map_visible) return; - give_help(62,0); - - rectangle the_rect; - rectangle dlogpicrect = {6,6,42,42}; - - mini_map.setVisible(true); - map_visible = true; - draw_map(true); - makeFrontWindow(mainPtr); - - set_cursor(sword_curs); -} - void check_done() { }