-
-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #654 from ddrsoul/VCMI-1.6.0dev-update
Vcmi 1.6.0dev update
- Loading branch information
Showing
373 changed files
with
36,182 additions
and
26,208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,60 @@ | ||
## Notes | ||
|
||
Thanks to [VCMI Team](https://github.com/vcmi/vcmi) for the open source Heroes of Might and Magic III engine that makes this possible. Also thanks to the [kloptops](https://github.com/kloptops/Portmaster-misc/tree/main/VCMI) for the porting work for portmaster. | ||
Thanks to [VCMI Team](https://github.com/vcmi/vcmi) for the open source Heroes of Might and Magic III engine that makes this possible. Also thanks to the @kloptops for the porting work for portmaster. | ||
Update to 1.6.0-dev was made by @ddrsoul with great help of @kloptops , @kotzebuedog and all VCMI and PortMaster community. | ||
|
||
## Detailed Instructions | ||
|
||
You need to add required game files either from CD1 & CD2, GoG or an installed copy of the game. <br> This requires about 2-3 gb of free space. For the gog version copy setup_heroes_of_might_and_magic_3_complete_4.0_(28740)-1.bin and setup_heroes_of_might_and_magic_3_complete_4.0_(28740).exe into ports/vcmi. <br> For the cd version copy the contents of cd1 into ports/vcmi/cd1 and cd2 into ports/vcmi/cd2. For the installed version copy installed game files into ports/vcmi/install. | ||
You need to add required game files either from CD1 & CD2, GoG or an installed copy of the game. | ||
This requires about 2-3 gb of free space. For the gog version copy setup_heroes_of_might_and_magic_3_complete_4.0_(28740)-1.bin and setup_heroes_of_might_and_magic_3_complete_4.0_(28740).exe into ports/vcmi. | ||
For the cd version copy the contents of cd1 into ports/vcmi/cd1 and cd2 into ports/vcmi/cd2. | ||
For the installed version copy installed game files into ports/vcmi/install. | ||
|
||
## Controls | ||
|
||
VCMI supports gamepad controls. | ||
Controller mapping can be redone in ./config/shortcutsConfig.json | ||
|
||
Some additional settings can be made in ./save/settings.json: | ||
"input" : { | ||
"enableController" : true // turn controller detection on/off | ||
"controllerTriggerTreshold" : 0.3 // triggers, e.g. L2/R2 on PS controller would activate if they are pressed to 30% | ||
"controllerAxisDeadZone" : 0.2 // analog sticks would activate if they are at 20% from resting position | ||
"controllerAxisFullZone" : 1.0 // analog sticks would be maxed-out when they are at 100% from resting position | ||
"controllerAxisSpeed" : 1000 // analog sticks would move at 1000 px/second | ||
"controllerAxisScale" : 2 // adds acceleration to analog sticks. So, half-pressed stick would actually move not at 500 px/second, but 250 px/s IIRC. Changing to 1 would make analog sticks linear | ||
} | ||
|
||
## Building | ||
|
||
``` | ||
git clone --recursive https://github.com/vcmi/vcmi.git | ||
``` | ||
|
||
replace ./server/processors/PlayerMessageProcessor.cpp:653 with | ||
|
||
``` | ||
std::string cheatTrimmed = boost::trim_copy(cheat); | ||
boost::split(words, cheatTrimmed, boost::is_any_of("\t\r\n ")); | ||
``` | ||
|
||
put DATA_PATHS.diff inside ./vcmi folder | ||
|
||
``` | ||
git apply DATA_PATHS.diff | ||
mkdir build | ||
cd build | ||
cmake .. -DBIN_DIR:FILE="bin" -DCMAKE_INSTALL_PREFIX:FILE="." -DCOPY_CONFIG_ON_BUILD="ON" -DENABLE_DEBUG_CONSOLE="OFF" -DENABLE_EDITOR="OFF" -DENABLE_ERM="OFF" -DENABLE_GITVERSION="OFF" -DENABLE_LAUNCHER="OFF" -DENABLE_LUA="OFF" -DCMAKE_BUILD_TYPE="RelWithDebInfo" -DENABLE_MONOLITHIC_INSTALL="OFF" -DENABLE_MULTI_PROCESS_BUILDS="ON" -DENABLE_NULLKILLER_AI="ON" -DENABLE_PCH="OFF" -DENABLE_SINGLE_APP_BUILD="OFF" -DENABLE_STATIC_AI_LIBS="OFF" -DENABLE_STRICT_COMPILATION="OFF" -DENABLE_TEST="OFF" -DENABLE_TRANSLATIONS="OFF" -DFL_BACKTRACE="ON" -DFL_BUILD_BINARY="OFF" -DFL_BUILD_SHARED="OFF" -DFL_BUILD_STATIC="ON" -DFL_BUILD_TESTS="OFF" -DFL_USE_FLOAT="OFF" -DFORCE_BUNDLED_FL="ON" | ||
make | ||
``` | ||
|
||
## Thanks | ||
|
||
A special thanks to the excellent folks on the [AmberELEC discord](https://discord.com/invite/R9Er7hkRMe), especially [Cebion](https://github.com/Cebion) for all the testing. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
diff --git a/Global.h b/Global.h | ||
index 6fa656a17..d9e46738f 100644 | ||
--- a/Global.h | ||
+++ b/Global.h | ||
@@ -15,6 +15,8 @@ | ||
// Fixed width bool data type is important for serialization | ||
static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size."); | ||
|
||
+# define VCMI_PORTMASTER | ||
+ | ||
/* ---------------------------------------------------------------------------- */ | ||
/* System detection. */ | ||
/* ---------------------------------------------------------------------------- */ | ||
diff --git a/client/gui/CursorHandler.cpp b/client/gui/CursorHandler.cpp | ||
index 146f27b9c..696a8820f 100644 | ||
--- a/client/gui/CursorHandler.cpp | ||
+++ b/client/gui/CursorHandler.cpp | ||
@@ -23,7 +23,7 @@ | ||
|
||
std::unique_ptr<ICursor> CursorHandler::createCursor() | ||
{ | ||
-#if defined(VCMI_MOBILE) | ||
+#if defined(VCMI_MOBILE) || defined(VCMI_PORTMASTER) | ||
if (settings["general"]["userRelativePointer"].Bool()) | ||
return std::make_unique<CursorSoftware>(); | ||
#endif | ||
diff --git a/lib/VCMIDirs.cpp b/lib/VCMIDirs.cpp | ||
index 1eaadefc2..340c13584 100644 | ||
--- a/lib/VCMIDirs.cpp | ||
+++ b/lib/VCMIDirs.cpp | ||
@@ -579,6 +579,89 @@ void VCMIDirsAndroid::init() | ||
nativePath = envHelper.callStaticStringMethod(CAndroidVMHelper::NATIVE_METHODS_DEFAULT_CLASS, "nativePath"); | ||
IVCMIDirsUNIX::init(); | ||
} | ||
+#elif defined(VCMI_PORTMASTER) | ||
+class VCMIDirsPM : public IVCMIDirsUNIX | ||
+{ | ||
+public: | ||
+ bfs::path userDataPath() const override; | ||
+ bfs::path userCachePath() const override; | ||
+ bfs::path userConfigPath() const override; | ||
+ | ||
+ std::vector<bfs::path> dataPaths() const override; | ||
+ | ||
+ bfs::path libraryPath() const override; | ||
+ bfs::path binaryPath() const override; | ||
+ | ||
+ std::string libraryName(const std::string& basename) const override; | ||
+}; | ||
+ | ||
+bfs::path VCMIDirsPM::userDataPath() const | ||
+{ | ||
+ const char* homeDir; | ||
+ if((homeDir = getenv("PORTMASTER_HOME"))) | ||
+ return bfs::path(homeDir) / "data"; | ||
+ else | ||
+ return bfs::path(".") / "data"; | ||
+} | ||
+bfs::path VCMIDirsPM::userCachePath() const | ||
+{ | ||
+ // $XDG_CACHE_HOME, default: $HOME/.cache | ||
+ const char * tempResult; | ||
+ if ((tempResult = getenv("PORTMASTER_HOME"))) | ||
+ return bfs::path(tempResult) / "cache"; | ||
+ else | ||
+ return bfs::path(".") / "cache"; | ||
+} | ||
+bfs::path VCMIDirsPM::userConfigPath() const | ||
+{ | ||
+ // $XDG_CONFIG_HOME, default: $HOME/.config | ||
+ const char * tempResult; | ||
+ if ((tempResult = getenv("PORTMASTER_HOME"))) | ||
+ return bfs::path(tempResult) / "save"; | ||
+ else | ||
+ return bfs::path(".") / "save"; | ||
+} | ||
+ | ||
+std::vector<bfs::path> VCMIDirsPM::dataPaths() const | ||
+{ | ||
+ // $XDG_DATA_DIRS, default: /usr/local/share/:/usr/share/ | ||
+ | ||
+ // construct list in reverse. | ||
+ // in specification first directory has highest priority | ||
+ // in vcmi fs last directory has highest priority | ||
+ std::vector<bfs::path> ret; | ||
+ const char * tempResult; | ||
+ if ((tempResult = getenv("PORTMASTER_HOME"))) | ||
+ { | ||
+ ret.push_back(bfs::path(tempResult) / "data"); | ||
+ ret.push_back(bfs::path(tempResult)); | ||
+ } | ||
+ | ||
+ ret.push_back(bfs::path(".") / "data"); | ||
+ ret.push_back(bfs::path(".")); | ||
+ return ret; | ||
+} | ||
+ | ||
+bfs::path VCMIDirsPM::libraryPath() const | ||
+{ | ||
+ const char * tempResult; | ||
+ if ((tempResult = getenv("PORTMASTER_HOME"))) | ||
+ return bfs::path(tempResult) / "libs"; | ||
+ else | ||
+ return M_LIB_DIR; | ||
+} | ||
+ | ||
+bfs::path VCMIDirsPM::binaryPath() const | ||
+{ | ||
+ const char * tempResult; | ||
+ if ((tempResult = getenv("PORTMASTER_HOME"))) | ||
+ return bfs::path(tempResult) / "bin"; | ||
+ else | ||
+ return M_BIN_DIR; | ||
+} | ||
+ | ||
+std::string VCMIDirsPM::libraryName(const std::string& basename) const { return "lib" + basename + ".so"; } | ||
+ | ||
#elif defined(VCMI_XDG) | ||
class VCMIDirsXDG : public IVCMIDirsUNIX | ||
{ | ||
@@ -700,6 +783,8 @@ namespace VCMIDirs | ||
static VCMIDirsWIN32 singleton; | ||
#elif defined(VCMI_ANDROID) | ||
static VCMIDirsAndroid singleton; | ||
+ #elif defined(VCMI_PORTMASTER) | ||
+ static VCMIDirsPM singleton; | ||
#elif defined(VCMI_XDG) | ||
static VCMIDirsXDG singleton; | ||
#elif defined(VCMI_MAC) | ||
diff --git a/scripting/lua/LuaScriptingContext.cpp b/scripting/lua/LuaScriptingContext.cpp | ||
index 5c351f623..6f60207ad 100644 | ||
--- a/scripting/lua/LuaScriptingContext.cpp | ||
+++ b/scripting/lua/LuaScriptingContext.cpp | ||
@@ -46,7 +46,7 @@ LuaContext::LuaContext(const Script * source, const Environment * env_): | ||
{LUA_TABLIBNAME, luaopen_table}, | ||
{LUA_STRLIBNAME, luaopen_string}, | ||
{LUA_MATHLIBNAME, luaopen_math}, | ||
- {LUA_BITLIBNAME, luaopen_bit} | ||
+ {LUA_BITLIBNAME, luaopen_bit32} | ||
}; | ||
|
||
for(const luaL_Reg & lib : STD_LIBS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-4.19 KB
(3.9%)
ports/vcmi/vcmi/Mods/vcmi/Data/lobby/townBorderBigActivated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-476 Bytes
(21%)
ports/vcmi/vcmi/Mods/vcmi/Data/lobby/townBorderBigGrayedOut.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-440 Bytes
(24%)
ports/vcmi/vcmi/Mods/vcmi/Data/lobby/townBorderSmallActivated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
VERM | ||
; standard verm file, global engine things should be put here | ||
!?PI; | ||
; example 1 --- Hello World | ||
![print ^Hello world!^] | ||
; example 2 --- simple arithmetics | ||
![defun add [x y] [+ x y]] | ||
![print [add 2 3]] | ||
; example 3 --- semantic macros | ||
![defmacro do-n-times [times body] | ||
`[progn | ||
[setq do-counter 0] | ||
[setq do-max ,times] | ||
[do [< do-counter do-max] | ||
[progn | ||
[setq do-counter [+ do-counter 1]] | ||
,body | ||
] | ||
] | ||
] | ||
] | ||
![do-n-times 4 [print ^tekst\n^]] | ||
; example 4 --- conditional expression | ||
![if [> 2 1] [print ^Wieksze^] [print ^Mniejsze^]] | ||
; example 5 --- lambda expressions | ||
![[lambda [x y] [if [> x y] [print ^wieksze^] [print ^mniejsze^]]] 2 3] | ||
; example 6 --- resursion | ||
![defun factorial [n] | ||
[if [= n 0] 1 | ||
[* n [factorial [- n 1]]] | ||
] | ||
] | ||
VERM | ||
; standard verm file, global engine things should be put here | ||
|
||
!?PI; | ||
; example 1 --- Hello World | ||
![print ^Hello world!^] | ||
|
||
; example 2 --- simple arithmetics | ||
![defun add [x y] [+ x y]] | ||
![print [add 2 3]] | ||
|
||
; example 3 --- semantic macros | ||
![defmacro do-n-times [times body] | ||
`[progn | ||
[setq do-counter 0] | ||
[setq do-max ,times] | ||
[do [< do-counter do-max] | ||
[progn | ||
[setq do-counter [+ do-counter 1]] | ||
,body | ||
] | ||
] | ||
] | ||
] | ||
![do-n-times 4 [print ^tekst\n^]] | ||
|
||
|
||
; example 4 --- conditional expression | ||
![if [> 2 1] [print ^Wieksze^] [print ^Mniejsze^]] | ||
|
||
; example 5 --- lambda expressions | ||
![[lambda [x y] [if [> x y] [print ^wieksze^] [print ^mniejsze^]]] 2 3] | ||
|
||
; example 6 --- resursion | ||
![defun factorial [n] | ||
[if [= n 0] 1 | ||
[* n [factorial [- n 1]]] | ||
] | ||
] | ||
![print [factorial 8]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
ZVSE | ||
!?PI; | ||
!!VRv2777:S4; | ||
!!DO1/0/5/1&v2777<>1:P0; | ||
!?FU1; | ||
!!VRv2778:Sx16%2; | ||
!!IF&x16>3:M^Hello world number %X16! To duza liczba^; | ||
!!IF&v2778==0&x16<=3:M^Hello world number %X16! To mala parzysta liczba^; | ||
!!IF&v2778==1&x16<=3:M^Hello world number %X16! To mala nieparzysta liczba^; | ||
!?PI; | ||
!!VRz10:S^Composed hello ^; | ||
ZVSE | ||
!?PI; | ||
!!VRv2777:S4; | ||
!!DO1/0/5/1&v2777<>1:P0; | ||
|
||
!?FU1; | ||
!!VRv2778:Sx16%2; | ||
!!IF&x16>3:M^Hello world number %X16! To duza liczba^; | ||
!!IF&v2778==0&x16<=3:M^Hello world number %X16! To mala parzysta liczba^; | ||
!!IF&v2778==1&x16<=3:M^Hello world number %X16! To mala nieparzysta liczba^; | ||
|
||
!?PI; | ||
!!VRz10:S^Composed hello ^; | ||
!!IF:M^%Z10%%world%%, v2777=%V2777, v2778=%V2778!^; |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.