changeset 1930:df4e27f2a541

Merge
author Grumpy7
date Wed, 23 Oct 2013 19:13:07 -0700
parents 4cce1e24b7e7 (current diff) 3eb0c4f3d899 (diff)
children 2e3d08ff3309 68f2d9d3a1d9
files MM7_manifest.rc Might and Magic Trilogy.rc mm7_1.cpp
diffstat 27 files changed, 1371 insertions(+), 743 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Build/Visual Studio 2012/World of Might and Magic.sln	Wed Oct 23 19:13:07 2013 -0700
@@ -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
Binary file Build/Visual Studio 2012/World of Might and Magic.v11.suo has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Build/Visual Studio 2012/World of Might and Magic.vcxproj	Wed Oct 23 19:13:07 2013 -0700
@@ -0,0 +1,378 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{5DA49362-EF43-4753-85DC-88CC41F26764}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>WorldofMightandMagic</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v110</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v110</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <IntDir>$(Configuration)\</IntDir>
+    <OutDir>$(WoMM_MM7_INSTALL_DIR)\</OutDir>
+    <GenerateManifest>false</GenerateManifest>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ObjectFileName>$(IntDir)%(Directory)</ObjectFileName>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <AdditionalDependencies>..\..\lib\legacy_dx\lib\ddraw.lib;..\..\lib\legacy_dx\lib\dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\Actor.cpp" />
+    <ClCompile Include="..\..\AIL.cpp" />
+    <ClCompile Include="..\..\Arcomage.cpp" />
+    <ClCompile Include="..\..\ArcomageCards.cpp" />
+    <ClCompile Include="..\..\AudioPlayer.cpp" />
+    <ClCompile Include="..\..\Bink_Smacker.cpp" />
+    <ClCompile Include="..\..\BSPModel.cpp" />
+    <ClCompile Include="..\..\CastSpellInfo.cpp" />
+    <ClCompile Include="..\..\Chest.cpp" />
+    <ClCompile Include="..\..\Conditions.cpp" />
+    <ClCompile Include="..\..\CShow.cpp" />
+    <ClCompile Include="..\..\DecalBuilder.cpp" />
+    <ClCompile Include="..\..\DecorationList.cpp" />
+    <ClCompile Include="..\..\Events.cpp" />
+    <ClCompile Include="..\..\FrameTableInc.cpp" />
+    <ClCompile Include="..\..\Game.cpp" />
+    <ClCompile Include="..\..\GammaControl.cpp" />
+    <ClCompile Include="..\..\GUIButton.cpp" />
+    <ClCompile Include="..\..\GUIFont.cpp" />
+    <ClCompile Include="..\..\GUIProgressBar.cpp" />
+    <ClCompile Include="..\..\GUIWindow.cpp" />
+    <ClCompile Include="..\..\IconFrameTable.cpp" />
+    <ClCompile Include="..\..\Indoor.cpp" />
+    <ClCompile Include="..\..\IndoorCameraD3D.cpp" />
+    <ClCompile Include="..\..\Items.cpp" />
+    <ClCompile Include="..\..\Keyboard.cpp" />
+    <ClCompile Include="..\..\Level\Decoration.cpp" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lapi.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lauxlib.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lbaselib.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lbitlib.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lcode.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lcorolib.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lctype.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ldblib.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ldebug.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ldo.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ldump.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lfunc.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lgc.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\linit.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\liolib.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\llex.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lmathlib.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lmem.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\loadlib.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lobject.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lopcodes.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\loslib.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lparser.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lstate.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lstring.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lstrlib.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ltable.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ltablib.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ltm.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lua.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lundump.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lvm.c" />
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lzio.c" />
+    <ClCompile Include="..\..\lib\zlib\adler32.c" />
+    <ClCompile Include="..\..\lib\zlib\compress.c" />
+    <ClCompile Include="..\..\lib\zlib\crc32.c" />
+    <ClCompile Include="..\..\lib\zlib\deflate.c" />
+    <ClCompile Include="..\..\lib\zlib\infblock.c" />
+    <ClCompile Include="..\..\lib\zlib\infcodes.c" />
+    <ClCompile Include="..\..\lib\zlib\inffast.c" />
+    <ClCompile Include="..\..\lib\zlib\inflate.c" />
+    <ClCompile Include="..\..\lib\zlib\inftrees.c" />
+    <ClCompile Include="..\..\lib\zlib\infutil.c" />
+    <ClCompile Include="..\..\lib\zlib\trees.c" />
+    <ClCompile Include="..\..\lib\zlib\uncompr.c" />
+    <ClCompile Include="..\..\lib\zlib\zutil.c" />
+    <ClCompile Include="..\..\LightmapBuilder.cpp" />
+    <ClCompile Include="..\..\LightsStack.cpp" />
+    <ClCompile Include="..\..\LOD.cpp" />
+    <ClCompile Include="..\..\Log.cpp" />
+    <ClCompile Include="..\..\mm7text_ru.cpp" />
+    <ClCompile Include="..\..\mm7_2.cpp" />
+    <ClCompile Include="..\..\mm7_3.cpp" />
+    <ClCompile Include="..\..\mm7_4.cpp" />
+    <ClCompile Include="..\..\mm7_5.cpp" />
+    <ClCompile Include="..\..\mm7_6.cpp" />
+    <ClCompile Include="..\..\mm7_data.cpp" />
+    <ClCompile Include="..\..\Monsters.cpp" />
+    <ClCompile Include="..\..\Mouse.cpp" />
+    <ClCompile Include="..\..\NewUI\MainMenu.cpp" />
+    <ClCompile Include="..\..\NPC.cpp" />
+    <ClCompile Include="..\..\ObjectList.cpp" />
+    <ClCompile Include="..\..\OSAPI.cpp" />
+    <ClCompile Include="..\..\OSWindow.cpp" />
+    <ClCompile Include="..\..\Outdoor.cpp" />
+    <ClCompile Include="..\..\Overlays.cpp" />
+    <ClCompile Include="..\..\PaletteManager.cpp" />
+    <ClCompile Include="..\..\ParticleEngine.cpp" />
+    <ClCompile Include="..\..\Party.cpp" />
+    <ClCompile Include="..\..\Player.cpp" />
+    <ClCompile Include="..\..\Random.cpp" />
+    <ClCompile Include="..\..\Render.cpp" />
+    <ClCompile Include="..\..\SaveLoad.cpp" />
+    <ClCompile Include="..\..\Spells.cpp" />
+    <ClCompile Include="..\..\SpriteObject.cpp" />
+    <ClCompile Include="..\..\Sprites.cpp" />
+    <ClCompile Include="..\..\StorylineTextTable.cpp" />
+    <ClCompile Include="..\..\stru10.cpp" />
+    <ClCompile Include="..\..\stru6.cpp" />
+    <ClCompile Include="..\..\stru9.cpp" />
+    <ClCompile Include="..\..\texts.cpp" />
+    <ClCompile Include="..\..\Texture.cpp" />
+    <ClCompile Include="..\..\TileTable.cpp" />
+    <ClCompile Include="..\..\Time.cpp" />
+    <ClCompile Include="..\..\TurnEngine.cpp" />
+    <ClCompile Include="..\..\UI\Books\UIMapBook.cpp" />
+    <ClCompile Include="..\..\UI\Books\UINotesBooks.cpp" />
+    <ClCompile Include="..\..\UI\Books\UISpellBook.cpp" />
+    <ClCompile Include="..\..\UI\UIBooks.cpp" />
+    <ClCompile Include="..\..\UI\UICharacter.cpp" />
+    <ClCompile Include="..\..\UI\UiGame.cpp" />
+    <ClCompile Include="..\..\UI\UIGuilds.cpp" />
+    <ClCompile Include="..\..\UI\UIHouses.cpp" />
+    <ClCompile Include="..\..\UI\UIMainMenu.cpp" />
+    <ClCompile Include="..\..\UI\UIMsgProc.cpp" />
+    <ClCompile Include="..\..\UI\UIOptions.cpp" />
+    <ClCompile Include="..\..\UI\UIPartyCreation.cpp" />
+    <ClCompile Include="..\..\UI\UIPopup.cpp" />
+    <ClCompile Include="..\..\UI\UIRest.cpp" />
+    <ClCompile Include="..\..\UI\UISaveLoad.cpp" />
+    <ClCompile Include="..\..\UI\UIShops.cpp" />
+    <ClCompile Include="..\..\UI\UITransition.cpp" />
+    <ClCompile Include="..\..\VectorTypes.cpp" />
+    <ClCompile Include="..\..\VideoPlayer.cpp" />
+    <ClCompile Include="..\..\Viewport.cpp" />
+    <ClCompile Include="..\..\Vis.cpp" />
+    <ClCompile Include="..\..\Weather.cpp" />
+    <ClCompile Include="..\..\_deleted.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\Actor.h" />
+    <ClInclude Include="..\..\AIL.h" />
+    <ClInclude Include="..\..\Arcomage.h" />
+    <ClInclude Include="..\..\AudioPlayer.h" />
+    <ClInclude Include="..\..\Autonotes.h" />
+    <ClInclude Include="..\..\Awards.h" />
+    <ClInclude Include="..\..\Bink_Smacker.h" />
+    <ClInclude Include="..\..\BSPModel.h" />
+    <ClInclude Include="..\..\CastSpellInfo.h" />
+    <ClInclude Include="..\..\Chest.h" />
+    <ClInclude Include="..\..\Conditions.h" />
+    <ClInclude Include="..\..\CShow.h" />
+    <ClInclude Include="..\..\DecalBuilder.h" />
+    <ClInclude Include="..\..\DecorationList.h" />
+    <ClInclude Include="..\..\ErrorHandling.h" />
+    <ClInclude Include="..\..\Events.h" />
+    <ClInclude Include="..\..\Events2D.h" />
+    <ClInclude Include="..\..\FactionTable.h" />
+    <ClInclude Include="..\..\FrameTableInc.h" />
+    <ClInclude Include="..\..\Game.h" />
+    <ClInclude Include="..\..\GammaControl.h" />
+    <ClInclude Include="..\..\GUIFont.h" />
+    <ClInclude Include="..\..\GUIProgressBar.h" />
+    <ClInclude Include="..\..\GUIWindow.h" />
+    <ClInclude Include="..\..\IconFrameTable.h" />
+    <ClInclude Include="..\..\Indoor.h" />
+    <ClInclude Include="..\..\IndoorCameraD3D.h" />
+    <ClInclude Include="..\..\Indoor_stuff.h" />
+    <ClInclude Include="..\..\Items.h" />
+    <ClInclude Include="..\..\Keyboard.h" />
+    <ClInclude Include="..\..\Level\Decoration.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\d3d.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\d3dcaps.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\d3drm.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\d3drmdef.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\d3drmobj.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\d3drmwin.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\d3dtypes.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\ddraw.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dinput.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dinputd.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dmdls.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dmerror.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dmksctrl.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dmplugin.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dmusbuff.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dmusicc.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dmusicf.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dmusici.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dmusics.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dsconf.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dsound.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\dvoice.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\multimon.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\rmxfguid.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\rmxftmpl.h" />
+    <ClInclude Include="..\..\lib\legacy_dx\strsafe.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lapi.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lauxlib.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lcode.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lctype.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\ldebug.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\ldo.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lfunc.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lgc.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\llex.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\llimits.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lmem.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lobject.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lopcodes.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lparser.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lstate.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lstring.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\ltable.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\ltm.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lua.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\luaconf.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lualib.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lundump.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lvm.h" />
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lzio.h" />
+    <ClInclude Include="..\..\lib\lua\lua.h" />
+    <ClInclude Include="..\..\lib\zlib\deflate.h" />
+    <ClInclude Include="..\..\lib\zlib\infblock.h" />
+    <ClInclude Include="..\..\lib\zlib\infcodes.h" />
+    <ClInclude Include="..\..\lib\zlib\inffast.h" />
+    <ClInclude Include="..\..\lib\zlib\inffixed.h" />
+    <ClInclude Include="..\..\lib\zlib\inftrees.h" />
+    <ClInclude Include="..\..\lib\zlib\infutil.h" />
+    <ClInclude Include="..\..\lib\zlib\trees.h" />
+    <ClInclude Include="..\..\lib\zlib\zconf.h" />
+    <ClInclude Include="..\..\lib\zlib\zlib.h" />
+    <ClInclude Include="..\..\lib\zlib\zutil.h" />
+    <ClInclude Include="..\..\LightmapBuilder.h" />
+    <ClInclude Include="..\..\Lights.h" />
+    <ClInclude Include="..\..\LOD.h" />
+    <ClInclude Include="..\..\Log.h" />
+    <ClInclude Include="..\..\MapInfo.h" />
+    <ClInclude Include="..\..\Math.h" />
+    <ClInclude Include="..\..\MM7.h" />
+    <ClInclude Include="..\..\mm7_data.h" />
+    <ClInclude Include="..\..\Monsters.h" />
+    <ClInclude Include="..\..\Mouse.h" />
+    <ClInclude Include="..\..\NewUI\Core\UIControl.h" />
+    <ClInclude Include="..\..\NewUI\MainMenu.h" />
+    <ClInclude Include="..\..\NPC.h" />
+    <ClInclude Include="..\..\NZIArray.h" />
+    <ClInclude Include="..\..\ObjectList.h" />
+    <ClInclude Include="..\..\OSAPI.h" />
+    <ClInclude Include="..\..\OSInfo.h" />
+    <ClInclude Include="..\..\OSWindow.h" />
+    <ClInclude Include="..\..\Outdoor.h" />
+    <ClInclude Include="..\..\Outdoor_stuff.h" />
+    <ClInclude Include="..\..\Overlays.h" />
+    <ClInclude Include="..\..\PaletteManager.h" />
+    <ClInclude Include="..\..\ParticleEngine.h" />
+    <ClInclude Include="..\..\Party.h" />
+    <ClInclude Include="..\..\Player.h" />
+    <ClInclude Include="..\..\PlayerFrameTable.h" />
+    <ClInclude Include="..\..\Random.h" />
+    <ClInclude Include="..\..\Render.h" />
+    <ClInclude Include="..\..\resource.h" />
+    <ClInclude Include="..\..\SaveLoad.h" />
+    <ClInclude Include="..\..\Spells.h" />
+    <ClInclude Include="..\..\SpriteObject.h" />
+    <ClInclude Include="..\..\Sprites.h" />
+    <ClInclude Include="..\..\StorylineTextTable.h" />
+    <ClInclude Include="..\..\stru10.h" />
+    <ClInclude Include="..\..\stru123.h" />
+    <ClInclude Include="..\..\stru159.h" />
+    <ClInclude Include="..\..\stru160.h" />
+    <ClInclude Include="..\..\stru176.h" />
+    <ClInclude Include="..\..\stru298.h" />
+    <ClInclude Include="..\..\stru314.h" />
+    <ClInclude Include="..\..\stru367.h" />
+    <ClInclude Include="..\..\stru6.h" />
+    <ClInclude Include="..\..\stru9.h" />
+    <ClInclude Include="..\..\texts.h" />
+    <ClInclude Include="..\..\Texture.h" />
+    <ClInclude Include="..\..\TileFrameTable.h" />
+    <ClInclude Include="..\..\Time.h" />
+    <ClInclude Include="..\..\TurnEngine.h" />
+    <ClInclude Include="..\..\UI\UIBooks.h" />
+    <ClInclude Include="..\..\UI\UIHouses.h" />
+    <ClInclude Include="..\..\VectorTypes.h" />
+    <ClInclude Include="..\..\VideoPlayer.h" />
+    <ClInclude Include="..\..\Viewport.h" />
+    <ClInclude Include="..\..\Vis.h" />
+    <ClInclude Include="..\..\Weather.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\lib\legacy_dx\d3dvec.inl" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
--- /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 19:13:07 2013 -0700
@@ -0,0 +1,592 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="lib">
+      <UniqueIdentifier>{01df770d-32ca-4bfa-8448-de7b6ae4b15c}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="Level">
+      <UniqueIdentifier>{e6df15ec-967c-40ca-b954-c78fe66daed1}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="lib\legacy_dx">
+      <UniqueIdentifier>{23711e0a-ee63-4da3-9c0d-22d02dd41747}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="lib\lua">
+      <UniqueIdentifier>{9448e73a-c435-43ee-8586-08607774a0d0}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="lib\zlib">
+      <UniqueIdentifier>{1d2c44d0-de33-46dd-a3bf-dce44afda794}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="lib\lua\lua-5.2.2">
+      <UniqueIdentifier>{501083c0-a7b6-445f-a8fb-fa12cd345924}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="UI">
+      <UniqueIdentifier>{6fea8cb0-1887-4477-a64d-16e64b5de807}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="NewUI">
+      <UniqueIdentifier>{8f45576f-cc60-4d3a-837e-deb373a67f8a}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="NewUI\Core">
+      <UniqueIdentifier>{d61aec30-ad58-4a9f-8f0a-e129f1947429}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="UI\Books">
+      <UniqueIdentifier>{c0b8b696-9a12-4b22-b8c1-0262d7fbb306}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="..\..\Level\Decoration.cpp">
+      <Filter>Level</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\zlib\adler32.c">
+      <Filter>lib\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\zlib\compress.c">
+      <Filter>lib\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\zlib\crc32.c">
+      <Filter>lib\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\zlib\deflate.c">
+      <Filter>lib\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\zlib\infblock.c">
+      <Filter>lib\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\zlib\infcodes.c">
+      <Filter>lib\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\zlib\inffast.c">
+      <Filter>lib\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\zlib\inflate.c">
+      <Filter>lib\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\zlib\inftrees.c">
+      <Filter>lib\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\zlib\infutil.c">
+      <Filter>lib\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\zlib\trees.c">
+      <Filter>lib\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\zlib\uncompr.c">
+      <Filter>lib\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\zlib\zutil.c">
+      <Filter>lib\zlib</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lapi.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lauxlib.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lbaselib.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lbitlib.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lcode.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lcorolib.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lctype.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ldblib.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ldebug.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ldo.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ldump.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lfunc.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lgc.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\linit.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\liolib.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\llex.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lmathlib.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lmem.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\loadlib.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lobject.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lopcodes.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\loslib.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lparser.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lstate.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lstring.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lstrlib.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ltable.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ltablib.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\ltm.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lua.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lundump.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lvm.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\lib\lua\lua-5.2.2\lzio.c">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\NewUI\MainMenu.cpp">
+      <Filter>NewUI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UIBooks.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UICharacter.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UiGame.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UIGuilds.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UIHouses.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UIMainMenu.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UIMsgProc.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UIOptions.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UIPartyCreation.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UIPopup.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UIRest.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UISaveLoad.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UIShops.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\UITransition.cpp">
+      <Filter>UI</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\Books\UIMapBook.cpp">
+      <Filter>UI\Books</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\Books\UINotesBooks.cpp">
+      <Filter>UI\Books</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\UI\Books\UISpellBook.cpp">
+      <Filter>UI\Books</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\_deleted.cpp" />
+    <ClCompile Include="..\..\Actor.cpp" />
+    <ClCompile Include="..\..\AIL.cpp" />
+    <ClCompile Include="..\..\Arcomage.cpp" />
+    <ClCompile Include="..\..\ArcomageCards.cpp" />
+    <ClCompile Include="..\..\AudioPlayer.cpp" />
+    <ClCompile Include="..\..\Bink_Smacker.cpp" />
+    <ClCompile Include="..\..\BSPModel.cpp" />
+    <ClCompile Include="..\..\CastSpellInfo.cpp" />
+    <ClCompile Include="..\..\Chest.cpp" />
+    <ClCompile Include="..\..\Conditions.cpp" />
+    <ClCompile Include="..\..\CShow.cpp" />
+    <ClCompile Include="..\..\DecalBuilder.cpp" />
+    <ClCompile Include="..\..\DecorationList.cpp" />
+    <ClCompile Include="..\..\Events.cpp" />
+    <ClCompile Include="..\..\FrameTableInc.cpp" />
+    <ClCompile Include="..\..\Game.cpp" />
+    <ClCompile Include="..\..\GammaControl.cpp" />
+    <ClCompile Include="..\..\GUIButton.cpp" />
+    <ClCompile Include="..\..\GUIFont.cpp" />
+    <ClCompile Include="..\..\GUIProgressBar.cpp" />
+    <ClCompile Include="..\..\GUIWindow.cpp" />
+    <ClCompile Include="..\..\IconFrameTable.cpp" />
+    <ClCompile Include="..\..\Indoor.cpp" />
+    <ClCompile Include="..\..\IndoorCameraD3D.cpp" />
+    <ClCompile Include="..\..\Items.cpp" />
+    <ClCompile Include="..\..\Keyboard.cpp" />
+    <ClCompile Include="..\..\LightmapBuilder.cpp" />
+    <ClCompile Include="..\..\LightsStack.cpp" />
+    <ClCompile Include="..\..\LOD.cpp" />
+    <ClCompile Include="..\..\Log.cpp" />
+    <ClCompile Include="..\..\mm7_2.cpp" />
+    <ClCompile Include="..\..\mm7_3.cpp" />
+    <ClCompile Include="..\..\mm7_4.cpp" />
+    <ClCompile Include="..\..\mm7_5.cpp" />
+    <ClCompile Include="..\..\mm7_6.cpp" />
+    <ClCompile Include="..\..\mm7_data.cpp" />
+    <ClCompile Include="..\..\mm7text_ru.cpp" />
+    <ClCompile Include="..\..\Monsters.cpp" />
+    <ClCompile Include="..\..\Mouse.cpp" />
+    <ClCompile Include="..\..\NPC.cpp" />
+    <ClCompile Include="..\..\ObjectList.cpp" />
+    <ClCompile Include="..\..\OSAPI.cpp" />
+    <ClCompile Include="..\..\OSWindow.cpp" />
+    <ClCompile Include="..\..\Outdoor.cpp" />
+    <ClCompile Include="..\..\Overlays.cpp" />
+    <ClCompile Include="..\..\PaletteManager.cpp" />
+    <ClCompile Include="..\..\ParticleEngine.cpp" />
+    <ClCompile Include="..\..\Party.cpp" />
+    <ClCompile Include="..\..\Player.cpp" />
+    <ClCompile Include="..\..\Random.cpp" />
+    <ClCompile Include="..\..\Render.cpp" />
+    <ClCompile Include="..\..\SaveLoad.cpp" />
+    <ClCompile Include="..\..\Spells.cpp" />
+    <ClCompile Include="..\..\SpriteObject.cpp" />
+    <ClCompile Include="..\..\Sprites.cpp" />
+    <ClCompile Include="..\..\StorylineTextTable.cpp" />
+    <ClCompile Include="..\..\stru6.cpp" />
+    <ClCompile Include="..\..\stru9.cpp" />
+    <ClCompile Include="..\..\stru10.cpp" />
+    <ClCompile Include="..\..\texts.cpp" />
+    <ClCompile Include="..\..\Texture.cpp" />
+    <ClCompile Include="..\..\TileTable.cpp" />
+    <ClCompile Include="..\..\Time.cpp" />
+    <ClCompile Include="..\..\TurnEngine.cpp" />
+    <ClCompile Include="..\..\VectorTypes.cpp" />
+    <ClCompile Include="..\..\VideoPlayer.cpp" />
+    <ClCompile Include="..\..\Viewport.cpp" />
+    <ClCompile Include="..\..\Vis.cpp" />
+    <ClCompile Include="..\..\Weather.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="..\..\Level\Decoration.h">
+      <Filter>Level</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\d3d.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\d3dcaps.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\d3drm.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\d3drmdef.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\d3drmobj.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\d3drmwin.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\d3dtypes.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\ddraw.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dinput.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dinputd.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dmdls.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dmerror.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dmksctrl.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dmplugin.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dmusbuff.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dmusicc.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dmusicf.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dmusici.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dmusics.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dsconf.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dsound.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\dvoice.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\multimon.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\rmxfguid.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\rmxftmpl.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\legacy_dx\strsafe.h">
+      <Filter>lib\legacy_dx</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\zlib\deflate.h">
+      <Filter>lib\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\zlib\infblock.h">
+      <Filter>lib\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\zlib\infcodes.h">
+      <Filter>lib\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\zlib\inffast.h">
+      <Filter>lib\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\zlib\inffixed.h">
+      <Filter>lib\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\zlib\inftrees.h">
+      <Filter>lib\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\zlib\infutil.h">
+      <Filter>lib\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\zlib\trees.h">
+      <Filter>lib\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\zlib\zconf.h">
+      <Filter>lib\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\zlib\zlib.h">
+      <Filter>lib\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\zlib\zutil.h">
+      <Filter>lib\zlib</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua.h">
+      <Filter>lib\lua</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lapi.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lauxlib.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lcode.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lctype.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\ldebug.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\ldo.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lfunc.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lgc.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\llex.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\llimits.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lmem.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lobject.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lopcodes.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lparser.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lstate.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lstring.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\ltable.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\ltm.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lua.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\luaconf.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lualib.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lundump.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lvm.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\lib\lua\lua-5.2.2\lzio.h">
+      <Filter>lib\lua\lua-5.2.2</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\NewUI\MainMenu.h">
+      <Filter>NewUI</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\NewUI\Core\UIControl.h">
+      <Filter>NewUI\Core</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\UI\UIBooks.h">
+      <Filter>UI</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\UI\UIHouses.h">
+      <Filter>UI</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\Actor.h" />
+    <ClInclude Include="..\..\AIL.h" />
+    <ClInclude Include="..\..\Arcomage.h" />
+    <ClInclude Include="..\..\AudioPlayer.h" />
+    <ClInclude Include="..\..\Autonotes.h" />
+    <ClInclude Include="..\..\Awards.h" />
+    <ClInclude Include="..\..\Bink_Smacker.h" />
+    <ClInclude Include="..\..\BSPModel.h" />
+    <ClInclude Include="..\..\CastSpellInfo.h" />
+    <ClInclude Include="..\..\Chest.h" />
+    <ClInclude Include="..\..\Conditions.h" />
+    <ClInclude Include="..\..\CShow.h" />
+    <ClInclude Include="..\..\DecalBuilder.h" />
+    <ClInclude Include="..\..\DecorationList.h" />
+    <ClInclude Include="..\..\ErrorHandling.h" />
+    <ClInclude Include="..\..\Events.h" />
+    <ClInclude Include="..\..\Events2D.h" />
+    <ClInclude Include="..\..\FactionTable.h" />
+    <ClInclude Include="..\..\FrameTableInc.h" />
+    <ClInclude Include="..\..\Game.h" />
+    <ClInclude Include="..\..\GammaControl.h" />
+    <ClInclude Include="..\..\GUIFont.h" />
+    <ClInclude Include="..\..\GUIProgressBar.h" />
+    <ClInclude Include="..\..\GUIWindow.h" />
+    <ClInclude Include="..\..\IconFrameTable.h" />
+    <ClInclude Include="..\..\Indoor.h" />
+    <ClInclude Include="..\..\Indoor_stuff.h" />
+    <ClInclude Include="..\..\IndoorCameraD3D.h" />
+    <ClInclude Include="..\..\Items.h" />
+    <ClInclude Include="..\..\Keyboard.h" />
+    <ClInclude Include="..\..\LightmapBuilder.h" />
+    <ClInclude Include="..\..\Lights.h" />
+    <ClInclude Include="..\..\LOD.h" />
+    <ClInclude Include="..\..\Log.h" />
+    <ClInclude Include="..\..\MapInfo.h" />
+    <ClInclude Include="..\..\Math.h" />
+    <ClInclude Include="..\..\MM7.h" />
+    <ClInclude Include="..\..\mm7_data.h" />
+    <ClInclude Include="..\..\Monsters.h" />
+    <ClInclude Include="..\..\Mouse.h" />
+    <ClInclude Include="..\..\NPC.h" />
+    <ClInclude Include="..\..\NZIArray.h" />
+    <ClInclude Include="..\..\ObjectList.h" />
+    <ClInclude Include="..\..\OSAPI.h" />
+    <ClInclude Include="..\..\OSInfo.h" />
+    <ClInclude Include="..\..\OSWindow.h" />
+    <ClInclude Include="..\..\Outdoor.h" />
+    <ClInclude Include="..\..\Outdoor_stuff.h" />
+    <ClInclude Include="..\..\Overlays.h" />
+    <ClInclude Include="..\..\PaletteManager.h" />
+    <ClInclude Include="..\..\ParticleEngine.h" />
+    <ClInclude Include="..\..\Party.h" />
+    <ClInclude Include="..\..\Player.h" />
+    <ClInclude Include="..\..\PlayerFrameTable.h" />
+    <ClInclude Include="..\..\Random.h" />
+    <ClInclude Include="..\..\Render.h" />
+    <ClInclude Include="..\..\resource.h" />
+    <ClInclude Include="..\..\SaveLoad.h" />
+    <ClInclude Include="..\..\Spells.h" />
+    <ClInclude Include="..\..\SpriteObject.h" />
+    <ClInclude Include="..\..\Sprites.h" />
+    <ClInclude Include="..\..\StorylineTextTable.h" />
+    <ClInclude Include="..\..\stru6.h" />
+    <ClInclude Include="..\..\stru9.h" />
+    <ClInclude Include="..\..\stru10.h" />
+    <ClInclude Include="..\..\stru123.h" />
+    <ClInclude Include="..\..\stru159.h" />
+    <ClInclude Include="..\..\stru160.h" />
+    <ClInclude Include="..\..\stru176.h" />
+    <ClInclude Include="..\..\stru298.h" />
+    <ClInclude Include="..\..\stru314.h" />
+    <ClInclude Include="..\..\stru367.h" />
+    <ClInclude Include="..\..\texts.h" />
+    <ClInclude Include="..\..\Texture.h" />
+    <ClInclude Include="..\..\TileFrameTable.h" />
+    <ClInclude Include="..\..\Time.h" />
+    <ClInclude Include="..\..\TurnEngine.h" />
+    <ClInclude Include="..\..\VectorTypes.h" />
+    <ClInclude Include="..\..\VideoPlayer.h" />
+    <ClInclude Include="..\..\Viewport.h" />
+    <ClInclude Include="..\..\Vis.h" />
+    <ClInclude Include="..\..\Weather.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="..\..\lib\legacy_dx\d3dvec.inl">
+      <Filter>lib\legacy_dx</Filter>
+    </None>
+  </ItemGroup>
+</Project>
\ No newline at end of file
--- /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 19:13:07 2013 -0700
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LocalDebuggerCommand>$(OutDir)$(TargetName)$(TargetExt)</LocalDebuggerCommand>
+    <LocalDebuggerWorkingDirectory>$(OutDir)</LocalDebuggerWorkingDirectory>
+    <DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
+    <LocalDebuggerCommandArguments>-novideo -nomarg</LocalDebuggerCommandArguments>
+  </PropertyGroup>
+</Project>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Build/init_win.bat	Wed Oct 23 19:13:07 2013 -0700
@@ -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
--- a/Events.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/Events.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -700,7 +700,7 @@
               {
                 if ( pEventID == 78 )
                 {
-                  sub_4BD8B5();
+                  HouseDialogPressCloseBtn();
                   window_SpeakInHouse->Release();
                   pParty->uFlags &= ~2;
                   if ( EnterHouse(HOUSE_DARK_GUILD_PIT) )
@@ -797,7 +797,7 @@
 
           if ( window_SpeakInHouse->par1C == 165 )
             {
-            sub_4BD8B5();
+            HouseDialogPressCloseBtn();
             pVideoPlayer->Unload();
             window_SpeakInHouse->Release();
             pParty->uFlags &= ~2;
@@ -1434,7 +1434,7 @@
               {
               pAudioPlayer->StopChannels(-1, -1);
               dialog_menu_id = HOUSE_DIALOGUE_NULL;
-              while ( sub_4BD8B5() )
+              while ( HouseDialogPressCloseBtn() )
                 ;
               pVideoPlayer->Unload();
               window_SpeakInHouse->Release();
--- a/Game.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/Game.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -2437,12 +2437,12 @@
                         uDialogueType = 0;
                       if ( uGameState == GAME_STATE_2 )
                       {
-                        while ( sub_4BD8B5() )
+                        while ( HouseDialogPressCloseBtn() )
                           ;
                       }
                       else
                       {
-                        if ( sub_4BD8B5() )
+                        if ( HouseDialogPressCloseBtn() )
                           continue;
                       }
                       GetHouseGoodbyeSpeech();
@@ -3069,7 +3069,7 @@
             _5B65B0_npcdata_rep_or_other = v56;
             dword_5B65C0 = v55 | _5B65AC_npcdata_fame_or_other | v56 | v57;
           }
-          sub_4BD8B5();
+          HouseDialogPressCloseBtn();
           //goto LABEL_434;
           /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 )
           {
--- a/Indoor.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/Indoor.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -561,7 +561,7 @@
           stru_F7B60C.face_plane.dist = pFace->pFacePlane.dist;
         }
 
-        if (stru_F8AD28.uNumLightsApplied > 0 && !(pFace->uAttributes & FACE_DO_NOT_LIGHT))
+        if (stru_F8AD28.uNumLightsApplied > 0 && !(pFace->uAttributes & FACE_INDOOR_SKY))
           pGame->pLightmapBuilder->ApplyLights(&stru_F8AD28, &stru_F7B60C, uNumVerticesa, array_507D30, pVertices, 0);
 
         if (pDecalBuilder->uNumDecals > 0)
@@ -601,8 +601,8 @@
           v27 = pBitmaps_LOD->pHardwareTextures[v23];
         }
 
-        if (pFace->uAttributes & FACE_DO_NOT_LIGHT)
-          pRenderer->DrawIndoorPolygonNoLight(uNumVerticesa, uFaceID);
+        if (pFace->uAttributes & FACE_INDOOR_SKY)
+          pRenderer->DrawIndoorSky(uNumVerticesa, uFaceID);
         else
           pRenderer->DrawIndoorPolygon(uNumVerticesa, pFace, v27, v28, PID(OBJECT_BModel, uFaceID), v17, 0);
         return;
--- a/Indoor.h	Wed Oct 23 00:02:06 2013 -0700
+++ b/Indoor.h	Wed Oct 23 19:13:07 2013 -0700
@@ -235,7 +235,7 @@
 #define FACE_TEXTURE_FRAME      0x00004000 // Texture ID is a frameset from TextureFrameTable, otherwise BitmapID
 #define FACE_OUTLINED           0x00010000 // outline face edges
 #define FACE_TEXTURE_FLOW       0x00040000 // The texture moves slowly. For horizontal facets only.
-#define FACE_DO_NOT_LIGHT       0x00400000
+#define FACE_INDOOR_SKY       0x00400000
 #define FACE_CLICKABLE          0x02000000 // Event can be triggered by clicking on the facet.
 #define FACE_PRESSURE_PLATE     0x04000000 // Event can be triggered by stepping on the facet.
 #define FACE_ETHEREAL           0x20000000 // Untouchable. You can pass through it.
--- a/Items.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/Items.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -2428,109 +2428,109 @@
 }
 //----- (004B8E3D) --------------------------------------------------------
 void GenerateStandartShopItems()
-	{
-	signed int item_count; 
-	signed int shop_index; 
-	int treasure_lvl; 
-	int item_class; 
-	int mdf;
+{
+  signed int item_count; 
+  signed int shop_index; 
+  int treasure_lvl; 
+  int item_class; 
+  int mdf;
 
-	shop_index = (signed int)window_SpeakInHouse->ptr_1C;
-	if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] )
-		{
-	    for (item_count=0; item_count<=uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count )
-		{
-		   if (shop_index<=14) //weapon shop
-			   {
-			   treasure_lvl = shopWeap_variation_ord[shop_index].treasure_level;
-			   item_class =shopWeap_variation_ord[shop_index].item_class[rand() % 4];
-			   }
-		   else if (shop_index<=28) //armor shop
-			   {
-			   mdf =0;
-			   if (item_count > 3)
-					 ++mdf;// rechek offsets
-			    treasure_lvl = shopArmr_variation_ord[2*(shop_index-15)+mdf].treasure_level;
-				item_class =shopArmr_variation_ord[2*(shop_index-15)+mdf].item_class[rand() % 4];
-			   }
-		   else if (shop_index<=41)  //magic shop
-			   {
-			   treasure_lvl = shopMagic_treasure_lvl[shop_index-28];
-			   item_class = 22;  //misc
-			   }
-		   else if (shop_index<=53) //alchemist shop
-			   {
-			    if (item_count<6)
-					{
-					pParty->StandartItemsInShops[shop_index][item_count].Reset();
-					pParty->StandartItemsInShops[shop_index][item_count].uItemID = 220;  //potion bottle
-					continue;
-					}
-				else
-					{
-					treasure_lvl = shopAlch_treasure_lvl[shop_index-41];
-					item_class = 45;  //reagent
-					}
-			   }
-		   pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->StandartItemsInShops[shop_index][item_count]);
-		   pParty->StandartItemsInShops[shop_index][item_count].SetIdentified();  //identified
-		}
-		}
-	pParty->InTheShopFlags[shop_index] = 0;
-	}
+  shop_index = (signed int)window_SpeakInHouse->ptr_1C;
+  if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] )
+  {
+    for (item_count = 0; item_count < uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count )
+    {
+      if (shop_index <= 14) //weapon shop
+      {
+        treasure_lvl = shopWeap_variation_ord[shop_index].treasure_level;
+        item_class = shopWeap_variation_ord[shop_index].item_class[rand() % 4];
+      }
+      else if (shop_index <= 28) //armor shop
+      {
+        mdf = 0;
+        if (item_count > 3)
+          ++mdf;// rechek offsets
+        treasure_lvl = shopArmr_variation_ord[2*(shop_index - 15) + mdf].treasure_level;
+        item_class = shopArmr_variation_ord[2*(shop_index - 15) + mdf].item_class[rand() % 4];
+      }
+      else if (shop_index <= 41)  //magic shop
+      {
+        treasure_lvl = shopMagic_treasure_lvl[shop_index - 28];
+        item_class = 22;  //misc
+      }
+      else if (shop_index <= 53) //alchemist shop
+      {
+        if (item_count < 6)
+        {
+          pParty->StandartItemsInShops[shop_index][item_count].Reset();
+          pParty->StandartItemsInShops[shop_index][item_count].uItemID = 220;  //potion bottle
+          continue;
+        }
+        else
+        {
+          treasure_lvl = shopAlch_treasure_lvl[shop_index - 41];
+          item_class = 45;  //reagent
+        }
+      }
+      pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->StandartItemsInShops[shop_index][item_count]);
+      pParty->StandartItemsInShops[shop_index][item_count].SetIdentified();  //identified
+    }
+  }
+  pParty->InTheShopFlags[shop_index] = 0;
+}
 
 //----- (004B8F94) --------------------------------------------------------
 void  GenerateSpecialShopItems()
-	{
-	signed int item_count; 
-	signed int shop_index; 
-	int treasure_lvl; 
-	int item_class; 
-	int mdf;
+{
+  signed int item_count; 
+  signed int shop_index; 
+  int treasure_lvl; 
+  int item_class; 
+  int mdf;
 
-	shop_index = (signed int)window_SpeakInHouse->ptr_1C;
-	if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] )
-		{
-		for (item_count=0; item_count<=uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count )
-			{
-			if (shop_index<=14) //weapon shop
-				{
-				treasure_lvl = shopWeap_variation_spc[shop_index].treasure_level;
-				item_class =  shopWeap_variation_spc[shop_index].item_class[rand() % 4];
-				}
-			else if (shop_index<=28) //armor shop
-				{
-				mdf =0;
-				if (item_count > 3)
-					++mdf;
-				treasure_lvl = shopArmr_variation_spc[2*(shop_index-15)+mdf].treasure_level;
-				item_class =shopArmr_variation_spc[2*(shop_index-15)+mdf].item_class[rand() % 4];
-				}
-			else if (shop_index<=41)  //magic shop
-				{
-				treasure_lvl = shopMagicSpc_treasure_lvl[shop_index-28];
-				item_class = 22;  //misc
-				}
-			else if (shop_index<=53) //alchemist shop
-				{
-				if (item_count<6)
-					{
-					pParty->SpecialItemsInShops[shop_index][item_count].Reset();
-					pParty->SpecialItemsInShops[shop_index][item_count].uItemID = rand() % 32 + 740;  //mscrool
-					continue;
-					}
-				else
-					{
-					treasure_lvl = shopAlchSpc_treasure_lvl[shop_index-41];
-					item_class = 44;  //potion
-					}
-				}
-			pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->SpecialItemsInShops[shop_index][item_count]);
-			pParty->SpecialItemsInShops[shop_index][item_count].SetIdentified();  //identified
-			}
-		}
-	pParty->InTheShopFlags[shop_index] = 0;
-	}
+  shop_index = (signed int)window_SpeakInHouse->ptr_1C;
+  if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] )
+  {
+    for ( item_count = 0; item_count < uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count )
+    {
+      if (shop_index <= 14) //weapon shop
+      {
+        treasure_lvl = shopWeap_variation_spc[shop_index].treasure_level;
+        item_class =  shopWeap_variation_spc[shop_index].item_class[rand() % 4];
+      }
+      else if (shop_index <= 28) //armor shop
+      {
+        mdf = 0;
+        if (item_count > 3)
+          ++mdf;
+        treasure_lvl = shopArmr_variation_spc[2*(shop_index - 15) + mdf].treasure_level;
+        item_class = shopArmr_variation_spc[2*(shop_index - 15) + mdf].item_class[rand() % 4];
+      }
+      else if (shop_index <= 41)  //magic shop
+      {
+        treasure_lvl = shopMagicSpc_treasure_lvl[shop_index - 28];
+        item_class = 22;  //misc
+      }
+      else if (shop_index <= 53) //alchemist shop
+      {
+        if (item_count < 6)
+        {
+          pParty->SpecialItemsInShops[shop_index][item_count].Reset();
+          pParty->SpecialItemsInShops[shop_index][item_count].uItemID = rand() % 32 + 740;  //mscrool
+          continue;
+        }
+        else
+        {
+          treasure_lvl = shopAlchSpc_treasure_lvl[shop_index - 41];
+          item_class = 44;  //potion
+        }
+      }
+      pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->SpecialItemsInShops[shop_index][item_count]);
+      pParty->SpecialItemsInShops[shop_index][item_count].SetIdentified();  //identified
+    }
+  }
+  pParty->InTheShopFlags[shop_index] = 0;
+}
 
 
 //----- (00450218) --------------------------------------------------------
Binary file MM7_manifest.rc has changed
Binary file Might and Magic Trilogy.rc has changed
--- a/OSAPI.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/OSAPI.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -7,6 +7,7 @@
 
 
 
+
 //----- (00462C94) --------------------------------------------------------
 int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE, wchar_t *lpCmdLine, int nShowCmd)
 {
--- a/OSWindow.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/OSWindow.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -787,4 +787,4 @@
   }
 
   return true;
-}
\ No newline at end of file
+}
--- a/Outdoor.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/Outdoor.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -113,7 +113,7 @@
 
   if (pRenderer->pRenderD3D) // d3d - redraw always
   {
-    pRenderer->DrawSkyD3D();
+    pRenderer->DrawOutdoorSkyD3D();
     pRenderer->DrawBuildingsD3D();
     pRenderer->RenderTerrainD3D();
   }
--- a/Player.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/Player.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -5003,7 +5003,8 @@
     case VAR_QBits_QuestsDone:
       return _449B57_test_bit(pParty->_quest_bits, pValue);
     case VAR_PlayerItemInHands:
-      for (int i = 0; i < 138; i++)
+      //for (int i = 0; i < 138; i++)
+      for (int i = 0; i < 126; i++)
       {
         if (pInventoryItemList[i].uItemID == pValue)
         {
--- a/Render.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/Render.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -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
@@ -4925,7 +4925,7 @@
 // 4D864C: using guessed type char byte_4D864C;
 
 //----- (004A2DA3) --------------------------------------------------------
-void Render::DrawSkyPolygon(unsigned int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture)
+void Render::DrawOutdoorSkyPolygon(unsigned int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture)
 {
   int v7; // eax@7
 
@@ -4962,7 +4962,7 @@
 }
 
 //----- (004A2ED5) --------------------------------------------------------
-void Render::_4A2ED5(signed int a2, struct Polygon *a3, IDirect3DTexture2 *pHwTex)
+void Render::DrawIndoorSkyPolygon(signed int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture)
 {
   signed int v4; // edi@2
   int v5; // eax@3
@@ -4975,15 +4975,15 @@
 
   if ( this->uNumD3DSceneBegins )
   {
-    v4 = a2;
-    if ( a2 >= 3 )
+    v4 = uNumVertices;
+    if ( uNumVertices >= 3 )
     {
       ErrD3D(pRenderD3D->pDevice->SetTextureStageState(0, D3DTSS_ADDRESS, D3DTADDRESS_WRAP));
-      v5 = 31 - (a3->dimming_level & 0x1F);
+      v5 = 31 - (pSkyPolygon->dimming_level & 0x1F);
       if ( v5 < pOutdoor->max_terrain_dimming_level )
         v5 = pOutdoor->max_terrain_dimming_level;
       v6 = 8 * v5 | ((8 * v5 | (v5 << 11)) << 8);
-	  for (uint i = 0; i < a2; ++i)
+	  for (uint i = 0; i < uNumVertices; ++i)
 	  {
 		d3d_vertex_buffer[i].pos.x = array_507D30[i].vWorldViewProjX;
 		d3d_vertex_buffer[i].pos.y = array_507D30[i].vWorldViewProjY;
@@ -4995,19 +4995,18 @@
 		d3d_vertex_buffer[i].texcoord.y = array_507D30[i].v;
 	  }
 
-      ErrD3D(pRenderD3D->pDevice->SetTexture(0, pHwTex));
+      ErrD3D(pRenderD3D->pDevice->SetTexture(0, pTexture));
       ErrD3D(pRenderD3D->pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN,
         D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1,
         d3d_vertex_buffer,
-        a2,
+        uNumVertices,
         28));
     }
   }
 }
 
-
 //----- (00479A53) --------------------------------------------------------
-void Render::DrawIndoorPolygonNoLight(unsigned int uNumVertices, unsigned int uFaceID)
+void Render::DrawIndoorSky(unsigned int uNumVertices, unsigned int uFaceID)
 {
   BLVFace *pFace; // esi@1
   //unsigned int v3; // edi@1
@@ -5034,7 +5033,7 @@
   double v24; // st7@16
   unsigned __int8 v25; // sf@16
   unsigned __int8 v26; // of@16
-  Render *v27; // ecx@17
+  //Render *v27; // ecx@17
   double v28; // st7@20
   char *v29; // ebx@20
   char *v30; // edx@20
@@ -5069,7 +5068,7 @@
   signed int v59; // [sp-4h] [bp-178h]@17
   struct Polygon *v60; // [sp+0h] [bp-174h]@17
   IDirect3DTexture2 *v61; // [sp+4h] [bp-170h]@17
-  struct Polygon v62; // [sp+14h] [bp-160h]@6
+  struct Polygon pSkyPoligon; // [sp+14h] [bp-160h]@6
   unsigned int v63; // [sp+120h] [bp-54h]@7
   //double v64; // [sp+124h] [bp-50h]@7
   unsigned int v65; // [sp+128h] [bp-4Ch]@1
@@ -5104,55 +5103,55 @@
     return;
   }
 
-  *(float *)&v74 = (double)pBLVRenderParams->uViewportCenterY;
+  //*(float *)&v74 = (double)pBLVRenderParams->uViewportCenterY;
   v70 = (signed __int64)((double)(pBLVRenderParams->fov_rad_fixpoint * pGame->pIndoorCameraD3D->vPartyPos.z)
                        / (((double)pBLVRenderParams->fov_rad_fixpoint + 16192.0)
                         * 65536.0)
-                       + *(float *)&v74);
+                       + (double)pBLVRenderParams->uViewportCenterY);
   v5 = (double)pGame->pIndoorCameraD3D->sRotationX * 0.0030664064;
-  *(float *)&v75 = v5;
-  v6 = (signed __int64)(*(float *)&v74
+  //*(float *)&v75 = v5;
+  v6 = (signed __int64)((double)pBLVRenderParams->uViewportCenterY
                       - (double)pBLVRenderParams->fov_rad_fixpoint
                       / ((cos(v5) * 16192.0 + 0.0000001)
                        * 65535.0)
-                      * (sin(*(float *)&v75) * -16192.0 - (double)pGame->pIndoorCameraD3D->vPartyPos.z));
+                      * (sin(v5) * -16192.0 - (double)pGame->pIndoorCameraD3D->vPartyPos.z));
 
 
   stru_8019C8._48653D_frustum_blv(65536, 0, 0, 0, 65536, 0);
-  v62.Create_48607B(&stru_8019C8);
-  v62.uTileBitmapID = pFace->uBitmapID;
-
-  v62.pTexture = pBitmaps_LOD->GetTexture(v62.uTileBitmapID);
-  if ( !v62.pTexture )
+  pSkyPoligon.Create_48607B(&stru_8019C8);
+  pSkyPoligon.uTileBitmapID = pFace->uBitmapID;
+
+  pSkyPoligon.pTexture = pBitmaps_LOD->GetTexture(pSkyPoligon.uTileBitmapID);
+  if ( !pSkyPoligon.pTexture )
     return;
 
-  v62.dimming_level = 0;
-  v62.uNumVertices = uNumVertices;
-  v62.v_18.y = 0;
-  v62.v_18.x = -stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationX + 16);
-  v62.v_18.z = -stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationX + 16);
+  pSkyPoligon.dimming_level = 0;
+  pSkyPoligon.uNumVertices = uNumVertices;
+  pSkyPoligon.v_18.y = 0;
+  pSkyPoligon.v_18.x = -stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationX + 16);
+  pSkyPoligon.v_18.z = -stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationX + 16);
   memcpy(&array_507D30[uNumVertices], array_507D30, sizeof(array_507D30[uNumVertices]));
-  v62.field_24 = 0x2000000;
+  pSkyPoligon.field_24 = 0x2000000;
 
   extern float _calc_fov(int viewport_width, int angle_degree);
   //v64 = (double)(signed int)(pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX) * 0.5;
   //v72 = 65536 / (signed int)(signed __int64)(v64 / tan(0.6457717418670654) + 0.5);
   v72 = 65536.0f / _calc_fov(pBLVRenderParams->uViewportZ - pBLVRenderParams->uViewportX, 74);
-  v12 = v62.pTexture->uWidthMinus1;
-  v13 = v62.pTexture->uHeightMinus1;
-  v67 = 1.0 / (double)v62.pTexture->uTextureWidth;
+  v12 = pSkyPoligon.pTexture->uWidthMinus1;
+  v13 = pSkyPoligon.pTexture->uHeightMinus1;
+  v67 = 1.0 / (double)pSkyPoligon.pTexture->uTextureWidth;
   v63 = 224 * pMiscTimer->uTotalGameTimeElapsed & v13;
   v66 = 224 * pMiscTimer->uTotalGameTimeElapsed & v12;
   v78 = 0;
   v81 = 0;
-  float v68 = 1.0 / (double)v62.pTexture->uTextureHeight;
-  if ( (signed int)v62.uNumVertices <= 0 )
+  float v68 = 1.0 / (double)pSkyPoligon.pTexture->uTextureHeight;
+  if ( (signed int)pSkyPoligon.uNumVertices <= 0 )
   {
 LABEL_17:
-    v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID];
-    v27 = pRenderer;
-    v60 = &v62;
-    v59 = v62.uNumVertices;
+    v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPoligon.uTileBitmapID];
+    //v27 = pRenderer;
+    v60 = &pSkyPoligon;
+    v59 = pSkyPoligon.uNumVertices;
     goto LABEL_18;
   }
 
@@ -5161,18 +5160,18 @@
   while ( 2 )
   {
     v15 = (void *)(v72 * (v70 - (int)array_507D30[_507D30_idx].vWorldViewProjY));
-    v77 = (unsigned __int64)(v62.ptr_38->viewing_angle_from_west_east * (signed __int64)(signed int)v15) >> 16;
-    v74 = v77 + v62.ptr_38->angle_from_north;
+    v77 = (unsigned __int64)(pSkyPoligon.ptr_38->viewing_angle_from_west_east * (signed __int64)(signed int)v15) >> 16;
+    v74 = v77 + pSkyPoligon.ptr_38->angle_from_north;
     v77 = (int)v15;
-    v77 = (unsigned __int64)(v62.ptr_38->viewing_angle_from_north_south * (signed __int64)(signed int)v15) >> 16;
+    v77 = (unsigned __int64)(pSkyPoligon.ptr_38->viewing_angle_from_north_south * (signed __int64)(signed int)v15) >> 16;
     v79 = v15;
-    v75 = (RenderVertexSoft *)(v77 + v62.ptr_38->angle_from_east);
-    v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v15) >> 16);
+    v75 = (RenderVertexSoft *)(v77 + pSkyPoligon.ptr_38->angle_from_east);
+    v79 = (void *)((unsigned __int64)(pSkyPoligon.v_18.z * (signed __int64)(signed int)v15) >> 16);
     v17 = v72 * (pBLVRenderParams->uViewportCenterX - (int)array_507D30[_507D30_idx].vWorldViewProjX);
     v18 = array_507D30[_507D30_idx].vWorldViewProjY - 1.0;
-    v19 = -v62.field_24;
-    v77 = -v62.field_24;
-    X = (int)((char *)v79 + v62.v_18.x);
+    v19 = -pSkyPoligon.field_24;
+    v77 = -pSkyPoligon.field_24;
+    X = (int)((char *)v79 + pSkyPoligon.v_18.x);
     LODWORD(v76) = (signed __int64)v18;
     v20 = (void *)(v72 * (v70 - LODWORD(v76)));
     while ( 1 )
@@ -5188,11 +5187,11 @@
       v19 = v77;
       v20 = v79;
 LABEL_14:
-      v79 = (void *)((unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16);
-      v22 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v20) >> 16;
+      v79 = (void *)((unsigned __int64)(pSkyPoligon.v_18.z * (signed __int64)(signed int)v20) >> 16);
+      v22 = (unsigned __int64)(pSkyPoligon.v_18.z * (signed __int64)(signed int)v20) >> 16;
       --LODWORD(v76);
       v20 = (char *)v20 + v72;
-      X = v22 + v62.v_18.x;
+      X = v22 + pSkyPoligon.v_18.x;
       v78 = 1;
     }
     if ( !v78 )
@@ -5202,8 +5201,8 @@
       v79 = (void *)(v23 / X);
       v77 = v17;
       v77 = v17;
-      LODWORD(v76) = v74 + ((unsigned __int64)(v62.ptr_38->angle_from_west * (signed __int64)v17) >> 16);
-      v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(v62.ptr_38->angle_from_south * (signed __int64)v17) >> 16));
+      LODWORD(v76) = v74 + ((unsigned __int64)(pSkyPoligon.ptr_38->angle_from_west * (signed __int64)v17) >> 16);
+      v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(pSkyPoligon.ptr_38->angle_from_south * (signed __int64)v17) >> 16));
       v77 = (unsigned __int64)(SLODWORD(v76) * v23 / X) >> 16;
       LODWORD(v73) = (unsigned __int64)((signed int)v75 * v23 / X) >> 16;
       //v14 += 48;
@@ -5211,8 +5210,8 @@
       v81 = (char *)v81 + 1;
       v24 = (double)SLODWORD(v80) * 0.000015259022;
       LODWORD(v80) = v63 + ((signed int)((unsigned __int64)((signed int)v75 * v23 / X) >> 16) >> 4);
-      v26 = __OFSUB__((int)v81, v62.uNumVertices);
-      v25 = (signed int)((char *)v81 - v62.uNumVertices) < 0;
+      v26 = __OFSUB__((int)v81, pSkyPoligon.uNumVertices);
+      v25 = (signed int)((char *)v81 - pSkyPoligon.uNumVertices) < 0;
       array_507D30[_507D30_idx].u = v24 * v67;
       array_507D30[_507D30_idx].v = (double)SLODWORD(v80) * 0.000015259022 * v68;
       array_507D30[_507D30_idx]._rhw = 65536.0 / (double)(signed int)v79;
@@ -5225,7 +5224,7 @@
   }
   LODWORD(v73) = 0;
   v80 = v76;
-  if ( (signed int)v62.uNumVertices > 0 )
+  if ( (signed int)pSkyPoligon.uNumVertices > 0 )
   {
     v28 = (double)SLODWORD(v76);
     LODWORD(v76) = (int)(char *)array_50AC10 + 28;
@@ -5233,7 +5232,7 @@
     v30 = (char *)&array_507D30[1].vWorldViewProjY;
     v79 = array_50AC10;
     v81 = array_507D30;
-    v78 = v62.uNumVertices;
+    v78 = pSkyPoligon.uNumVertices;
     do
     {
       v31 = v28 < *((float *)v30 - 12);
@@ -5276,17 +5275,17 @@
   do
   {
     v35 = (const void *)(v72 * (v70 - (unsigned __int64)(signed __int64)*(float *)v34));
-    v78 = v62.ptr_38->viewing_angle_from_west_east;
+    v78 = pSkyPoligon.ptr_38->viewing_angle_from_west_east;
     v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
-    v36 = (int)((char *)v81 + v62.ptr_38->angle_from_north);
+    v36 = (int)((char *)v81 + pSkyPoligon.ptr_38->angle_from_north);
     v81 = v35;
     v74 = v36;
-    v78 = v62.ptr_38->viewing_angle_from_north_south;
+    v78 = pSkyPoligon.ptr_38->viewing_angle_from_north_south;
     v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v35) >> 16);
     v78 = (int)v35;
-    v75 = (RenderVertexSoft *)((char *)v81 + v62.ptr_38->angle_from_east);
-    v81 = (const void *)v62.v_18.z;
-    v78 = (unsigned __int64)(v62.v_18.z * (signed __int64)(signed int)v35) >> 16;
+    v75 = (RenderVertexSoft *)((char *)v81 + pSkyPoligon.ptr_38->angle_from_east);
+    v81 = (const void *)pSkyPoligon.v_18.z;
+    v78 = (unsigned __int64)(pSkyPoligon.v_18.z * (signed __int64)(signed int)v35) >> 16;
     v37 = (const void *)(v72
                        * (pBLVRenderParams->uViewportCenterX - (unsigned __int64)(signed __int64)*((float *)v34 - 1)));
     v38 = (signed __int64)(*(float *)v34 - 1.0);
@@ -5305,34 +5304,34 @@
         break;
       v39 = v78;
 LABEL_36:
-      v78 = v62.v_18.z;
-      v41 = (unsigned __int64)(v62.v_18.z * (signed __int64)v39) >> 16;
+      v78 = pSkyPoligon.v_18.z;
+      v41 = (unsigned __int64)(pSkyPoligon.v_18.z * (signed __int64)v39) >> 16;
       --LODWORD(v76);
       v39 += v72;
-      X = v41 + v62.v_18.x;
+      X = v41 + pSkyPoligon.v_18.x;
       v81 = (const void *)1;
     }
     if ( v81 )
     {
-      v79 = (void *)v62.v_18.z;
+      v79 = (void *)pSkyPoligon.v_18.z;
       v78 = 2 * LODWORD(v76);
-      v81 = (const void *)((unsigned __int64)(v62.v_18.z
+      v81 = (const void *)((unsigned __int64)(pSkyPoligon.v_18.z
                                             * (signed __int64)(signed int)(signed __int64)(((double)v70
                                                                                           - ((double)(2 * LODWORD(v76))
                                                                                            - *(float *)v34))
                                                                                          * (double)v72)) >> 16);
-      X = (int)((char *)v81 + v62.v_18.x);
+      X = (int)((char *)v81 + pSkyPoligon.v_18.x);
     }
     LODWORD(v42) = v77 << 16;
     HIDWORD(v42) = v77 >> 16;
     v79 = (void *)(v42 / X);
     v81 = v37;
-    v78 = v62.ptr_38->angle_from_west;
+    v78 = pSkyPoligon.ptr_38->angle_from_west;
     v81 = (const void *)((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
     v43 = v74 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16);
     v74 = (unsigned int)v37;
     LODWORD(v76) = v43;
-    v78 = v62.ptr_38->angle_from_south;
+    v78 = pSkyPoligon.ptr_38->angle_from_south;
     v75 = (RenderVertexSoft *)((char *)v75 + ((unsigned __int64)(v78 * (signed __int64)(signed int)v37) >> 16));
     v74 = (unsigned __int64)(v43 * v42 / X) >> 16;
     v81 = (const void *)((unsigned __int64)((signed int)v75 * v42 / X) >> 16);
@@ -5370,8 +5369,8 @@
     }
     while ( HIDWORD(v69) );
   }
-  v62.uNumVertices = v47;
-  pRenderer->_4A2ED5(v47, &v62, pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID]);
+  pSkyPoligon.uNumVertices = v47;
+  pRenderer->DrawIndoorSkyPolygon(v47, &pSkyPoligon, pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPoligon.uTileBitmapID]);
   *(float *)&v74 = 0.0;
   if ( SLODWORD(v73) > 0 )
   {
@@ -5393,13 +5392,13 @@
     }
     while ( v80 != 0.0 );
   }
-  v62.uNumVertices = v74;
-  v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)v62.uTileBitmapID];
-  v60 = &v62;
+  pSkyPoligon.uNumVertices = v74;
+  v61 = pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPoligon.uTileBitmapID];
+  v60 = &pSkyPoligon;
   v59 = v74;
-  v27 = pRenderer;
+  //v27 = pRenderer;
 LABEL_18:
-  v27->_4A2ED5(v59, v60, v61);
+  pRenderer->DrawIndoorSkyPolygon(v59, v60, v61);
 }
 
 
@@ -8885,7 +8884,7 @@
             array_77EC08[pODMRenderParams->uNumPolygons].pTexture = pFaceTexture;
             if (pOutdoor->pBModels[model_id].pFaces[face_id].uAttributes & FACE_FLUID)
               array_77EC08[pODMRenderParams->uNumPolygons].flags |= 2;
-            if (pOutdoor->pBModels[model_id].pFaces[face_id].uAttributes & FACE_DO_NOT_LIGHT )
+            if (pOutdoor->pBModels[model_id].pFaces[face_id].uAttributes & FACE_INDOOR_SKY )
               HIBYTE(array_77EC08[pODMRenderParams->uNumPolygons].flags) |= 4;
             if ( pOutdoor->pBModels[model_id].pFaces[face_id].uAttributes & 4 )
               HIBYTE(array_77EC08[pODMRenderParams->uNumPolygons].flags) |= 4;
@@ -9046,7 +9045,7 @@
   return;
 }
 //----- (00479543) --------------------------------------------------------
-void Render::DrawSkyD3D()
+void Render::DrawOutdoorSkyD3D()
 {
   int v9; // eax@4
   int v10; // ebx@4
@@ -9189,12 +9188,12 @@
       array_50AC10[i].vWorldViewPosition.x = (double)0x2000;//pODMRenderParams->shading_dist_mist
       array_50AC10[i]._rhw = 1.0 / (double)(v18 >> 16);
     }
-    pRenderer->DrawSkyPolygon(pSkyPolygon.uNumVertices, &pSkyPolygon, pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPolygon.uTileBitmapID]);
+    pRenderer->DrawOutdoorSkyPolygon(pSkyPolygon.uNumVertices, &pSkyPolygon, pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPolygon.uTileBitmapID]);
     array_50AC10[0].vWorldViewProjY = (double)v38;
     array_50AC10[1].vWorldViewProjY = array_50AC10[1].vWorldViewProjY + 30.0;
     array_50AC10[2].vWorldViewProjY = array_50AC10[2].vWorldViewProjY + 30.0;
     array_50AC10[3].vWorldViewProjY = (double)v38;
-    pRenderer->DrawSkyPolygon(pSkyPolygon.uNumVertices, &pSkyPolygon, pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPolygon.uTileBitmapID]);
+    pRenderer->DrawOutdoorSkyPolygon(pSkyPolygon.uNumVertices, &pSkyPolygon, pBitmaps_LOD->pHardwareTextures[(signed __int16)pSkyPolygon.uTileBitmapID]);
     return;
   }
 }
--- a/Render.h	Wed Oct 23 00:02:06 2013 -0700
+++ b/Render.h	Wed Oct 23 19:13:07 2013 -0700
@@ -320,10 +320,10 @@
   unsigned int GetActorTintColor(float a2, int tint, int a4, int a5, RenderBillboard *a6);
   void DrawPolygon(unsigned int uNumVertices, struct Polygon *a3, ODMFace *a4, IDirect3DTexture2 *pTexture);
   void DrawTerrainPolygon(unsigned int uNumVertices, struct Polygon *a4, IDirect3DTexture2 *a5, bool transparent, bool clampAtTextureBorders);
-  void DrawSkyPolygon(unsigned int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture);
-  void _4A2ED5(signed int a2, struct Polygon *a3, IDirect3DTexture2 *pHwTex);
+  void DrawOutdoorSkyPolygon(unsigned int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture);
+  void DrawIndoorSkyPolygon(signed int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture);
   void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture *pTex, int uPackedID, unsigned int uColor, int a8);
-  void DrawIndoorPolygonNoLight(unsigned int uNumVertices, unsigned int uFaceID);
+  void DrawIndoorSky(unsigned int uNumVertices, unsigned int uFaceID);
   void MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle);
   void MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle);
   void TransformBillboard(RenderBillboardTransform_local0 *a2, Sprite *pSprite, int dimming_level, RenderBillboard *pBillboard);
@@ -357,7 +357,7 @@
   void DrawBuildingsD3D();
   //struct BSPModel *DrawBuildingsSW();
   //int OnOutdoorRedrawSW();
-  void DrawSkyD3D();
+  void DrawOutdoorSkyD3D();
   //int DrawSkySW(struct Span *a1, Polygon *a2, int a3);
   void PrepareDecorationsRenderList_ODM();
   void DrawSpriteObjects_ODM();
--- a/UI/UIGuilds.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/UI/UIGuilds.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -16,46 +16,20 @@
 void GuildDialog()
 {
   signed int base_teach_price; // ebx@1
-  int v3; // edi@6
-  int result; // eax@11
   int v6; // esi@13
   signed int v7; // esi@17
   int v8; // esi@22
-  signed int v9; // ecx@22
-  char *v10; // eax@22
   const char *statusbar_string; // ecx@26
-  POINT *v12; // esi@30
   int v13; // ecx@30
   ItemGen *v15; // ST18_4@31
   int v17; // eax@31
   char *v18; // edx@31
-  int pActiveItem; // esi@35
-  int v24; // eax@39
-  int v25; // eax@40
   int v26; // ecx@47
   GUIButton *pButton; // eax@49
   int pTextHeight; // eax@55
   unsigned __int16 pTextColor; // ax@55
-  int v35; // eax@58
-  const char *v36; // ST20_4@61
-  unsigned __int16 v37; // ST1C_2@61
-  int v40; // [sp-14h] [bp-300h]@31
-  int v41; // [sp-10h] [bp-2FCh]@31
-  unsigned __int16 v42; // [sp-Ch] [bp-2F8h]@31
-  char *v43; // [sp-8h] [bp-2F4h]@31
-  unsigned int v44; // [sp-4h] [bp-2F0h]@31
-  char Dest[100]; // [sp+Ch] [bp-2E0h]@3
-  char v46[100]; // [sp+70h] [bp-27Ch]@3
-  char v47[100]; // [sp+D4h] [bp-218h]@3
-  char v48[100]; // [sp+138h] [bp-1B4h]@3
-  char v49[100]; // [sp+19Ch] [bp-150h]@3
-  POINT v50; // [sp+264h] [bp-88h]@30
-  POINT v51; // [sp+26Ch] [bp-80h]@30
+  POINT cursor; // [sp+26Ch] [bp-80h]@30
   GUIWindow working_window; // [sp+274h] [bp-78h]@1
-  signed int v53; // [sp+27Ch] [bp-70h]@1
-  signed int v54; // [sp+284h] [bp-68h]@1
-  int pColorWhite; // [sp+2CCh] [bp-20h]@1
-  int pColorYellow; // [sp+2D0h] [bp-1Ch]@1
   int v58; // [sp+2D4h] [bp-18h]@1
   bool pSkillFlag; // [sp+2DCh] [bp-10h]@35
   int v61; // [sp+2E0h] [bp-Ch]@35
@@ -68,24 +42,17 @@
   working_window.uFrameX = 483;
   working_window.uFrameWidth = 148;
   working_window.uFrameZ = 334;
-  pColorWhite = TargetColor(0xFFu, 0xFFu, 0xFFu);
-  pColorYellow = TargetColor(0xFFu, 0xFFu, 0x9Bu);
   base_teach_price = (signed __int64)(p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].fPriceMultiplier * 500.0);
   pPrice = base_teach_price * (100 - pPlayers[uActiveCharacter]->GetMerchant()) / 100;
   if ( pPrice < base_teach_price / 3 )
     pPrice = base_teach_price / 3;
-  strcpy(Dest, "");
-  strcpy(v46, "");
-  strcpy(v47, "");
-  strcpy(v48, "");
-  strcpy(v49, "");
   if ( dialog_menu_id == HOUSE_DIALOGUE_MAIN )
   {
     if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)pPlayers[uActiveCharacter]->_achieved_awards_bits,
-            guild_mambership_flags[(unsigned int)window_SpeakInHouse->ptr_1C-139]) )
+            guild_mambership_flags[(unsigned int)window_SpeakInHouse->ptr_1C - 139]) )
     { //you must me member
       pTextHeight = pFontArrus->CalcTextHeight(pNPCTopics[121].pText, &working_window, 0, 0);
-      working_window.DrawTitleText(pFontArrus, 0, (212 - pTextHeight) / 2 + 101, pColorYellow, pNPCTopics[121].pText, 3);
+      working_window.DrawTitleText(pFontArrus, 0, (212 - pTextHeight) / 2 + 101, TargetColor(0xFFu, 0xFFu, 0x9Bu), pNPCTopics[121].pText, 3);
       pDialogueWindow->pNumPresenceButton = 0;
       return;
     }
@@ -97,7 +64,7 @@
       strcat(pTmpBuf.data(), "\n \n");
       strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
       pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &working_window, 0, 0);
-      working_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
+      working_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
       return;
     }
     v61 = 0;
@@ -128,7 +95,7 @@
       strcat(pTmpBuf.data(), "\n \n");
       strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); //"I can offer you nothing further."
       pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &working_window, 0, 0);
-      working_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorYellow, pTmpBuf.data(), 3);
+      working_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0x9Bu), pTmpBuf.data(), 3);
       return;
     }
     if ( pSkillFlag )
@@ -151,9 +118,9 @@
         pButton->uHeight = pTextHeight;
         v26 = pButton->uY + pTextHeight - 1;
         pButton->uW = v26;
-        pTextColor = pColorYellow;
+        pTextColor = TargetColor(0xFFu, 0xFFu, 0x9Bu);
         if ( pDialogueWindow->pCurrentPosActiveItem != i )
-          pTextColor = pColorWhite;
+          pTextColor = TargetColor(0xFFu, 0xFFu, 0xFFu);
         working_window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pGlobalTXT_LocalizationStrings[400], 3);//"Buy Spells"
       }
       else
@@ -166,9 +133,9 @@
           pButton->uHeight = pTextHeight;
           v26 = pButton->uY + pTextHeight - 1;
           pButton->uW = v26;
-          pTextColor = pColorYellow;
+          pTextColor = TargetColor(0xFFu, 0xFFu, 0x9Bu);
           if ( pDialogueWindow->pCurrentPosActiveItem != i )
-            pTextColor = pColorWhite;
+            pTextColor = TargetColor(0xFFu, 0xFFu, 0xFFu);
           working_window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pSkillNames[pButton->msg_param - 36], 3);
         }
         else
@@ -211,63 +178,56 @@
     if ( HouseUI_CheckIfPlayerCanInteract() )
     {
       v8 = 0;
-      for ( v9 = 12; v9; --v9 )
+      for ( uint i = 0; i < 12; ++i )
       {
-        if ( pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C-139][v9].uItemID > 0 )
+        if ( pParty->SpellBooksInGuilds[window_SpeakInHouse->par1C - 139][i].uItemID > 0 )
           ++v8;
       }
       GetAsyncKeyState(17);
-      statusbar_string = pGlobalTXT_LocalizationStrings[195]; //"Select the Item to Buy"
-      if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
-        statusbar_string = pGlobalTXT_LocalizationStrings[196]; //"Select the Special Item to Buy"	
-      DrawTextAtStatusBar(statusbar_string, 0);
+      DrawTextAtStatusBar(pGlobalTXT_LocalizationStrings[195], 0);//"Select the Item to Buy"
       if ( !v8 )
       {
-        working_window.DrawShops_next_generation_time_string(pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C] - pParty->uTimePlayed);//"Ïðèõîäèòå ÷åðåç 14 äíåé"
+        working_window.DrawShops_next_generation_time_string(pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C - 139] - pParty->uTimePlayed);//"Ïðèõîäèòå ÷åðåç 14 äíåé"
         return;
       }
-      v12 = pMouse->GetCursorPos(&v51);
-      result = v12->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v50)->y];
-      v13 = pRenderer->pActiveZBuffer[result] & 0xFFFF;
-      if ( pRenderer->pActiveZBuffer[result] & 0xFFFF )
+      pMouse->GetCursorPos(&cursor);
+      v13 = pRenderer->pActiveZBuffer[cursor.x + pSRZBufferLineOffsets[cursor.y]] & 0xFFFF;
+      if ( v13 )
       {
         v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)window_SpeakInHouse->ptr_1C));
         v17 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)window_SpeakInHouse->ptr_1C, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C,  2);
         v18 = BuildDialogueString(pMerchantsBuyPhrases[v17], uActiveCharacter - 1, v15, (char *)window_SpeakInHouse->ptr_1C, 2, 0);
         pTextHeight = pFontArrus->CalcTextHeight(v18, &working_window, 0, 0);
-        working_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138,  pColorWhite, v18, 3);
+        working_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138,  TargetColor(0xFFu, 0xFFu, 0xFFu), v18, 3);
         return;
       }
     }
     return;
   }
-  if ( dialog_menu_id == HOUSE_DIALOGUE_GUILD_LEARN_SKILL )
+  if ( HouseUI_CheckIfPlayerCanInteract() )
   {
-    if ( HouseUI_CheckIfPlayerCanInteract() )
+    if ( pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] )
     {
-      if ( pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] )
+      sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[403], pSkillNames[dialog_menu_id-36]); //"You already know the %s skill"
+      ShowStatusBarString(pTmpBuf.data(), 2);
+      pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
+    }
+    else
+    {
+      if ( pParty->uNumGold < pPrice )
       {
-        sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[403], pClassNames[dialog_menu_id - 16]); //"You already know the %s skill"
-        ShowStatusBarString(pTmpBuf.data(), 2);
-        pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
+        ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); //"You don't have enough gold"
+        PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
       }
       else
       {
-        if ( pParty->uNumGold < pPrice )
-        {
-          ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2); //"You don't have enough gold"
-          PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
-        }
-        else
-        {
-          Party::TakeGold(pPrice);
-          pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] = 1;
-        }
+        Party::TakeGold(pPrice);
+        pPlayers[uActiveCharacter]->pActiveSkills[dialog_menu_id-36] = 1;
       }
     }
-    pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
-    return;
   }
+  pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
+  return;
 }
 //----- (004BC8D5) --------------------------------------------------------
 void SpellBookGenerator()//for GuildDialogs
--- a/UI/UIHouses.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/UI/UIHouses.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -1057,7 +1057,7 @@
     case BuildingType_SelfGuild:
     case BuildingType_16:
     {
-      if ( pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C] >= (signed __int64)pParty->uTimePlayed )
+      if ( pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C - 139] >= (signed __int64)pParty->uTimePlayed )
       {
         for ( uint i = 0; i < 12; ++i )
         {
@@ -1068,7 +1068,7 @@
       else//generation new books
       {
         SpellBookGenerator();
-        pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C] = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000
+        pParty->PartyTimes.Shops_next_generation_time[window_SpeakInHouse->par1C - 139] = pParty->uTimePlayed + (signed __int64)((double)(0xA8C000
                                   * (signed int)p2DEvents[(unsigned int)window_SpeakInHouse->ptr_1C - 1].field_1C) * 0.033333335);
       }
       break;
@@ -1598,7 +1598,7 @@
           v15 = v14;
         while ( GetTickCount() < v15 )
           sqrt(3.1415926);
-        while ( sub_4BD8B5() )
+        while ( HouseDialogPressCloseBtn() )
           ;
         pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0);
         return;
@@ -2046,8 +2046,8 @@
       {
         Party::TakeGold(pPriceRoom);
         PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, HouseSound_NotEnoughMoney_TrainingSuccessful);
-        dialog_menu_id = HOUSE_DIALOGUE_NULL;
-        sub_4BD8B5();
+        //dialog_menu_id = HOUSE_DIALOGUE_NULL;
+        HouseDialogPressCloseBtn();
         GetHouseGoodbyeSpeech();
         pVideoPlayer->Unload();
         if ( pMessageQueue_50CBD0->uNumMessages )
@@ -2076,13 +2076,13 @@
       if ( pPriceSkill < v9 / 3 )
         pPriceSkill = v9 / 3;
       all_text_height = 0;
-      for ( pItemNum = pDialogueWindow->pStartingPosActiveItem;
-            pItemNum < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++pItemNum )
+      for ( int i = pDialogueWindow->pStartingPosActiveItem;
+            i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; ++i )
       {
-        if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pDialogueWindow->GetControl(pItemNum)->msg_param - 36]
-            && !pPlayers[uActiveCharacter]->pActiveSkills[pDialogueWindow->GetControl(pItemNum)->msg_param - 36] )
+        if ( byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pDialogueWindow->GetControl(i)->msg_param - 36]
+            && !pPlayers[uActiveCharacter]->pActiveSkills[pDialogueWindow->GetControl(i)->msg_param - 36] )
         {
-          all_text_height = pFontArrus->CalcTextHeight(pSkillNames[pDialogueWindow->GetControl(pItemNum)->msg_param - 36], &dialog_window, 0, 0);
+          all_text_height = pFontArrus->CalcTextHeight(pSkillNames[pDialogueWindow->GetControl(i)->msg_param - 36], &dialog_window, 0, 0);
           pSkillCount++;
         }
       }
@@ -2094,10 +2094,10 @@
         if ( (149 - all_text_height) / pSkillCount > 32 )
           v91 = 32;
         v54 = (149 - pSkillCount * v91 - all_text_height) / 2 - v91 / 2 + 162;
-        for ( pItemNum = pDialogueWindow->pStartingPosActiveItem;
-              pItemNum < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; pItemNum++ )
+        for ( int i = pDialogueWindow->pStartingPosActiveItem;
+              i < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton; i++ )
         {
-          pButton = pDialogueWindow->GetControl(pItemNum);
+          pButton = pDialogueWindow->GetControl(i);
           if ( !byte_4ED970_skill_learn_ability_by_class_table[pPlayers[uActiveCharacter]->classType][pButton->msg_param - 36]
             || pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param - 36] )
           {
@@ -2113,7 +2113,7 @@
             v54 = pTextHeight + pButton->uY - 1;
             pButton->uW = v54;
             pColorText = TargetColor(0xFFu, 0xFFu, 0x9Bu);
-            if ( pDialogueWindow->pCurrentPosActiveItem != pItemNum )
+            if ( pDialogueWindow->pCurrentPosActiveItem != i )
               pColorText = TargetColor(0xFFu, 0xFFu, 0xFFu);
             dialog_window.DrawTitleText(pFontArrus, 0, pButton->uY, pColorText, pSkillNames[pButton->msg_param - 36], 3);
           }
--- a/VideoPlayer.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/VideoPlayer.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -1076,7 +1076,7 @@
   if ( window_SpeakInHouse && window_SpeakInHouse->ptr_1C == (void *)165 && !this->pSmackerMovie )
   {
     bGameoverLoop = 1;
-    sub_4BD8B5();
+    HouseDialogPressCloseBtn();
     window_SpeakInHouse->Release();
     pParty->uFlags &= 0xFFFFFFFDu;
     if ( EnterHouse(HOUSE_BODY_GUILD_ERATHIA) )
--- a/mm7_1.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,381 +0,0 @@
-#ifdef _MSC_VER
-#define _CRT_SECURE_NO_WARNINGS
-#endif
-
-/* This file has been generated by the Hex-Rays decompiler.
-   Copyright (c) 2007-2011 Hex-Rays <info@hex-rays.com>
-
-   Detected compiler: Visual C++
-*/
-
-//#include <defs.h>
-
-#include "Texture.h"
-#include "mm7_data.h"
-#include "VideoPlayer.h"
-#include "BSPModel.h"
-#include "Mouse.h"
-
-#include "Vis.h"
-#include "MM7.h"
-#include "Game.h"
-#include "GUIWindow.h"
-#include "Party.h"
-#include "AudioPlayer.h"
-#include "Outdoor.h"
-#include "Overlays.h"
-#include "LOD.h"
-#include "Actor.h"
-#include "Events.h"
-#include "Viewport.h"
-#include "SpriteObject.h"
-#include "ObjectList.h"
-#include "Chest.h"
-#include "DecorationList.h"
-#include "stru123.h"
-#include "Time.h"
-#include "IconFrameTable.h"
-#include "TurnEngine.h"
-#include "texts.h"
-#include "UI\UIHouses.h"
-#include "stru367.h"
-
-int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam);
-int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4);
-bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive);
-bool __fastcall Initialize(HINSTANCE hInst, char *pCmdLine);
-
-
-//----- (004A1780) mm6_chinese---------------------------------------------
-__int64 fixpoint_div(int a1, int a2)
-{
-  return ((__int64)a1 << 16) / a2;
-}
-
-__int64 fixpoint_sub_unknown(int a1, int a2)
-{
-  return (((__int64)a1 << 16) * a2) >> 16;
-}
-
-
-//----- (0042EBBE) --------------------------------------------------------
-//----- (004453C0) mm6-----------------------------------------------------
-//----- (004A1760) mm6_chinese---------------------------------------------
-__int64 fixpoint_mul(int a1, int a2)
-{
-  return ((__int64)a1 * (__int64)a2) >> 16;
-}
-
-__int64 fixpoint_dot(int x1, int x2, int y1, int y2, int z1, int z2)
-{
-  return fixpoint_mul(x1, x2) +
-         fixpoint_mul(y1, y2) +
-         fixpoint_mul(z1, z2);
-}
-
-//----- (0041D20D) --------------------------------------------------------
-void DrawBuff_remaining_time_string( int uY, struct GUIWindow *window, __int64 remaining_time, struct GUIFont *Font )
-{
-  unsigned int full_time; // esi@1
-  signed __int64 hours; // kr00_8@1
-  const char *text; // eax@2
-  signed __int64 minutes; // [sp+10h] [bp-10h]@1
-  signed __int64 seconds; // [sp+18h] [bp-8h]@1
-  unsigned int day; // [sp+24h] [bp+4h]@1
-
-  full_time = (signed __int64)((double)remaining_time * 0.234375);
-  day = (unsigned int)((full_time / 60) / 60) / 24;
-  hours = ((full_time / 60) / 60) % 24;
-  minutes = (signed __int64)(full_time / 60) % 60;
-  seconds = (signed __int64)full_time % 60;
-  strcpy(pTmpBuf.data(), "\r020");
-  if ( day )
-  {
-    text = pGlobalTXT_LocalizationStrings[57];   // Days
-    if ( day <= 1 )
-      text = pGlobalTXT_LocalizationStrings[56]; // Day
-    sprintfex(pTmpBuf2.data(), "%d %s ", (int)day, text);
-    strcat(pTmpBuf.data(), pTmpBuf2.data());
-  }
-  if ( hours )
-  {
-    if ( hours <= 1 )
-      text = pGlobalTXT_LocalizationStrings[109];// Hour
-    else
-      text = pGlobalTXT_LocalizationStrings[110];// Hours
-    sprintfex(pTmpBuf2.data(), "%d %s ", (int)hours, text);
-    strcat(pTmpBuf.data(), pTmpBuf2.data());
-  }
-  if ( minutes && !day )
-  {
-    if ( minutes <= 1 )
-      text = pGlobalTXT_LocalizationStrings[437];// Minute
-    else
-      text = pGlobalTXT_LocalizationStrings[436];// Minutes
-    sprintfex(pTmpBuf2.data(), "%d %s ", (int)minutes, text);
-    strcat(pTmpBuf.data(), pTmpBuf2.data());
-  }
-  if ( seconds && !hours )
-  {
-    if ( seconds <= 1 )
-      text = pGlobalTXT_LocalizationStrings[439];// Second
-    else
-      text = pGlobalTXT_LocalizationStrings[438];// Seconds
-    sprintfex(pTmpBuf2.data(), "%d %s ", (int)seconds, text);
-    strcat(pTmpBuf.data(), pTmpBuf2.data());
-  }
-  window->DrawText(Font, 32, uY, 0, pTmpBuf.data(), 0, 0, 0);
-}
-
-//----- (004226C2) --------------------------------------------------------
-bool PauseGameDrawing()
-{
-  if ( pCurrentScreen != SCREEN_GAME
-    && pCurrentScreen != SCREEN_NPC_DIALOGUE
-    && pCurrentScreen != SCREEN_CHANGE_LOCATION )
-  {
-    if ( pCurrentScreen == SCREEN_INPUT_BLV )
-      return pVideoPlayer->pSmackerMovie != 0;
-    if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG )
-      return true;
-  }
-  return false;
-}
-// 4E28F8: using guessed type int pCurrentScreen;
-
-//----- (004226EF) --------------------------------------------------------
-void SetUserInterface(PartyAlignment align, bool bReplace)
-{
-  extern void set_default_ui_skin();
-  set_default_ui_skin();
-
-  if (align == PartyAlignment_Evil)
-  {
-    if ( bReplace )
-    {
-      pTexture_RightFrame->Reload("ib-r-C.pcx");
-      pTexture_BottomFrame->Reload("ib-b-C.pcx");
-      pTexture_TopFrame->Reload("ib-t-C.pcx");
-      pTexture_LeftFrame->Reload("ib-l-C.pcx");
-      pTexture_StatusBar->Reload("IB-Foot-c.pcx");
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-C", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Minimap_Loop], "ib-autmask-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Compas], "IB-COMP-C", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-C", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2);
-
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-c", 2);
-
-      pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC");
-      pIconsFrameTable->InitializeAnimation(pUIAnim_WizardEye->uIconID);
-      pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC");
-      pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID);
-
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-c", 2);
-      pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-c", 2);
-    }
-    else
-    {
-      pTexture_RightFrame->Load("ib-r-C.pcx", 0);
-      pTexture_BottomFrame->Load("ib-b-c.pcx", 0);
-      pTexture_TopFrame->Load("ib-t-C.pcx", 0);
-      pTexture_LeftFrame->Load("ib-l-C.pcx", 0);
-      pTexture_StatusBar->Load("IB-Foot-c.pcx", 0);
-      uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-C", TEXTURE_16BIT_PALETTE);
-      uTextureID_Minimap_Loop = pIcons_LOD->LoadTexture("ib-autmask-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_Compas = pIcons_LOD->LoadTexture("IB-COMP-C", TEXTURE_16BIT_PALETTE);
-      dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-c", TEXTURE_16BIT_PALETTE);
-      dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-c", TEXTURE_16BIT_PALETTE);
-      dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE);
-      uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE);
-      uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_CharacterUI_InventoryBackground = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE);
-      pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC");
-      pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
-      pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC");
-      pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
-    }
-    uGameUIFontMain = TargetColor(0xC8u, 0, 0);
-    uGameUIFontShadow = TargetColor(10, 0, 0);
-  }
-  else if (align == PartyAlignment_Neutral)
-  {
-    if ( bReplace )
-    {
-      pTexture_RightFrame->Reload("ib-r-a.pcx");
-      pTexture_BottomFrame->Reload("ib-b-a.pcx");
-      pTexture_TopFrame->Reload("ib-t-a.pcx");
-      pTexture_LeftFrame->Reload("ib-l-a.pcx");
-      pTexture_StatusBar->Reload("IB-Foot-a.pcx");
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Minimap_Loop], "ib-autmask-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Compas], "IB-COMP-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-a", 2);
-      pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA");
-      pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
-      pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA");
-      pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top", 2);
-      pIcons_LOD->ReloadTexture(pTexture_591428, "endcap", 2);
-    }
-    else
-    {
-      pTexture_RightFrame->Load("ib-r-A.pcx", 0);
-      pTexture_BottomFrame->Load("ib-b-A.pcx", 0);
-      pTexture_TopFrame->Load("ib-t-A.pcx", 0);
-      pTexture_LeftFrame->Load("ib-l-A.pcx", 0);
-      pTexture_StatusBar->Load("IB-Foot-a.pcx", 0);
-      uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-A", TEXTURE_16BIT_PALETTE);
-      uTextureID_Minimap_Loop = pIcons_LOD->LoadTexture("ib-autmask-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_Compas = pIcons_LOD->LoadTexture("IB-COMP-A", TEXTURE_16BIT_PALETTE);
-      dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-a", TEXTURE_16BIT_PALETTE);
-      dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-a", TEXTURE_16BIT_PALETTE);
-      dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE);
-      uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE);
-      uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE);
-      uTextureID_CharacterUI_InventoryBackground = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE);
-      pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA");
-      pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
-      pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA");
-      pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
-      uTextureID_Parchment = pIcons_LOD->LoadTexture("parchment", TEXTURE_16BIT_PALETTE);
-      uTextureID_5076B4 = pIcons_LOD->LoadTexture("cornr_ll", TEXTURE_16BIT_PALETTE);
-      uTextureID_5076B0 = pIcons_LOD->LoadTexture("cornr_lr", TEXTURE_16BIT_PALETTE);
-      uTextureID_5076AC = pIcons_LOD->LoadTexture("cornr_ul", TEXTURE_16BIT_PALETTE);
-      uTextureID_5076A8 = pIcons_LOD->LoadTexture("cornr_ur", TEXTURE_16BIT_PALETTE);
-      uTextureID_5076A4 = pIcons_LOD->LoadTexture("edge_btm", TEXTURE_16BIT_PALETTE);
-      uTextureID_5076A0 = pIcons_LOD->LoadTexture("edge_lf", TEXTURE_16BIT_PALETTE);
-      uTextureID_50769C = pIcons_LOD->LoadTexture("edge_rt", TEXTURE_16BIT_PALETTE);
-      uTextureID_507698 = pIcons_LOD->LoadTexture("edge_top", TEXTURE_16BIT_PALETTE);
-      pTexture_591428 = pIcons_LOD->LoadTexturePtr("endcap", TEXTURE_16BIT_PALETTE);
-    }
-    uGameUIFontMain = TargetColor(0xAu, 0, 0);
-    uGameUIFontShadow = TargetColor(230, 214, 193);
-  }
-  else if (align == PartyAlignment_Good)
-  {
-    if ( bReplace )
-    {
-      pTexture_RightFrame->Reload("ib-r-B.pcx");
-      pTexture_BottomFrame->Reload("ib-b-B.pcx");
-      pTexture_TopFrame->Reload("ib-t-B.pcx");
-      pTexture_LeftFrame->Reload("ib-l-B.pcx");
-      pTexture_StatusBar->Reload("IB-Foot-b.pcx");
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-B", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Minimap_Loop], "ib-autmask-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Compas], "IB-COMP-B", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-B", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-b", 2);
-      pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB");
-      pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
-      pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB");
-      pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-b", 2);
-      pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-b", 2);
-    }
-    uGameUIFontMain = TargetColor(0, 0, 0xC8u);
-    uGameUIFontShadow = TargetColor(255, 255, 255);
-  }
-  else Error("Invalid alignment type: %u", align);
-}
\ No newline at end of file
--- a/mm7_2.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/mm7_2.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -606,10 +606,8 @@
 }
 
 //----- (004BD8B5) --------------------------------------------------------
-int sub_4BD8B5()
+int HouseDialogPressCloseBtn()
 {
-  int v0; // eax@4
-
   if ( pMessageQueue_50CBD0->uNumMessages )
     pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0;
   pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED);
@@ -617,85 +615,78 @@
   activeLevelDecoration = NULL;
   current_npc_text = 0;
   if ( pDialogueNPCCount == 0)
+    return 0;
+
+  if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL && ShopTexture )
   {
-	  return 0;
-  }
-
-  v0 = dialog_menu_id;
-  if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD && dialog_menu_id != HOUSE_DIALOGUE_SHOP_SELL
-    && dialog_menu_id != HOUSE_DIALOGUE_97 && dialog_menu_id != HOUSE_DIALOGUE_SHOP_REPAIR
-    && dialog_menu_id != HOUSE_DIALOGUE_SHOP_IDENTIFY && ShopTexture )
-  {
-	ShopTexture->Release();
-    v0 = dialog_menu_id;
+    ShopTexture->Release();
     ShopTexture = 0;
   }
 
-  switch(v0)
+  switch(dialog_menu_id)
   {
-	case -1:
-        _4B4224_UpdateNPCTopics((int)((char *)pDialogueNPCCount - 1));
-        pVideoPlayer->_4BF5B2();
-		break;
-
-	case 94:
-	case 96:
-	case 101:
-		pVideoPlayer->_4BF5B2();
-		UI_CreateEndConversationButton();
-		dialog_menu_id = HOUSE_DIALOGUE_MAIN;
-		InitializaDialogueOptions(in_current_building_type);
-		break;
-
-	case 3:
-	case 4:
-	case 5:
-        UI_CreateEndConversationButton();
-        dialog_menu_id = HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT;
-        InitializaDialogueOptions_Shops(in_current_building_type);
-		break;
-
-	case 102:
-	case 103:
-	case 104:
-        pVideoPlayer->_4BF5B2();
-        UI_CreateEndConversationButton();
-        dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN;
-        InitializaDialogueOptions_Tavern(in_current_building_type);
-		break;
-
-	case 0:
-	case 1:
-		pDialogueNPCCount = 0;
-		pDialogueWindow->Release();
-		dialog_menu_id = HOUSE_DIALOGUE_NULL;
-		pDialogueWindow = 0;
-		pIcons_LOD->SyncLoadedFilesCount();
-
-		if ( uNumDialogueNPCPortraits == 1 )
-			return 0;
-		
-		pBtn_ExitCancel = window_SpeakInHouse->pControlsHead;
-		if ( uNumDialogueNPCPortraits > 0 )
-		{
-			for ( uint i = 0; i < (unsigned int)uNumDialogueNPCPortraits; ++i )
-			{
-				HouseNPCPortraitsButtonsList[i] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][i],
-																					  pNPCPortraits_y[uNumDialogueNPCPortraits - 1][i],
-													  63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, i, 0, byte_591180[i].data(), 0, 0, 0);
-			}
-		}
-	
-		pVideoPlayer->_4BF5B2();
-		break;
-
-	default:
-		pVideoPlayer->_4BF5B2();
-        dialog_menu_id = HOUSE_DIALOGUE_MAIN;
-        InitializaDialogueOptions(in_current_building_type);
-		break;
+    case -1:
+      _4B4224_UpdateNPCTopics((int)((char *)pDialogueNPCCount - 1));
+      pVideoPlayer->_4BF5B2();
+      break;
+
+    case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT:
+    case HOUSE_DIALOGUE_LEARN_SKILLS:
+    case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN:
+      pVideoPlayer->_4BF5B2();
+      UI_CreateEndConversationButton();
+      dialog_menu_id = HOUSE_DIALOGUE_MAIN;
+      InitializaDialogueOptions(in_current_building_type);
+      break;
+
+    case HOUSE_DIALOGUE_SHOP_SELL:
+    case HOUSE_DIALOGUE_SHOP_IDENTIFY:
+    case HOUSE_DIALOGUE_SHOP_REPAIR:
+      UI_CreateEndConversationButton();
+      dialog_menu_id = HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT;
+      InitializaDialogueOptions_Shops(in_current_building_type);
+      break;
+
+    case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES:
+    case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS:
+    case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT:
+      pVideoPlayer->_4BF5B2();
+      UI_CreateEndConversationButton();
+      dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN;
+      InitializaDialogueOptions_Tavern(in_current_building_type);
+      break;
+
+    case HOUSE_DIALOGUE_NULL:
+    case HOUSE_DIALOGUE_MAIN:
+      pDialogueNPCCount = 0;
+      pDialogueWindow->Release();
+      dialog_menu_id = HOUSE_DIALOGUE_NULL;
+      pDialogueWindow = 0;
+      pIcons_LOD->SyncLoadedFilesCount();
+
+      if ( uNumDialogueNPCPortraits == 1 )
+        return 0;
+
+      pBtn_ExitCancel = window_SpeakInHouse->pControlsHead;
+      if ( uNumDialogueNPCPortraits > 0 )
+      {
+        for ( uint i = 0; i < (unsigned int)uNumDialogueNPCPortraits; ++i )
+        {
+          HouseNPCPortraitsButtonsList[i] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][i],
+                                            pNPCPortraits_y[uNumDialogueNPCPortraits - 1][i],
+                                            63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, i, 0, byte_591180[i].data(), 0, 0, 0);
+        }
+      }
+
+      pVideoPlayer->_4BF5B2();
+      break;
+
+    default:
+      pVideoPlayer->_4BF5B2();
+      dialog_menu_id = HOUSE_DIALOGUE_MAIN;
+      InitializaDialogueOptions(in_current_building_type);
+      break;
   }
-
   return 1;
 }
 
--- a/mm7_5.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/mm7_5.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -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
--- a/mm7_data.h	Wed Oct 23 00:02:06 2013 -0700
+++ b/mm7_data.h	Wed Oct 23 19:13:07 2013 -0700
@@ -1208,7 +1208,7 @@
 void SpellBookGenerator();
 void UI_CreateEndConversationButton();
 void __fastcall OnSelectShopDialogueOption(signed int uMessageParam);
-int sub_4BD8B5();
+int HouseDialogPressCloseBtn();
 bool __fastcall MerchandiseTest(ItemGen *item, int _2da_idx);
 void UIShop_Buy_Identify_Repair();
 bool __fastcall IsBModelVisible(unsigned int uModelID, int *unused);
--- a/stru9.cpp	Wed Oct 23 00:02:06 2013 -0700
+++ b/stru9.cpp	Wed Oct 23 19:13:07 2013 -0700
@@ -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