# HG changeset patch
# User Nomad
# Date 1382535471 -7200
# Node ID f4d5082b4a39e7ee18b67239c215485a0ce241b8
# Parent 8cd32199494396d1f2835885d446253554607a14# Parent f92e0bab7c7807d17cee201c215aeeddf5cc5887
Merge
diff -r f92e0bab7c78 -r f4d5082b4a39 Build/Visual Studio 2012/World of Might and Magic.sln
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Build/Visual Studio 2012/World of Might and Magic.sln Wed Oct 23 15:37:51 2013 +0200
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "World of Might and Magic", "World of Might and Magic.vcxproj", "{5DA49362-EF43-4753-85DC-88CC41F26764}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {5DA49362-EF43-4753-85DC-88CC41F26764}.Debug|Win32.ActiveCfg = Debug|Win32
+ {5DA49362-EF43-4753-85DC-88CC41F26764}.Debug|Win32.Build.0 = Debug|Win32
+ {5DA49362-EF43-4753-85DC-88CC41F26764}.Release|Win32.ActiveCfg = Release|Win32
+ {5DA49362-EF43-4753-85DC-88CC41F26764}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff -r f92e0bab7c78 -r f4d5082b4a39 Build/Visual Studio 2012/World of Might and Magic.v11.suo
Binary file Build/Visual Studio 2012/World of Might and Magic.v11.suo has changed
diff -r f92e0bab7c78 -r f4d5082b4a39 Build/Visual Studio 2012/World of Might and Magic.vcxproj
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Build/Visual Studio 2012/World of Might and Magic.vcxproj Wed Oct 23 15:37:51 2013 +0200
@@ -0,0 +1,378 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+
+ {5DA49362-EF43-4753-85DC-88CC41F26764}
+ Win32Proj
+ WorldofMightandMagic
+
+
+
+ Application
+ true
+ v110
+ Unicode
+
+
+ Application
+ false
+ v110
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ $(Configuration)\
+ $(WoMM_MM7_INSTALL_DIR)\
+ false
+
+
+ false
+
+
+
+ NotUsing
+ Level3
+ Disabled
+ WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)
+ $(IntDir)%(Directory)
+ ProgramDatabase
+
+
+ Windows
+ true
+ ..\..\lib\legacy_dx\lib\ddraw.lib;..\..\lib\legacy_dx\lib\dxguid.lib;%(AdditionalDependencies)
+ $(OutDir)$(TargetName)$(TargetExt)
+
+
+
+
+ Level3
+
+
+ MaxSpeed
+ true
+ true
+ WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)
+
+
+ Windows
+ true
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r f92e0bab7c78 -r f4d5082b4a39 Build/Visual Studio 2012/World of Might and Magic.vcxproj.filters
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Build/Visual Studio 2012/World of Might and Magic.vcxproj.filters Wed Oct 23 15:37:51 2013 +0200
@@ -0,0 +1,592 @@
+
+
+
+
+ {01df770d-32ca-4bfa-8448-de7b6ae4b15c}
+
+
+ {e6df15ec-967c-40ca-b954-c78fe66daed1}
+
+
+ {23711e0a-ee63-4da3-9c0d-22d02dd41747}
+
+
+ {9448e73a-c435-43ee-8586-08607774a0d0}
+
+
+ {1d2c44d0-de33-46dd-a3bf-dce44afda794}
+
+
+ {501083c0-a7b6-445f-a8fb-fa12cd345924}
+
+
+ {6fea8cb0-1887-4477-a64d-16e64b5de807}
+
+
+ {8f45576f-cc60-4d3a-837e-deb373a67f8a}
+
+
+ {d61aec30-ad58-4a9f-8f0a-e129f1947429}
+
+
+ {c0b8b696-9a12-4b22-b8c1-0262d7fbb306}
+
+
+
+
+ Level
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ NewUI
+
+
+ UI
+
+
+ UI
+
+
+ UI
+
+
+ UI
+
+
+ UI
+
+
+ UI
+
+
+ UI
+
+
+ UI
+
+
+ UI
+
+
+ UI
+
+
+ UI
+
+
+ UI
+
+
+ UI
+
+
+ UI
+
+
+ UI\Books
+
+
+ UI\Books
+
+
+ UI\Books
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Level
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\legacy_dx
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\zlib
+
+
+ lib\lua
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ lib\lua\lua-5.2.2
+
+
+ NewUI
+
+
+ NewUI\Core
+
+
+ UI
+
+
+ UI
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ lib\legacy_dx
+
+
+
\ No newline at end of file
diff -r f92e0bab7c78 -r f4d5082b4a39 Build/Visual Studio 2012/World of Might and Magic.vcxproj.user
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Build/Visual Studio 2012/World of Might and Magic.vcxproj.user Wed Oct 23 15:37:51 2013 +0200
@@ -0,0 +1,9 @@
+
+
+
+ $(OutDir)$(TargetName)$(TargetExt)
+ $(OutDir)
+ WindowsLocalDebugger
+ -novideo -nomarg
+
+
\ No newline at end of file
diff -r f92e0bab7c78 -r f4d5082b4a39 Build/init_win.bat
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Build/init_win.bat Wed Oct 23 15:37:51 2013 +0200
@@ -0,0 +1,58 @@
+@echo off
+set _mm7_install_dir=E:\g\mm collection\MM_VII
+
+
+
+
+REM Check Windows Version
+
+ver | findstr /i "5\.0\." > nul
+IF %ERRORLEVEL% EQU 0 goto win_2000
+
+ver | findstr /i "5\.1\." > nul
+IF %ERRORLEVEL% EQU 0 goto win_xp
+
+ver | findstr /i "5\.2\." > nul
+IF %ERRORLEVEL% EQU 0 goto win_2003
+
+ver | findstr /i "6\.0\." > nul
+IF %ERRORLEVEL% EQU 0 goto win_vista
+
+ver | findstr /i "6\.1\." > nul
+IF %ERRORLEVEL% EQU 0 goto win_7
+
+echo Machine OS cannot be determined.
+goto end
+
+:win_7
+echo Win 7
+reg add HKCU\Environment /f /v "WoMM_MM7_INSTALL_DIR" /t REG_SZ /d "%_mm7_install_dir%"
+
+reg query HKCU\Environment /v "WoMM_MM7_INSTALL_DIR"
+goto end
+
+:win_2000
+echo Win 2000
+goto end
+
+:win_xp
+echo Win XP
+reg add HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment /f /v "WoMM_MM7_INSTALL_DIR" /t REG_SZ /d "%_mm7_install_dir%"
+
+
+reg query HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment /v "WoMM_MM7_INSTALL_DIR"
+goto end
+
+:win_vista
+echo Win Vista
+goto end
+
+:win_2003
+echo Win 2003
+goto end
+
+:check_vars
+goto end
+
+:end
+pause
\ No newline at end of file
diff -r f92e0bab7c78 -r f4d5082b4a39 MM7_manifest.rc
Binary file MM7_manifest.rc has changed
diff -r f92e0bab7c78 -r f4d5082b4a39 Might and Magic Trilogy.rc
Binary file Might and Magic Trilogy.rc has changed
diff -r f92e0bab7c78 -r f4d5082b4a39 OSAPI.cpp
--- a/OSAPI.cpp Wed Oct 23 17:30:14 2013 +0600
+++ b/OSAPI.cpp Wed Oct 23 15:37:51 2013 +0200
@@ -6,10 +6,53 @@
OSVersion *pVersion = nullptr;
+#include
//----- (00462C94) --------------------------------------------------------
int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE, wchar_t *lpCmdLine, int nShowCmd)
{
+ auto cvt = [] (const char *filename)
+ {
+ char ico_filename[512];
+ sprintf(ico_filename, "%s.ico", filename);
+
+ char c_filename[512];
+ sprintf(c_filename, "%s.c", filename);
+ auto file = fopen(ico_filename, "rb");
+ {
+ auto o = fopen(c_filename, "w+t");
+ fprintf(o, "unsigned char %s[] =\n{\n\t", filename);
+
+ int position = 0;
+ bool once = true;
+ while (!feof(file))
+ {
+ unsigned char c;
+ fread(&c, 1, 1, file);
+
+ if (position == 7)
+ fprintf(o, ",\t");
+ else if (position != 0)
+ fprintf(o, ", ");
+
+ fprintf(o, "0x%02X", (unsigned int)c);
+ if (++position == 15)
+ {
+ fprintf(o, ",\n\t");
+ position = 0;
+ }
+ }
+
+ fprintf(o, "\n};");
+ fclose(o);
+ }
+ fclose(file);
+ };
+
+ cvt("mm6_icon");
+ cvt("mm7_icon");
+ cvt("mm8_icon");
+
Log::Initialize();
//if (HWND hMM7Window = FindWindowW(L"MM7", 0))
diff -r f92e0bab7c78 -r f4d5082b4a39 OSWindow.cpp
--- a/OSWindow.cpp Wed Oct 23 17:30:14 2013 +0600
+++ b/OSWindow.cpp Wed Oct 23 15:37:51 2013 +0200
@@ -787,4 +787,4 @@
}
return true;
-}
\ No newline at end of file
+}
diff -r f92e0bab7c78 -r f4d5082b4a39 Render.cpp
--- a/Render.cpp Wed Oct 23 17:30:14 2013 +0600
+++ b/Render.cpp Wed Oct 23 15:37:51 2013 +0200
@@ -34,8 +34,8 @@
#include "Lights.h"
#include "Level/Decoration.h"
-#pragma comment(lib, "lib\\legacy_dx\\lib\\ddraw.lib")
-#pragma comment(lib, "lib\\legacy_dx\\lib\\dxguid.lib")
+//#pragma comment(lib, "lib\\legacy_dx\\lib\\ddraw.lib")
+//#pragma comment(lib, "lib\\legacy_dx\\lib\\dxguid.lib")
struct IDirectDrawClipper *pDDrawClipper;
struct Render *pRenderer; // idb
diff -r f92e0bab7c78 -r f4d5082b4a39 mm7_5.cpp
--- a/mm7_5.cpp Wed Oct 23 17:30:14 2013 +0600
+++ b/mm7_5.cpp Wed Oct 23 15:37:51 2013 +0200
@@ -406,7 +406,7 @@
{
int v4; // ebx@1
SpriteObject *v5; // eax@2
- bool v6; // eax@3
+ int v6; // eax@3
Actor *v7; // esi@4
Actor *v8; // edi@4
char v9; // zf@5
diff -r f92e0bab7c78 -r f4d5082b4a39 stru9.cpp
--- a/stru9.cpp Wed Oct 23 17:30:14 2013 +0600
+++ b/stru9.cpp Wed Oct 23 15:37:51 2013 +0200
@@ -267,7 +267,7 @@
bool stru9::_498774(struct RenderVertexSoft *a1, struct RenderVertexSoft *a2, struct RenderVertexSoft *a3, struct stru312 *a4, struct RenderVertexSoft *a5)
{
RenderVertexSoft *v6; // ecx@5
- bool result; // eax@5
+ int result; // eax@5
double v8; // st7@5
__int16 v9; // fps@5
double v10; // st7@6