shithub: choc

Download patch

ref: 6c63460b5a401c1c211a563ef109659d350f6773
parent: 6487e1429d4a6626a1a2ee18826ffe3ece241305
parent: 81163488c7e68222a2a46959623cfbc4ff49e95f
author: Simon Howard <[email protected]>
date: Sun May 11 11:30:35 EDT 2014

Merge pull request #405 from alexey-lysiuk/fix_msvc_build

Fix build with MSVC2008

--- a/msvc/chocolate.sln
+++ b/msvc/chocolate.sln
@@ -3,6 +3,7 @@
 # Visual Studio 2008
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Doom", "doom.vcproj", "{8B744A3B-8F18-41A0-85A3-293816E85B6E}"
 	ProjectSection(ProjectDependencies) = postProject
+		{FC8D0610-1507-4F36-99BC-6F5A422B6AD3} = {FC8D0610-1507-4F36-99BC-6F5A422B6AD3}
 		{66CD7F50-73B9-482F-8B69-1AF54983F845} = {66CD7F50-73B9-482F-8B69-1AF54983F845}
 		{35F435DB-AC4A-4F28-BA2D-812E638FB01A} = {35F435DB-AC4A-4F28-BA2D-812E638FB01A}
 	EndProjectSection
@@ -9,6 +10,7 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Heretic", "heretic.vcproj", "{8D4FF322-7414-4668-94BD-D63B45D9CBF8}"
 	ProjectSection(ProjectDependencies) = postProject
+		{FC8D0610-1507-4F36-99BC-6F5A422B6AD3} = {FC8D0610-1507-4F36-99BC-6F5A422B6AD3}
 		{66CD7F50-73B9-482F-8B69-1AF54983F845} = {66CD7F50-73B9-482F-8B69-1AF54983F845}
 		{35F435DB-AC4A-4F28-BA2D-812E638FB01A} = {35F435DB-AC4A-4F28-BA2D-812E638FB01A}
 	EndProjectSection
@@ -15,6 +17,7 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hexen", "hexen.vcproj", "{8FBB8720-340B-4185-9442-A76781FD6278}"
 	ProjectSection(ProjectDependencies) = postProject
+		{FC8D0610-1507-4F36-99BC-6F5A422B6AD3} = {FC8D0610-1507-4F36-99BC-6F5A422B6AD3}
 		{66CD7F50-73B9-482F-8B69-1AF54983F845} = {66CD7F50-73B9-482F-8B69-1AF54983F845}
 		{35F435DB-AC4A-4F28-BA2D-812E638FB01A} = {35F435DB-AC4A-4F28-BA2D-812E638FB01A}
 	EndProjectSection
@@ -31,6 +34,11 @@
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtextscreen", "libtextscreen.vcproj", "{35F435DB-AC4A-4F28-BA2D-812E638FB01A}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Strife", "strife.vcproj", "{FC4DACBA-2A3E-4AF0-804A-AF5FFFD13B08}"
+	ProjectSection(ProjectDependencies) = postProject
+		{FC8D0610-1507-4F36-99BC-6F5A422B6AD3} = {FC8D0610-1507-4F36-99BC-6F5A422B6AD3}
+		{66CD7F50-73B9-482F-8B69-1AF54983F845} = {66CD7F50-73B9-482F-8B69-1AF54983F845}
+		{35F435DB-AC4A-4F28-BA2D-812E638FB01A} = {35F435DB-AC4A-4F28-BA2D-812E638FB01A}
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libopl", "libopl.vcproj", "{FC8D0610-1507-4F36-99BC-6F5A422B6AD3}"
 EndProject
--- a/msvc/doom.vcproj
+++ b/msvc/doom.vcproj
@@ -41,7 +41,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories=".;..\src;..\src\doom;..\textscreen;..\pcsound"
+				AdditionalIncludeDirectories=".;..\src;..\src\doom;..\textscreen;..\pcsound;..\opl"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;PROGRAM_PREFIX=&quot;\&quot;chocolate-\&quot;&quot;"
 				MinimalRebuild="true"
 				ExceptionHandling="0"
@@ -69,6 +69,7 @@
 				AdditionalDependencies="SDL.lib SDL_mixer.lib SDL_net.lib SDLmain.lib"
 				OutputFile="$(OutDir)\chocolate-doom-dbg.exe"
 				LinkIncremental="2"
+				IgnoreDefaultLibraryNames="msvcrt"
 				GenerateDebugInformation="true"
 				SubSystem="1"
 				DataExecutionPrevention="0"
@@ -123,7 +124,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
-				AdditionalIncludeDirectories=".;..\src;..\src\doom;..\textscreen;..\pcsound"
+				AdditionalIncludeDirectories=".;..\src;..\src\doom;..\textscreen;..\pcsound;..\opl"
 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;PROGRAM_PREFIX=&quot;\&quot;chocolate-\&quot;&quot;"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="true"
@@ -146,6 +147,7 @@
 				AdditionalDependencies="SDL.lib SDL_mixer.lib SDL_net.lib SDLmain.lib"
 				OutputFile="$(OutDir)\chocolate-doom.exe"
 				LinkIncremental="0"
+				IgnoreDefaultLibraryNames="msvcrtd"
 				GenerateDebugInformation="false"
 				SubSystem="1"
 				OptimizeReferences="2"
@@ -193,6 +195,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\d_loop.h"
+				>
+			</File>
+			<File
 				RelativePath="..\src\d_mode.h"
 				>
 			</File>
@@ -201,6 +207,22 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\deh_defs.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\deh_io.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\deh_main.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\deh_mapping.h"
+				>
+			</File>
+			<File
 				RelativePath="..\src\deh_str.h"
 				>
 			</File>
@@ -217,6 +239,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\gusconf.h"
+				>
+			</File>
+			<File
 				RelativePath="..\src\i_cdmus.h"
 				>
 			</File>
@@ -281,11 +307,11 @@
 				>
 			</File>
 			<File
-				RelativePath="..\src\md5.h"
+				RelativePath="..\src\memio.h"
 				>
 			</File>
 			<File
-				RelativePath="..\src\memio.h"
+				RelativePath="..\src\midifile.h"
 				>
 			</File>
 			<File
@@ -341,6 +367,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\sha1.h"
+				>
+			</File>
+			<File
 				RelativePath="..\src\tables.h"
 				>
 			</File>
@@ -361,6 +391,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\w_main.h"
+				>
+			</File>
+			<File
 				RelativePath="..\src\w_merge.h"
 				>
 			</File>
@@ -412,18 +446,6 @@
 					>
 				</File>
 				<File
-					RelativePath="..\src\doom\deh_io.h"
-					>
-				</File>
-				<File
-					RelativePath="..\src\doom\deh_main.h"
-					>
-				</File>
-				<File
-					RelativePath="..\src\doom\deh_mapping.h"
-					>
-				</File>
-				<File
 					RelativePath="..\src\doom\deh_misc.h"
 					>
 				</File>
@@ -568,6 +590,10 @@
 					>
 				</File>
 				<File
+					RelativePath="..\src\doom\statdump.h"
+					>
+				</File>
+				<File
 					RelativePath="..\src\doom\wi_stuff.h"
 					>
 				</File>
@@ -585,14 +611,38 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\d_loop.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\d_mode.c"
 				>
 			</File>
 			<File
+				RelativePath="..\src\deh_io.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\deh_main.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\deh_mapping.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\deh_str.c"
 				>
 			</File>
 			<File
+				RelativePath="..\src\deh_text.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\gusconf.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\i_cdmus.c"
 				>
 			</File>
@@ -609,6 +659,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\i_oplmusic.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\i_pcsound.c"
 				>
 			</File>
@@ -673,11 +727,11 @@
 				>
 			</File>
 			<File
-				RelativePath="..\src\md5.c"
+				RelativePath="..\src\memio.c"
 				>
 			</File>
 			<File
-				RelativePath="..\src\memio.c"
+				RelativePath="..\src\midifile.c"
 				>
 			</File>
 			<File
@@ -693,6 +747,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\net_dedicated.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\net_gui.c"
 				>
 			</File>
@@ -725,6 +783,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\sha1.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\tables.c"
 				>
 			</File>
@@ -753,6 +815,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\w_main.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\w_merge.c"
 				>
 			</File>
@@ -792,22 +858,14 @@
 					>
 				</File>
 				<File
-					RelativePath="..\src\doom\deh_frame.c"
+					RelativePath="..\src\doom\deh_doom.c"
 					>
 				</File>
 				<File
-					RelativePath="..\src\doom\deh_io.c"
+					RelativePath="..\src\doom\deh_frame.c"
 					>
 				</File>
 				<File
-					RelativePath="..\src\doom\deh_main.c"
-					>
-				</File>
-				<File
-					RelativePath="..\src\doom\deh_mapping.c"
-					>
-				</File>
-				<File
 					RelativePath="..\src\doom\deh_misc.c"
 					>
 				</File>
@@ -820,10 +878,6 @@
 					>
 				</File>
 				<File
-					RelativePath="..\src\doom\deh_text.c"
-					>
-				</File>
-				<File
 					RelativePath="..\src\doom\deh_thing.c"
 					>
 				</File>
@@ -997,6 +1051,10 @@
 				</File>
 				<File
 					RelativePath="..\src\doom\st_stuff.c"
+					>
+				</File>
+				<File
+					RelativePath="..\src\doom\statdump.c"
 					>
 				</File>
 				<File
--- a/msvc/heretic.vcproj
+++ b/msvc/heretic.vcproj
@@ -40,7 +40,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories=".;..\src;..\src\doom;..\src\heretic;..\textscreen;..\pcsound"
+				AdditionalIncludeDirectories=".;..\src;..\src\heretic;..\textscreen;..\pcsound;..\opl"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;PROGRAM_PREFIX=&quot;\&quot;chocolate-\&quot;&quot;"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -62,6 +62,7 @@
 				Name="VCLinkerTool"
 				AdditionalDependencies="SDL.lib SDL_mixer.lib SDL_net.lib SDLmain.lib"
 				OutputFile="$(OutDir)\chocolate-heretic-dbg.exe"
+				IgnoreDefaultLibraryNames="msvcrt"
 				GenerateDebugInformation="true"
 				SubSystem="1"
 				TargetMachine="1"
@@ -115,7 +116,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
-				AdditionalIncludeDirectories=".;..\src;..\src\doom;..\src\heretic;..\textscreen;..\pcsound"
+				AdditionalIncludeDirectories=".;..\src;..\src\heretic;..\textscreen;..\pcsound;..\opl"
 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;PROGRAM_PREFIX=&quot;\&quot;chocolate-\&quot;&quot;"
 				StringPooling="true"
 				ExceptionHandling="0"
@@ -138,6 +139,7 @@
 				Name="VCLinkerTool"
 				AdditionalDependencies="SDL.lib SDL_mixer.lib SDL_net.lib SDLmain.lib"
 				OutputFile="$(OutDir)\chocolate-heretic.exe"
+				IgnoreDefaultLibraryNames="msvcrtd"
 				GenerateDebugInformation="false"
 				SubSystem="1"
 				OptimizeReferences="2"
@@ -184,14 +186,38 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\d_loop.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\d_mode.c"
 				>
 			</File>
 			<File
+				RelativePath="..\src\deh_io.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\deh_main.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\deh_mapping.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\deh_str.c"
 				>
 			</File>
 			<File
+				RelativePath="..\src\deh_text.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\gusconf.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\i_cdmus.c"
 				>
 			</File>
@@ -208,6 +234,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\i_oplmusic.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\i_pcsound.c"
 				>
 			</File>
@@ -272,11 +302,11 @@
 				>
 			</File>
 			<File
-				RelativePath="..\src\md5.c"
+				RelativePath="..\src\memio.c"
 				>
 			</File>
 			<File
-				RelativePath="..\src\memio.c"
+				RelativePath="..\src\midifile.c"
 				>
 			</File>
 			<File
@@ -284,6 +314,54 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\net_client.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_common.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_dedicated.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_gui.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_io.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_loop.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_packet.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_query.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_sdl.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_server.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_structrw.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\sha1.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\tables.c"
 				>
 			</File>
@@ -312,6 +390,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\w_main.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\w_merge.c"
 				>
 			</File>
@@ -343,6 +425,34 @@
 					>
 				</File>
 				<File
+					RelativePath="..\src\heretic\deh_ammo.c"
+					>
+				</File>
+				<File
+					RelativePath="..\src\heretic\deh_frame.c"
+					>
+				</File>
+				<File
+					RelativePath="..\src\heretic\deh_htext.c"
+					>
+				</File>
+				<File
+					RelativePath="..\src\heretic\deh_htic.c"
+					>
+				</File>
+				<File
+					RelativePath="..\src\heretic\deh_sound.c"
+					>
+				</File>
+				<File
+					RelativePath="..\src\heretic\deh_thing.c"
+					>
+				</File>
+				<File
+					RelativePath="..\src\heretic\deh_weapon.c"
+					>
+				</File>
+				<File
 					RelativePath="..\src\heretic\f_finale.c"
 					>
 				</File>
@@ -415,6 +525,10 @@
 					>
 				</File>
 				<File
+					RelativePath="..\src\heretic\p_saveg.c"
+					>
+				</File>
+				<File
 					RelativePath="..\src\heretic\p_setup.c"
 					>
 				</File>
@@ -498,6 +612,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\d_loop.h"
+				>
+			</File>
+			<File
 				RelativePath="..\src\d_mode.h"
 				>
 			</File>
@@ -506,6 +624,22 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\deh_defs.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\deh_io.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\deh_main.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\deh_mapping.h"
+				>
+			</File>
+			<File
 				RelativePath="..\src\deh_str.h"
 				>
 			</File>
@@ -522,6 +656,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\gusconf.h"
+				>
+			</File>
+			<File
 				RelativePath="..\src\i_cdmus.h"
 				>
 			</File>
@@ -582,11 +720,11 @@
 				>
 			</File>
 			<File
-				RelativePath="..\src\md5.h"
+				RelativePath="..\src\memio.h"
 				>
 			</File>
 			<File
-				RelativePath="..\src\memio.h"
+				RelativePath="..\src\midifile.h"
 				>
 			</File>
 			<File
@@ -594,6 +732,58 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\net_client.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_common.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_dedicated.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_defs.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_gui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_io.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_loop.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_packet.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_query.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_sdl.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_server.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_structrw.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\sha1.h"
+				>
+			</File>
+			<File
 				RelativePath="..\src\tables.h"
 				>
 			</File>
@@ -614,6 +804,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\w_main.h"
+				>
+			</File>
+			<File
 				RelativePath="..\src\w_merge.h"
 				>
 			</File>
@@ -641,6 +835,10 @@
 					>
 				</File>
 				<File
+					RelativePath="..\src\heretic\deh_htic.h"
+					>
+				</File>
+				<File
 					RelativePath="..\src\heretic\doomdata.h"
 					>
 				</File>
@@ -658,6 +856,10 @@
 				</File>
 				<File
 					RelativePath="..\src\heretic\m_random.h"
+					>
+				</File>
+				<File
+					RelativePath="..\src\heretic\p_action.h"
 					>
 				</File>
 				<File
--- a/msvc/hexen.vcproj
+++ b/msvc/hexen.vcproj
@@ -40,11 +40,11 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories=".;..\src;..\src\strife;..\src\doom;..\textscreen;..\pcsound;..\opl"
+				AdditionalIncludeDirectories=".;..\src;..\src\hexen;..\textscreen;..\pcsound;..\opl"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;PROGRAM_PREFIX=&quot;\&quot;chocolate-\&quot;&quot;"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
-				RuntimeLibrary="2"
+				RuntimeLibrary="3"
 				WarningLevel="3"
 				DebugInformationFormat="4"
 				CompileAs="1"
@@ -60,10 +60,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="SDL.lib SDL_mixer.lib SDL_net.lib SDLmain.lib ..\lib\libpcsound.lib ..\lib\libtextscreen.lib ..\lib\libopl.lib"
+				AdditionalDependencies="SDL.lib SDL_mixer.lib SDL_net.lib SDLmain.lib"
 				OutputFile="$(OutDir)\chocolate-hexen-dbg.exe"
 				IgnoreAllDefaultLibraries="false"
-				IgnoreDefaultLibraryNames="msvcrtd.lib"
+				IgnoreDefaultLibraryNames="msvcrt"
 				GenerateDebugInformation="true"
 				SubSystem="1"
 				TargetMachine="1"
@@ -117,7 +117,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
-				AdditionalIncludeDirectories=".;..\src;..\src\doom;..\src\heretic;..\textscreen;..\pcsound"
+				AdditionalIncludeDirectories=".;..\src;..\src\hexen;..\textscreen;..\pcsound;..\opl"
 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;PROGRAM_PREFIX=&quot;\&quot;chocolate-\&quot;&quot;"
 				StringPooling="true"
 				ExceptionHandling="0"
@@ -140,6 +140,7 @@
 				Name="VCLinkerTool"
 				AdditionalDependencies="SDL.lib SDL_mixer.lib SDL_net.lib SDLmain.lib"
 				OutputFile="$(OutDir)\chocolate-hexen.exe"
+				IgnoreDefaultLibraryNames="msvcrtd"
 				GenerateDebugInformation="false"
 				SubSystem="1"
 				OptimizeReferences="2"
@@ -186,6 +187,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\d_loop.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\d_mode.c"
 				>
 			</File>
@@ -194,6 +199,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\gusconf.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\i_cdmus.c"
 				>
 			</File>
@@ -278,10 +287,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\src\md5.c"
-				>
-			</File>
-			<File
 				RelativePath="..\src\memio.c"
 				>
 			</File>
@@ -294,6 +299,50 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\net_client.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_common.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_gui.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_io.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_loop.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_packet.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_query.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_sdl.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_server.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_structrw.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\sha1.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\tables.c"
 				>
 			</File>
@@ -552,6 +601,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\d_loop.h"
+				>
+			</File>
+			<File
 				RelativePath="..\src\d_mode.h"
 				>
 			</File>
@@ -576,6 +629,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\gusconf.h"
+				>
+			</File>
+			<File
 				RelativePath="..\src\i_cdmus.h"
 				>
 			</File>
@@ -640,15 +697,55 @@
 				>
 			</File>
 			<File
-				RelativePath="..\src\md5.h"
+				RelativePath="..\src\memio.h"
 				>
 			</File>
 			<File
-				RelativePath="..\src\memio.h"
+				RelativePath="..\src\mus2mid.h"
 				>
 			</File>
 			<File
-				RelativePath="..\src\mus2mid.h"
+				RelativePath="..\src\net_client.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_common.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_gui.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_io.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_loop.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_packet.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_query.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_sdl.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_server.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_structrw.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\sha1.h"
 				>
 			</File>
 			<File
--- a/msvc/libtextscreen.vcproj
+++ b/msvc/libtextscreen.vcproj
@@ -131,7 +131,6 @@
 			/>
 			<Tool
 				Name="VCLibrarianTool"
-				IgnoreDefaultLibraryNames="msvcrtd"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -175,6 +174,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\textscreen\txt_fileselect.c"
+				>
+			</File>
+			<File
 				RelativePath="..\textscreen\txt_gui.c"
 				>
 			</File>
@@ -195,6 +198,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\textscreen\txt_scrollpane.c"
+				>
+			</File>
+			<File
 				RelativePath="..\textscreen\txt_sdl.c"
 				>
 			</File>
@@ -257,6 +264,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\textscreen\txt_fileselect.h"
+				>
+			</File>
+			<File
 				RelativePath="..\textscreen\txt_font.h"
 				>
 			</File>
@@ -289,11 +300,19 @@
 				>
 			</File>
 			<File
+				RelativePath="..\textscreen\txt_scrollpane.h"
+				>
+			</File>
+			<File
 				RelativePath="..\textscreen\txt_sdl.h"
 				>
 			</File>
 			<File
 				RelativePath="..\textscreen\txt_separator.h"
+				>
+			</File>
+			<File
+				RelativePath="..\textscreen\txt_smallfont.h"
 				>
 			</File>
 			<File
--- a/msvc/server.vcproj
+++ b/msvc/server.vcproj
@@ -63,6 +63,7 @@
 				Name="VCLinkerTool"
 				AdditionalDependencies="SDL.lib SDL_net.lib SDLmain.lib"
 				OutputFile="$(OutDir)\chocolate-server-dbg.exe"
+				IgnoreDefaultLibraryNames="msvcrt"
 				GenerateDebugInformation="true"
 				SubSystem="1"
 				TargetMachine="1"
@@ -140,6 +141,7 @@
 				Name="VCLinkerTool"
 				AdditionalDependencies="SDL.lib SDL_net.lib SDLmain.lib"
 				OutputFile="$(OutDir)\chocolate-server.exe"
+				IgnoreDefaultLibraryNames="msvcrtd"
 				GenerateDebugInformation="false"
 				SubSystem="1"
 				OptimizeReferences="2"
@@ -222,6 +224,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\src\net_query.c"
+				>
+			</File>
+			<File
 				RelativePath="..\src\net_sdl.c"
 				>
 			</File>
@@ -277,6 +283,10 @@
 			</File>
 			<File
 				RelativePath="..\src\net_packet.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_query.h"
 				>
 			</File>
 			<File
--- a/msvc/setup.vcproj
+++ b/msvc/setup.vcproj
@@ -40,7 +40,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories=".;..\src;..\src\doom;..\textscreen"
+				AdditionalIncludeDirectories=".;..\src;..\textscreen"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;CHOCOLATESETUP"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -61,8 +61,9 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="SDL.lib SDLmain.lib"
+				AdditionalDependencies="SDL.lib SDLmain.lib SDL_net.lib"
 				OutputFile="$(OutDir)\chocolate-setup-dbg.exe"
+				IgnoreDefaultLibraryNames="msvcrt"
 				GenerateDebugInformation="true"
 				SubSystem="1"
 				TargetMachine="1"
@@ -116,7 +117,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="2"
 				EnableIntrinsicFunctions="true"
-				AdditionalIncludeDirectories=".;..\src;..\src\doom;..\textscreen"
+				AdditionalIncludeDirectories=".;..\src;..\textscreen"
 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;CHOCOLATESETUP"
 				StringPooling="true"
 				ExceptionHandling="0"
@@ -138,8 +139,9 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="SDL.lib SDLmain.lib"
+				AdditionalDependencies="SDL.lib SDLmain.lib SDL_net.lib"
 				OutputFile="$(OutDir)\chocolate-setup.exe"
+				IgnoreDefaultLibraryNames="msvcrtd"
 				GenerateDebugInformation="false"
 				SubSystem="1"
 				OptimizeReferences="2"
@@ -178,69 +180,129 @@
 			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
 			>
 			<File
-				RelativePath="..\setup\compatibility.c"
+				RelativePath="..\src\setup\compatibility.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\configfile.c"
+				RelativePath="..\src\d_iwad.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\display.c"
+				RelativePath="..\src\d_mode.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\execute.c"
+				RelativePath="..\src\deh_str.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\joystick.c"
+				RelativePath="..\src\setup\display.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\keyboard.c"
+				RelativePath="..\src\setup\execute.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\m_argv.c"
+				RelativePath="..\src\i_main.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\mainmenu.c"
+				RelativePath="..\src\i_system.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\mouse.c"
+				RelativePath="..\src\i_timer.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\multiplayer.c"
+				RelativePath="..\src\setup\joystick.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\setup_icon.c"
+				RelativePath="..\src\setup\keyboard.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\sound.c"
+				RelativePath="..\src\m_argv.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\txt_joybinput.c"
+				RelativePath="..\src\m_config.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\txt_keyinput.c"
+				RelativePath="..\src\m_controls.c"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\txt_mouseinput.c"
+				RelativePath="..\src\m_misc.c"
 				>
 			</File>
 			<File
+				RelativePath="..\src\setup\mainmenu.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\mode.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\mouse.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\multiplayer.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_io.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_packet.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_query.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_sdl.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_structrw.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\setup_icon.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\sound.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\txt_joybinput.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\txt_keyinput.c"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\txt_mouseinput.c"
+				>
+			</File>
+			<File
 				RelativePath="..\textscreen\txt_scrollpane.c"
 				>
 			</File>
+			<File
+				RelativePath="..\src\z_zone.c"
+				>
+			</File>
 		</Filter>
 		<Filter
 			Name="Header Files"
@@ -248,59 +310,115 @@
 			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
 			>
 			<File
-				RelativePath="..\setup\compatibility.h"
+				RelativePath="..\src\setup\compatibility.h"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\configfile.h"
+				RelativePath="..\src\d_iwad.h"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\display.h"
+				RelativePath="..\src\d_mode.h"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\execute.h"
+				RelativePath="..\src\deh_str.h"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\joystick.h"
+				RelativePath="..\src\setup\display.h"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\keyboard.h"
+				RelativePath="..\src\setup\execute.h"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\m_argv.h"
+				RelativePath="..\src\i_system.h"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\mouse.h"
+				RelativePath="..\src\i_timer.h"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\multiplayer.h"
+				RelativePath="..\src\setup\joystick.h"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\sound.h"
+				RelativePath="..\src\setup\keyboard.h"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\txt_joybinput.h"
+				RelativePath="..\src\m_argv.h"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\txt_keyinput.h"
+				RelativePath="..\src\m_config.h"
 				>
 			</File>
 			<File
-				RelativePath="..\setup\txt_mouseinput.h"
+				RelativePath="..\src\m_controls.h"
 				>
 			</File>
 			<File
+				RelativePath="..\src\m_misc.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\mode.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\mouse.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\multiplayer.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_io.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_packet.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_query.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_sdl.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\net_structrw.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\sound.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\txt_joybinput.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\txt_keyinput.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\setup\txt_mouseinput.h"
+				>
+			</File>
+			<File
 				RelativePath="..\textscreen\txt_scrollpane.h"
+				>
+			</File>
+			<File
+				RelativePath="..\src\z_zone.h"
 				>
 			</File>
 		</Filter>
--- a/msvc/strife.vcproj
+++ b/msvc/strife.vcproj
@@ -41,12 +41,12 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories=".;..\src;..\src\strife;..\src\doom;..\textscreen;..\pcsound;..\opl"
+				AdditionalIncludeDirectories=".;..\src;..\src\strife;..\textscreen;..\pcsound;..\opl"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;PROGRAM_PREFIX=&quot;\&quot;chocolate-\&quot;&quot;"
 				MinimalRebuild="true"
 				ExceptionHandling="0"
 				BasicRuntimeChecks="3"
-				RuntimeLibrary="2"
+				RuntimeLibrary="3"
 				EnableFunctionLevelLinking="true"
 				UsePrecompiledHeader="0"
 				ExpandAttributedSource="true"
@@ -66,11 +66,10 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="SDL.lib SDL_mixer.lib SDL_net.lib SDLmain.lib ..\lib\libpcsound.lib ..\lib\libtextscreen.lib ..\lib\libopl.lib"
+				AdditionalDependencies="SDL.lib SDL_mixer.lib SDL_net.lib SDLmain.lib"
 				OutputFile="$(OutDir)\chocolate-strife-dbg.exe"
 				LinkIncremental="2"
-				IgnoreAllDefaultLibraries="false"
-				IgnoreDefaultLibraryNames="msvcrtd.lib"
+				IgnoreDefaultLibraryNames="msvcrt"
 				GenerateDebugInformation="true"
 				SubSystem="1"
 				DataExecutionPrevention="0"
@@ -129,7 +128,7 @@
 				FavorSizeOrSpeed="1"
 				OmitFramePointers="true"
 				WholeProgramOptimization="true"
-				AdditionalIncludeDirectories=".;..\src;..\src\strife;..\src\doom;..\textscreen;..\pcsound;..\opl"
+				AdditionalIncludeDirectories=".;..\src;..\src\strife;..\textscreen;..\pcsound;..\opl"
 				PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;PROGRAM_PREFIX=&quot;\&quot;chocolate-\&quot;&quot;"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="true"
@@ -149,7 +148,7 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="SDL.lib SDL_mixer.lib SDL_net.lib SDLmain.lib ..\lib\libpcsound.lib ..\lib\libtextscreen.lib ..\lib\libopl.lib"
+				AdditionalDependencies="SDL.lib SDL_mixer.lib SDL_net.lib SDLmain.lib"
 				OutputFile="$(OutDir)\chocolate-strife.exe"
 				LinkIncremental="0"
 				IgnoreDefaultLibraryNames="msvcrtd"
--- a/src/i_sdlmusic.c
+++ b/src/i_sdlmusic.c
@@ -275,6 +275,8 @@
 
     for (;;)
     {
+        long pos = -1;
+
         // Read METADATA_BLOCK_HEADER:
         if (fread(header, 4, 1, fs) < 1)
         {
@@ -285,7 +287,7 @@
         last_block = (header[0] & 0x80) != 0;
         block_len = (header[1] << 16) | (header[2] << 8) | header[3];
 
-        long pos = ftell(fs);
+        pos = ftell(fs);
         if (pos < 0)
         {
             return;