Browse Source

Added project files for love.thread on Windows. Also a minor fix to make love.thread builable as a standalone DLL.

rude 15 years ago
parent
commit
d084deeebf

+ 12 - 0
platform/msvc2008/graphics/graphics.vcproj

@@ -615,6 +615,18 @@
 			RelativePath="..\..\..\src\modules\graphics\Graphics.h"
 			>
 		</File>
+		<File
+			RelativePath="..\..\..\src\modules\graphics\Image.cpp"
+			>
+			<FileConfiguration
+				Name="Debug|Win32"
+				>
+				<Tool
+					Name="VCCLCompilerTool"
+					ObjectFile="$(IntDir)\graphics\"
+				/>
+			</FileConfiguration>
+		</File>
 		<File
 			RelativePath="..\..\..\src\modules\graphics\Image.h"
 			>

+ 9 - 0
platform/msvc2008/love.sln

@@ -77,6 +77,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lovedll", "lovedll\lovedll.
 		{8273822F-45A4-4BE3-82F3-B8B3223C578C} = {8273822F-45A4-4BE3-82F3-B8B3223C578C}
 	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "thread", "thread\thread.vcproj", "{0BD34470-EB9D-4D37-A398-F46FC97C017A}"
+	ProjectSection(ProjectDependencies) = postProject
+		{8273822F-45A4-4BE3-82F3-B8B3223C578C} = {8273822F-45A4-4BE3-82F3-B8B3223C578C}
+	EndProjectSection
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
@@ -147,6 +152,10 @@ Global
 		{2863FF8A-153F-46E0-8E71-2E58F3809E9B}.Debug|Win32.Build.0 = Debug|Win32
 		{2863FF8A-153F-46E0-8E71-2E58F3809E9B}.Release|Win32.ActiveCfg = Release|Win32
 		{2863FF8A-153F-46E0-8E71-2E58F3809E9B}.Release|Win32.Build.0 = Release|Win32
+		{0BD34470-EB9D-4D37-A398-F46FC97C017A}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0BD34470-EB9D-4D37-A398-F46FC97C017A}.Debug|Win32.Build.0 = Debug|Win32
+		{0BD34470-EB9D-4D37-A398-F46FC97C017A}.Release|Win32.ActiveCfg = Release|Win32
+		{0BD34470-EB9D-4D37-A398-F46FC97C017A}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 76 - 0
platform/msvc2008/love.vcproj

@@ -658,6 +658,26 @@
 					RelativePath="..\..\src\modules\graphics\Graphics.h"
 					>
 				</File>
+				<File
+					RelativePath="..\..\src\modules\graphics\Image.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							ObjectFile="$(IntDir)\graphics\"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							ObjectFile="$(IntDir)\graphics\"
+						/>
+					</FileConfiguration>
+				</File>
 				<File
 					RelativePath="..\..\src\modules\graphics\Image.h"
 					>
@@ -3209,6 +3229,62 @@
 					</File>
 				</Filter>
 			</Filter>
+			<Filter
+				Name="thread"
+				>
+				<Filter
+					Name="sdl"
+					>
+					<File
+						RelativePath="..\..\src\modules\thread\sdl\Thread.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								ObjectFile="$(IntDir)\thread\"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								ObjectFile="$(IntDir)\thread\"
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\..\src\modules\thread\sdl\Thread.h"
+						>
+					</File>
+					<File
+						RelativePath="..\..\src\modules\thread\sdl\wrap_Thread.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								ObjectFile="$(IntDir)\thread\"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								ObjectFile="$(IntDir)\thread\"
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\..\src\modules\thread\sdl\wrap_Thread.h"
+						>
+					</File>
+				</Filter>
+			</Filter>
 		</Filter>
 		<Filter
 			Name="common"

+ 211 - 0
platform/msvc2008/thread/thread.vcproj

@@ -0,0 +1,211 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9,00"
+	Name="thread"
+	ProjectGUID="{0BD34470-EB9D-4D37-A398-F46FC97C017A}"
+	RootNamespace="thread"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="196613"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../include;../../../src;../../../src/modules;../include/SDL"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;LOVE_BUILD"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="lua5.1.lib SDL.lib"
+				OutputFile="$(OutDir)\love\$(ProjectName).dll"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="..\lib"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
+				RuntimeLibrary="2"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="2"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="sdl"
+			>
+			<File
+				RelativePath="..\..\..\src\modules\thread\sdl\Thread.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)\thread\"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\modules\thread\sdl\Thread.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\..\src\modules\thread\sdl\wrap_Thread.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)\thread\"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\..\src\modules\thread\sdl\wrap_Thread.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

+ 9 - 0
src/modules/thread/sdl/Thread.cpp

@@ -18,16 +18,23 @@
 * 3. This notice may not be removed or altered from any source distribution.
 **/
 
+#include <common/config.h>
+
 #include "Thread.h"
 
+#ifdef LOVE_BUILD_STANDALONE
 extern "C" int luaopen_love(lua_State * L);
+#endif // LOVE_BUILD_STANDALONE
+
 
 int threadfunc(const char *data)
 {
 	lua_State * L = lua_open();
 	luaL_openlibs(L);
+#ifdef LOVE_BUILD_STANDALONE
 	love::luax_preload(L, luaopen_love, "love");
 	luaopen_love(L);
+#endif // LOVE_BUILD_STANDALONE
 	luaL_dostring(L, data);
 	lua_close(L);
 	return 0;
@@ -105,6 +112,8 @@ namespace sdl
 		{
 			list[c] = i->second;
 		}
+
+		return NULL;
 	}
 
 	void ThreadModule::unregister(std::string name)

+ 1 - 0
src/modules/thread/sdl/wrap_Thread.cpp

@@ -79,6 +79,7 @@ namespace sdl
 
 	int w_getThreads(lua_State *L)
 	{
+		return 0;
 	}
 
 	int w_getThread(lua_State *L)