[Scummvm-cvs-logs] scummvm master -> 62e823300993fe1932173f8800b4088a20b75924

Littleboy littleboy22 at gmail.com
Sun Apr 24 23:13:20 CEST 2011


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
11b907ebf4 CREATE_PROJECT: Update revision number support (fixes bug #3280881)
878d72b387 CREATE_PROJECT: Move project-specific information to configuration file
62e8233009 COMMON: Fix MSVC warning in PEResources::parseResourceLevel()


Commit: 11b907ebf45f5a0707c2748b8f7413b2910976a8
    https://github.com/scummvm/scummvm/commit/11b907ebf45f5a0707c2748b8f7413b2910976a8
Author: Littleboy (littleboy at users.sourceforge.net)
Date: 2011-04-24T13:59:46-07:00

Commit Message:
CREATE_PROJECT: Update revision number support (fixes bug #3280881)

Replace existing environment variable based revision number support by a file-based method
 - Generate a special header file in the build output folder with the current revision number
 - Include the new header file from internal_version.h when a specific define is set
 - Update create_project to define SCUMMVM_INTERNAL_REVISION as needed and add the build output folder to the include path
 - Remove support for git-svn clones in the revision script (not useful anymore after the switch to git)

Changed paths:
  A base/internal_revision.h.in
    base/internal_version.h
    base/internal_version.h.in
    devtools/create_project/msbuild.cpp
    devtools/create_project/msbuild.h
    devtools/create_project/msvc.cpp
    devtools/create_project/msvc.h
    devtools/create_project/scripts/postbuild.cmd
    devtools/create_project/scripts/prebuild.cmd
    devtools/create_project/scripts/revision.vbs
    devtools/create_project/visualstudio.cpp
    devtools/create_project/visualstudio.h



diff --git a/base/internal_revision.h.in b/base/internal_revision.h.in
new file mode 100644
index 0000000..63f58a4
--- /dev/null
+++ b/base/internal_revision.h.in
@@ -0,0 +1,6 @@
+#ifndef SCUMMVM_INTERNAL_REVISION_H
+#define SCUMMVM_INTERNAL_REVISION_H
+
+#define SCUMMVM_REVISION "@REVISION@"
+
+#endif
diff --git a/base/internal_version.h b/base/internal_version.h
index fc7b535..36cdcde 100644
--- a/base/internal_version.h
+++ b/base/internal_version.h
@@ -2,6 +2,12 @@
 #error This file may only be included by base/version.cpp
 #endif
 
+// Reads revision number from file
+// (this is used when building with Visual Studio)
+#ifdef SCUMMVM_INTERNAL_REVISION
+#include "internal_revision.h"
+#endif
+
 #ifdef RELEASE_BUILD
 #undef SCUMMVM_REVISION
 #endif
diff --git a/base/internal_version.h.in b/base/internal_version.h.in
index 5eb3c90..e2b46f5 100644
--- a/base/internal_version.h.in
+++ b/base/internal_version.h.in
@@ -2,6 +2,12 @@
 #error This file may only be included by base/version.cpp
 #endif
 
+// Reads revision number from file
+// (this is used when building with Visual Studio)
+#ifdef SCUMMVM_INTERNAL_REVISION
+#include "internal_revision.h"
+#endif
+
 #ifdef RELEASE_BUILD
 #undef SCUMMVM_REVISION
 #endif
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index 070d7fe..1198ff9 100644
--- a/devtools/create_project/msbuild.cpp
+++ b/devtools/create_project/msbuild.cpp
@@ -283,7 +283,7 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
 	project << "\t</ItemDefinitionGroup>\n";
 }
 
-void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix) {
+void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix, bool runBuildEvents) {
 
 	std::string warnings;
 	for (StringList::const_iterator i = _globalWarnings.begin(); i != _globalWarnings.end(); ++i)
@@ -293,6 +293,10 @@ void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits,
 	for (StringList::const_iterator i = defines.begin(); i != defines.end(); ++i)
 		definesList += *i + ';';
 
+	// Add define to include revision header
+	if (runBuildEvents)
+		definesList += "SCUMMVM_INTERNAL_REVISION;";
+
 	properties << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
 	              "<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n"
 	              "\t<PropertyGroup>\n"
@@ -308,7 +312,7 @@ void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits,
 	              "\t\t<ClCompile>\n"
 	              "\t\t\t<DisableLanguageExtensions>true</DisableLanguageExtensions>\n"
 	              "\t\t\t<DisableSpecificWarnings>" << warnings << ";%(DisableSpecificWarnings)</DisableSpecificWarnings>\n"
-	              "\t\t\t<AdditionalIncludeDirectories>$(SCUMMVM_LIBS)\\include;" << prefix << ";" << prefix << "\\engines;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n"
+	              "\t\t\t<AdditionalIncludeDirectories>$(SCUMMVM_LIBS)\\include;" << prefix << ";" << prefix << "\\engines;$(TargetDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n"
 	              "\t\t\t<PreprocessorDefinitions>" << definesList << "%(PreprocessorDefinitions)</PreprocessorDefinitions>\n"
 	              "\t\t\t<ExceptionHandling></ExceptionHandling>\n"
 	              "\t\t\t<RuntimeTypeInfo>false</RuntimeTypeInfo>\n"
@@ -436,9 +440,6 @@ void MSBuildProvider::writeFileListToProject(const FileNode &dir, std::ofstream
 				projectFile << "\t\t<ClCompile Include=\"" << (*entry).path << "\">\n"
 				               "\t\t\t<ObjectFileName>$(IntDir)" << (*entry).prefix << "%(Filename).obj</ObjectFileName>\n";
 
-				if (hasEnding((*entry).path, "base\\version.cpp"))
-					projectFile <<  "\t\t\t<PreprocessorDefinitions Condition=\"'$(Configuration)'=='Debug'\">SCUMMVM_REVISION#" $(SCUMMVM_REVISION_STRING)";%(PreprocessorDefinitions)</PreprocessorDefinitions>\n";
-
 				projectFile << "\t\t</ClCompile>\n";
 			} else {
 				projectFile << "\t\t<ClCompile Include=\"" << (*entry).path << "\" />\n";
diff --git a/devtools/create_project/msbuild.h b/devtools/create_project/msbuild.h
index fa53117..cc545e4 100644
--- a/devtools/create_project/msbuild.h
+++ b/devtools/create_project/msbuild.h
@@ -45,7 +45,7 @@ protected:
 
 	void writeReferences(std::ofstream &output);
 
-	void outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix);
+	void outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix, bool runBuildEvents);
 
 	void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32, bool enableAnalysis);
 
diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp
index e2fff59..ccdf4ac 100644
--- a/devtools/create_project/msvc.cpp
+++ b/devtools/create_project/msvc.cpp
@@ -124,7 +124,7 @@ void MSVCProvider::createGlobalProp(const BuildSetup &setup) {
 	if (!properties)
 		error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Global" + getPropertiesExtension() + "\" for writing");
 
-	outputGlobalPropFile(properties, 32, setup.defines, convertPathToWin(setup.filePrefix));
+	outputGlobalPropFile(properties, 32, setup.defines, convertPathToWin(setup.filePrefix), setup.runBuildEvents);
 	properties.close();
 
 	properties.open((setup.outputDir + '/' + "ScummVM_Global64" + getPropertiesExtension()).c_str());
@@ -143,7 +143,7 @@ void MSVCProvider::createGlobalProp(const BuildSetup &setup) {
 	x64Defines.push_back("WIN32");
 	x64Defines.push_back("SDL_BACKEND");
 
-	outputGlobalPropFile(properties, 64, x64Defines, convertPathToWin(setup.filePrefix));
+	outputGlobalPropFile(properties, 64, x64Defines, convertPathToWin(setup.filePrefix), setup.runBuildEvents);
 }
 
 std::string MSVCProvider::getPreBuildEvent() const {
@@ -152,7 +152,7 @@ std::string MSVCProvider::getPreBuildEvent() const {
 	cmdLine = "@echo off\n"
 	          "echo Executing Pre-Build script...\n"
 			  "echo.\n"
-			  "@call "$(SolutionDir)../../devtools/create_project/scripts/prebuild.cmd" "$(SolutionDir)/../.."\n"
+			  "@call "$(SolutionDir)../../devtools/create_project/scripts/prebuild.cmd" "$(SolutionDir)/../.."  "$(TargetDir)"\n"
 	          "EXIT /B0";
 
 	return cmdLine;
diff --git a/devtools/create_project/msvc.h b/devtools/create_project/msvc.h
index f41ecc3..b2f2a5d 100644
--- a/devtools/create_project/msvc.h
+++ b/devtools/create_project/msvc.h
@@ -59,8 +59,9 @@ protected:
 	 * @param bits Number of bits the platform supports.
 	 * @param defines Defines the platform needs to have set.
 	 * @param prefix File prefix, used to add additional include paths.
+	 * @param runBuildEvents true if generating a revision number, false otherwise
 	 */
-	virtual void outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix) = 0;
+	virtual void outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix, bool runBuildEvents) = 0;
 
 	/**
 	 * Generates the project properties for debug and release settings.
diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd
index 5c2bd8a..f548b81 100644
--- a/devtools/create_project/scripts/postbuild.cmd
+++ b/devtools/create_project/scripts/postbuild.cmd
@@ -12,7 +12,7 @@ REM    Root folder
 REM    Output folder

 REM    Architecture

 

-if "%~1"=="" goto error_input

+if "%~1"=="" goto error_root

 if "%~2"=="" goto error_output

 if "%~3"=="" goto error_arch

 

@@ -29,7 +29,7 @@ xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1
 xcopy /F /Y "%SCUMMVM_LIBS%/lib/%~3/SDL.dll" %~2 > NUL 2>&1

 goto done

 

-:error_output

+:error_root

 echo Invalid root folder (%~1)!

 goto done

 

diff --git a/devtools/create_project/scripts/prebuild.cmd b/devtools/create_project/scripts/prebuild.cmd
index b824f0d..dd4d12a 100644
--- a/devtools/create_project/scripts/prebuild.cmd
+++ b/devtools/create_project/scripts/prebuild.cmd
@@ -4,22 +4,28 @@ REM ---------------------------------------------------------------
 REM -- Pre-Build Script

 REM ---------------------------------------------------------------

 REM

-REM Generate file with proper revision number

+REM Generate file with revision number

 REM

 REM Expected parameters

-REM    Root folder

+REM    Root folder (the source root folder)

+REM    Target folder (the build output folder, will be used to copy internal_revision.h)

 

-if "%~1"=="" goto error_input

+if "%~1"=="" goto error_root

+if "%~2"=="" goto error_target

 

 REM Run the revision script

- at call cscript "%~1/devtools/create_project/scripts/revision.vbs" %~1 1>NUL

+ at call cscript "%~1/devtools/create_project/scripts/revision.vbs" %~1 %~2 1>NUL

 if not %errorlevel% == 0 goto error_script

 goto done

 

-:error_output

+:error_root

 echo Invalid root folder (%~1)!

 goto done

 

+:error_target

+echo Invalid target folder (%~2)!

+goto done

+

 :error_script:

 echo An error occured while running the revision script!

 

diff --git a/devtools/create_project/scripts/revision.vbs b/devtools/create_project/scripts/revision.vbs
index 8511853..9c29a88 100644
--- a/devtools/create_project/scripts/revision.vbs
+++ b/devtools/create_project/scripts/revision.vbs
@@ -35,6 +35,7 @@ Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
 
 ' Folders
 Dim rootFolder : rootFolder = ""
+Dim targetFolder : targetFolder = ""
 
 ' Info variables
 Dim tool : tool = ""
@@ -85,23 +86,25 @@ Sub DetermineRevision()
 	Wscript.StdErr.WriteLine "Found revision " & revision & " on branch " & branch & vbCrLf
 
 	' Setup our revision string
-	Dim revisionString : revisionString = "r" & revision
+	Dim revisionString : revisionString = revision
 
 	If (modified) Then
-		revisionString = revisionString & " M"
+		revisionString = revisionString & "-dirty"
 	End If
 
 	' If we are not on trunk, add the branch name to the revision string
-	If (branch <> "trunk" And branch <> "") Then
-		revisionString = revisionString & " (" & branch & ")"
+	If (branch <> "trunk" And branch <> "master" And branch <> "") Then
+		revisionString = revisionString & "(" & branch & ")"
 	End If
 
-	' Add the DVCS name at the end
-	revisionString = revisionString & " - " & tool
+	' Add the DVCS name at the end (when not git)
+	If (tool <> "git") Then
+		revisionString = revisionString & "-" & tool
+	End If
 
-	' Setup an environment variable with the revision string
-	Dim Env: Set Env = WshShell.Environment("User")
-	Env.item("SCUMMVM_REVISION_STRING") = revisionString
+	' Output revision header file
+	FSO.CopyFile rootFolder & "\\base\\internal_revision.h.in", targetFolder & "\\internal_revision.h"
+	FindReplaceInFile targetFolder & "\\internal_revision.h", "@REVISION@", revisionString
 End Sub
 
 Function DetermineTortoiseSVNVersion()
@@ -283,29 +286,9 @@ Function DetermineGitVersion()
 		End If
 	End If
 
-	' Check for svn clones
-	Set oExec = WshShell.Exec(gitPath & "log --pretty=format:%s --grep=" & Chr(34) & "^(svn r[0-9]*)" & Chr(34) & " -1 " & rootFolder)
-	if Err.Number = 0 Then
-		revision = Mid(oExec.StdOut.ReadLine(), 7)
-		revision = Mid(revision, 1, InStr(revision, ")") - 1)
-		tool = "svn-git"
-	End If
-
-	' No revision? Maybe it is a custom git-svn clone
-	If revision = "" Then
-		Err.Clear
-		Set oExec = WshShell.Exec(gitPath & "log --pretty=format:%b --grep=" & Chr(34) & "git-svn-id:.*@[0-9]*" & Chr(34) & " -1 " & rootFolder)
-		If Err.Number = 0 Then
-			revision = oExec.StdOut.ReadLine()
-			revision = Mid(revision, InStr(revision, "@") + 1)
-			revision = Mid(revision, 1, InStr(revision, " ") - 1)
-			tool = "svn-git"
-		End If
-	End If
-
 	' Fallback to abbreviated revision number
 	If revision = "" Then
-		revision = Mid(hash, 1, 8)
+		revision = Mid(hash, 1, 7)
 	End If
 
 	DetermineGitVersion = True
@@ -385,8 +368,8 @@ End Function
 Function ParseCommandLine()
 	ParseCommandLine = True
 
-	If Wscript.Arguments.Count <> 1 Then
-		Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 1)"
+	If Wscript.Arguments.Count <> 2 Then
+		Wscript.StdErr.WriteLine "[Error] Invalid number of arguments (was: " & Wscript.Arguments.Count & ", expected: 2)"
 
 		ParseCommandLine = False
 		Exit Function
@@ -394,6 +377,7 @@ Function ParseCommandLine()
 
 	' Get our arguments
 	rootFolder = Wscript.Arguments.Item(0)
+	targetFolder = Wscript.Arguments.Item(1)
 
 	' Check that the folders are valid
 	If Not FSO.FolderExists(rootFolder) Then
@@ -403,8 +387,16 @@ Function ParseCommandLine()
 		Exit Function
 	End If
 
-	' Set absolute path
+	If Not FSO.FolderExists(targetFolder) Then
+		Wscript.StdErr.WriteLine "[Error] Invalid target folder (" & targetFolder & ")"
+
+		ParseCommandLine = False
+		Exit Function
+	End If
+
+	' Set absolute paths
 	rootFolder = FSO.GetAbsolutePathName(rootFolder)
+	targetFolder = FSO.GetAbsolutePathName(targetFolder)
 End Function
 
 Function ReadRegistryKey(shive, subkey, valuename, architecture)
@@ -443,3 +435,14 @@ Function ReadRegistryKey(shive, subkey, valuename, architecture)
 
 	ReadRegistryKey = Outparams.SValue
 End Function
+
+Sub FindReplaceInFile(filename, to_find, replacement)
+	Dim file, data
+	Set file = FSO.OpenTextFile(filename, 1, 0, 0)
+	data = file.ReadAll
+	file.Close
+	data = Replace(data, to_find, replacement)
+	Set file = FSO.CreateTextFile(filename, -1, 0)
+	file.Write data
+	file.Close
+End Sub
diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp
index 390d0fb..41693dc 100644
--- a/devtools/create_project/visualstudio.cpp
+++ b/devtools/create_project/visualstudio.cpp
@@ -193,7 +193,7 @@ void VisualStudioProvider::writeReferences(std::ofstream &output) {
 	output << "\tEndProjectSection\n";
 }
 
-void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix) {
+void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix, bool runBuildEvents) {
 	std::string warnings;
 	for (StringList::const_iterator i = _globalWarnings.begin(); i != _globalWarnings.end(); ++i)
 		warnings +=  *i + ';';
@@ -205,6 +205,10 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
 		definesList += *i;
 	}
 
+	// Add define to include revision header
+	if (runBuildEvents)
+		definesList += "SCUMMVM_INTERNAL_REVISION;";
+
 	properties << "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n"
 	              "<VisualStudioPropertySheet\n"
 	              "\tProjectType=\"Visual C++\"\n"
@@ -217,7 +221,7 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
 	              "\t\tName=\"VCCLCompilerTool\"\n"
 	              "\t\tDisableLanguageExtensions=\"true\"\n"
 	              "\t\tDisableSpecificWarnings=\"" << warnings << "\"\n"
-	              "\t\tAdditionalIncludeDirectories=\"" << prefix << ";" << prefix << "\\engines;$(SCUMMVM_LIBS)\\include\"\n"
+	              "\t\tAdditionalIncludeDirectories=\"" << prefix << ";" << prefix << "\\engines;$(SCUMMVM_LIBS)\\include;$(TargetDir)\"\n"
 	              "\t\tPreprocessorDefinitions=\"" << definesList << "\"\n"
 	              "\t\tExceptionHandling=\"0\"\n"
 	              "\t\tRuntimeTypeInfo=\"false\"\n"
diff --git a/devtools/create_project/visualstudio.h b/devtools/create_project/visualstudio.h
index 0cf5724..a1d5c76 100644
--- a/devtools/create_project/visualstudio.h
+++ b/devtools/create_project/visualstudio.h
@@ -43,7 +43,7 @@ protected:
 
 	void writeReferences(std::ofstream &output);
 
-	void outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix);
+	void outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix, bool runBuildEvents);
 
 	void createBuildProp(const BuildSetup &setup, bool isRelease, bool isWin32, bool enableAnalysis);
 


Commit: 878d72b387d13bdb7713b142abae32bc28a51047
    https://github.com/scummvm/scummvm/commit/878d72b387d13bdb7713b142abae32bc28a51047
Author: Littleboy (littleboy at users.sourceforge.net)
Date: 2011-04-24T13:59:48-07:00

Commit Message:
CREATE_PROJECT: Move project-specific information to configuration file

User-visible output and project-specific names are now defined in a config header.
This allows an easier usage of the create_project tools in other scummvm-derived projects (such as residual).

Changed paths:
  A devtools/create_project/config.h
    devtools/create_project/codeblocks.cpp
    devtools/create_project/codeblocks/create_project.cbp
    devtools/create_project/create_project.cpp
    devtools/create_project/create_project.h
    devtools/create_project/msbuild.cpp
    devtools/create_project/msvc.cpp
    devtools/create_project/msvc10/create_project.vcxproj
    devtools/create_project/msvc10/create_project.vcxproj.filters
    devtools/create_project/msvc8/create_project.vcproj
    devtools/create_project/msvc9/create_project.vcproj
    devtools/create_project/scripts/postbuild.cmd
    devtools/create_project/visualstudio.cpp



diff --git a/devtools/create_project/codeblocks.cpp b/devtools/create_project/codeblocks.cpp
index d803fb0..8ca139e 100644
--- a/devtools/create_project/codeblocks.cpp
+++ b/devtools/create_project/codeblocks.cpp
@@ -23,6 +23,7 @@
  *
  */
 
+#include "config.h"
 #include "codeblocks.h"
 
 #include <fstream>
@@ -34,20 +35,20 @@ CodeBlocksProvider::CodeBlocksProvider(StringList &global_warnings, std::map<std
 }
 
 void CodeBlocksProvider::createWorkspace(const BuildSetup &setup) {
-	std::ofstream workspace((setup.outputDir + '/' + "scummvm.workspace").c_str());
+	std::ofstream workspace((setup.outputDir + '/' + PROJECT_NAME + ".workspace").c_str());
 	if (!workspace)
-		error("Could not open \"" + setup.outputDir + '/' + "scummvm.workspace\" for writing");
+		error("Could not open \"" + setup.outputDir + '/' + PROJECT_NAME + ".workspace\" for writing");
 
 	workspace << "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n"
 	             "<CodeBlocks_workspace_file>\n";
 
-	workspace << "\t<Workspace title=\"ScummVM\">\n";
+	workspace << "\t<Workspace title=\"" << PROJECT_DESCRIPTION << "\">\n";
 
 	writeReferences(workspace);
 
 	// Note we assume that the UUID map only includes UUIDs for enabled engines!
 	for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
-		if (i->first == "scummvm")
+		if (i->first == PROJECT_NAME)
 			continue;
 
 		workspace << "\t\t<Project filename=\"" << i->first << ".cbp\" />\n";
@@ -59,7 +60,7 @@ void CodeBlocksProvider::createWorkspace(const BuildSetup &setup) {
 
 // HACK We need to pre-process library names
 //      since the MSVC and mingw precompiled
-//      librarie have different names :(
+//      libraries have different names :(
 std::string processLibraryName(std::string name) {
 	// Remove "_static" in lib name
 	size_t pos = name.find("_static");
@@ -90,16 +91,16 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
 	           "\t\t<Option compiler=\"gcc\" />\n"
 	           "\t\t<Build>\n";
 
-	if (name == "scummvm") {
+	if (name == PROJECT_NAME) {
 		std::string libraries;
 
 		for (StringList::const_iterator i = setup.libraries.begin(); i != setup.libraries.end(); ++i)
 			libraries += processLibraryName(*i) + ".a;";
 
 		project << "\t\t\t<Target title=\"default\">\n"
-		           "\t\t\t\t<Option output=\"scummvm\\scummvm\" prefix_auto=\"1\" extension_auto=\"1\" />\n"
-		           "\t\t\t\t<Option object_output=\"scummvm\" />\n"
-		           "\t\t\t\t<Option external_deps=\"" << libraries /* + list of engines scummvm\engines\name\name.a */ << "\" />\n"
+		           "\t\t\t\t<Option output=\"" << PROJECT_NAME << "\\" << PROJECT_NAME << "\" prefix_auto=\"1\" extension_auto=\"1\" />\n"
+		           "\t\t\t\t<Option object_output=\"" << PROJECT_NAME << "\" />\n"
+		           "\t\t\t\t<Option external_deps=\"" << libraries /* + list of engines engines\name\name.a */ << "\" />\n"
 		           "\t\t\t\t<Option type=\"1\" />\n"
 		           "\t\t\t\t<Option compiler=\"gcc\" />\n"
 		           "\t\t\t\t<Option parameters=\"-d 8 --debugflags=parser\" />\n"
@@ -112,8 +113,8 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
 		writeWarnings(name, project);
 		writeDefines(setup.defines, project);
 
-		project << "\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)include\" />\n"
-		           "\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)include\\SDL\" />\n"
+		project << "\t\t\t\t\t<Add directory=\"$(" << LIBS_DEFINE << ")include\" />\n"
+		           "\t\t\t\t\t<Add directory=\"$(" << LIBS_DEFINE << ")include\\SDL\" />\n"
 		           "\t\t\t\t\t<Add directory=\"..\\..\\engines\" />\n"
 		           "\t\t\t\t\t<Add directory=\"..\\..\\common\" />\n"
 		           "\t\t\t\t\t<Add directory=\"..\\..\" />\n"
@@ -127,21 +128,21 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
 			project << "\t\t\t\t\t<Add library=\"" << processLibraryName(*i) << "\" />\n";
 
 		for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
-			if (i->first == "scummvm")
+			if (i->first == PROJECT_NAME)
 				continue;
 
-			project << "\t\t\t\t\t<Add library=\"scummvm\\engines\\" << i->first << "\\lib" << i->first << ".a\" />\n";
+			project << "\t\t\t\t\t<Add library=\"" << PROJECT_NAME << "\\engines\\" << i->first << "\\lib" << i->first << ".a\" />\n";
 		}
 
-		project << "\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)lib\\mingw\" />\n"
-		           "\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)lib\" />\n"
+		project << "\t\t\t\t\t<Add directory=\"$(" << LIBS_DEFINE << ")lib\\mingw\" />\n"
+		           "\t\t\t\t\t<Add directory=\"$(" << LIBS_DEFINE << ")lib\" />\n"
 		           "\t\t\t\t</Linker>\n";
 
 		//////////////////////////////////////////////////////////////////////////
 		// Resource compiler
 		project << "\t\t\t\t<ResourceCompiler>\n"
 		           "\t\t\t\t\t<Add directory=\"..\\..\\dists\" />\n"
-		           "\t\t\t\t\t<Add directory=\"..\\..\\..\\scummvm\" />\n"
+		           "\t\t\t\t\t<Add directory=\"..\\..\\..\\" << PROJECT_NAME << "\" />\n"
 		           "\t\t\t\t</ResourceCompiler>\n"
 		           "\t\t\t</Target>\n"
 		           "\t\t</Build>\n";
@@ -150,9 +151,9 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
 
 	} else {
 		project << "\t\t\t<Target title=\"default\">\n"
-		           "\t\t\t\t<Option output=\"scummvm\\engines\\" << name << "\\lib" << name << "\" prefix_auto=\"1\" extension_auto=\"1\" />\n"
+		           "\t\t\t\t<Option output=\"" << PROJECT_NAME << "\\engines\\" << name << "\\lib" << name << "\" prefix_auto=\"1\" extension_auto=\"1\" />\n"
 		           "\t\t\t\t<Option working_dir=\"\" />\n"
-		           "\t\t\t\t<Option object_output=\"scummvm\" />\n"
+		           "\t\t\t\t<Option object_output=\"" << PROJECT_NAME << "\" />\n"
 		           "\t\t\t\t<Option type=\"2\" />\n"
 		           "\t\t\t\t<Option compiler=\"gcc\" />\n"
 		           "\t\t\t\t<Option createDefFile=\"1\" />\n"
@@ -163,11 +164,11 @@ void CodeBlocksProvider::createProjectFile(const std::string &name, const std::s
 
 		project << "\t\t\t\t\t<Add option=\"-g\" />\n"
 		           "\t\t\t\t\t<Add directory=\"..\\..\\engines\" />\n"
-		           "\t\t\t\t\t<Add directory=\"..\\..\\..\\scummvm\" />\n";
+		           "\t\t\t\t\t<Add directory=\"..\\..\\..\\" << PROJECT_NAME << "\" />\n";
 
 		// Sword2.5 engine needs theora and vorbis includes
 		if (name == "sword25")
-			project << "\t\t\t\t\t<Add directory=\"$(SCUMMVM_LIBS)include\" />\n";
+			project << "\t\t\t\t\t<Add directory=\"$(" << LIBS_DEFINE << ")include\" />\n";
 
 		project << "\t\t\t\t</Compiler>\n"
 		           "\t\t\t</Target>\n"
@@ -233,7 +234,7 @@ void CodeBlocksProvider::writeFileListToProject(const FileNode &dir, std::ofstre
 				               "\t\t</Unit>\n";
 			} else if (ext == "asm") {
 				projectFile << "\t\t<Unit filename=\"" << convertPathToWin(filePrefix + node->name) << "\">\n"
-				               "\t\t\t<Option compiler=\"gcc\" use=\"1\" buildCommand=\"$(SCUMMVM_LIBS)bin/nasm.exe -f win32 -g $file -o $object\" />"
+				               "\t\t\t<Option compiler=\"gcc\" use=\"1\" buildCommand=\"$(" << LIBS_DEFINE << ")bin/nasm.exe -f win32 -g $file -o $object\" />"
 				               "\t\t</Unit>\n";
 			} else {
 				projectFile << "\t\t<Unit filename=\"" << convertPathToWin(filePrefix + node->name) << "\" />\n";
@@ -243,10 +244,10 @@ void CodeBlocksProvider::writeFileListToProject(const FileNode &dir, std::ofstre
 }
 
 void CodeBlocksProvider::writeReferences(std::ofstream &output) {
-	output << "\t\t<Project filename=\"scummvm.cbp\" active=\"1\">\n";
+	output << "\t\t<Project filename=\"" << PROJECT_NAME << ".cbp\" active=\"1\">\n";
 
 	for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
-		if (i->first == "scummvm")
+		if (i->first == " << PROJECT_NAME << ")
 			continue;
 
 		output << "\t\t\t<Depends filename=\"" << i->first << ".cbp\" />\n";
diff --git a/devtools/create_project/codeblocks/create_project.cbp b/devtools/create_project/codeblocks/create_project.cbp
index 9078ddc..25b12d8 100644
--- a/devtools/create_project/codeblocks/create_project.cbp
+++ b/devtools/create_project/codeblocks/create_project.cbp
@@ -36,6 +36,7 @@
 			<Add option="-Wall" />
 			<Add option="-fexceptions" />
 		</Compiler>
+		<Unit filename="..\config.h" />
 		<Unit filename="..\codeblocks.cpp" />
 		<Unit filename="..\codeblocks.h" />
 		<Unit filename="..\create_project.cpp" />
diff --git a/devtools/create_project/config.h b/devtools/create_project/config.h
new file mode 100644
index 0000000..1609e9e
--- /dev/null
+++ b/devtools/create_project/config.h
@@ -0,0 +1,38 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef TOOLS_CREATE_PROJECT_CONFIG_H
+#define TOOLS_CREATE_PROJECT_CONFIG_H
+
+#define PROJECT_DESCRIPTION "ScummVM"    // Used in console output and build configuration
+#define PROJECT_NAME "scummvm"           // Used for folders, icons, resources and project/solution name
+#define LIBS_DEFINE "SCUMMVM_LIBS"       // Name of the include environment variable
+#define REVISION_DEFINE "SCUMMVM_INTERNAL_REVISION"
+
+#define HAS_VIDEO_FOLDER 1
+//#define ADDITIONAL_LIBRARY ""
+#define NEEDS_RTTI 0
+
+#endif // TOOLS_CREATE_PROJECT_CONFIG_H
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index b896e85..a597ba3 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -29,6 +29,7 @@
 #undef main
 #endif // main
 
+#include "config.h"
 #include "create_project.h"
 #include "codeblocks.h"
 
@@ -150,7 +151,7 @@ int main(int argc, char *argv[]) {
 	using std::cout;
 	for (int i = 2; i < argc; ++i) {
 		if (!std::strcmp(argv[i], "--list-engines")) {
-			cout << " The following enables are available in the ScummVM source distribution\n"
+			cout << " The following enables are available in the " PROJECT_DESCRIPTION " source distribution\n"
 			        " located at \"" << srcDir << "\":\n";
 
 			cout << "   state  |       name      |     description\n\n";
@@ -289,6 +290,11 @@ int main(int argc, char *argv[]) {
 	setup.libraries.push_back("sdl");
 	setup.libraries.push_back("winmm");
 
+	// Add additional project-specific library
+#ifdef ADDITIONAL_LIBRARY
+	setup.libraries.push_back(ADDITIONAL_LIBRARY);
+#endif
+
 // Initialize global & project-specific warnings
 #define SET_GLOBAL_WARNINGS(...) \
 	{ \
@@ -456,7 +462,7 @@ void displayHelp(const char *exe) {
 	cout << "Usage:\n"
 	     << exe << " path\\to\\source [optional options]\n"
 	     << "\n"
-	     << " Creates project files for the ScummVM source located at \"path\\to\\source\".\n"
+	     << " Creates project files for the " PROJECT_DESCRIPTION " source located at \"path\\to\\source\".\n"
 	        " The project files will be created in the directory where tool is run from and\n"
 	        " will include \"path\\to\\source\" for relative file paths, thus be sure that you\n"
 	        " pass a relative file path like \"..\\..\\trunk\".\n"
@@ -482,14 +488,14 @@ void displayHelp(const char *exe) {
 	        " --build-events           Run custom build events as part of the build\n"
 	        "                          (default: false)\n"
 	        "\n"
-	        "ScummVM engine settings:\n"
+	        "Engines settings:\n"
 	        " --list-engines           list all available engines and their default state\n"
 	        " --enable-engine          enable building of the engine with the name \"engine\"\n"
 	        " --disable-engine         disable building of the engine with the name \"engine\"\n"
 	        " --enable-all-engines     enable building of all engines\n"
 	        " --disable-all-engines    disable building of all engines\n"
 	        "\n"
-	        "ScummVM optional feature settings:\n"
+	        "Optional features settings:\n"
 	        " --enable-name            enable inclusion of the feature \"name\"\n"
 	        " --disable-name           disable inclusion of the feature \"name\"\n"
 	        "\n"
@@ -686,25 +692,25 @@ TokenList tokenize(const std::string &input) {
 namespace {
 const Feature s_features[] = {
 	// Libraries
-	{    "libz",        "USE_ZLIB", "zlib", true, "zlib (compression) support" },
-	{     "mad",         "USE_MAD", "libmad", true, "libmad (MP3) support" },
+	{    "libz",        "USE_ZLIB", "zlib",             true, "zlib (compression) support" },
+	{     "mad",         "USE_MAD", "libmad",           true, "libmad (MP3) support" },
 	{  "vorbis",      "USE_VORBIS", "libvorbisfile_static libvorbis_static libogg_static", true, "Ogg Vorbis support" },
-	{    "flac",        "USE_FLAC", "libFLAC_static", true, "FLAC support" },
-	{   "png",           "USE_PNG", "libpng", true, "libpng support" },
-	{   "theora",  "USE_THEORADEC", "libtheora_static", true, "Theora decoding support" },
-	{   "mpeg2",       "USE_MPEG2", "libmpeg2", false, "mpeg2 codec for cutscenes" },
-
-	// ScummVM feature flags
-	{     "scalers",     "USE_SCALERS", "", true, "Scalers" },
-	{   "hqscalers",  "USE_HQ_SCALERS", "", true, "HQ scalers" },
-	{       "16bit",   "USE_RGB_COLOR", "", true, "16bit color support" },
-	{     "mt32emu",     "USE_MT32EMU", "", true, "integrated MT-32 emulator" },
-	{        "nasm",        "USE_NASM", "", true, "IA-32 assembly support" }, // This feature is special in the regard, that it needs additional handling.
+	{    "flac",        "USE_FLAC", "libFLAC_static",   true, "FLAC support" },
+	{     "png",         "USE_PNG", "libpng",           true, "libpng support" },
+	{  "theora",   "USE_THEORADEC", "libtheora_static", true, "Theora decoding support" },
+	{   "mpeg2",       "USE_MPEG2", "libmpeg2",         false, "mpeg2 codec for cutscenes" },
+
+	// Feature flags
+	{     "scalers",     "USE_SCALERS",         "", true, "Scalers" },
+	{   "hqscalers",  "USE_HQ_SCALERS",         "", true, "HQ scalers" },
+	{       "16bit",   "USE_RGB_COLOR",         "", true, "16bit color support" },
+	{     "mt32emu",     "USE_MT32EMU",         "", true, "integrated MT-32 emulator" },
+	{        "nasm",        "USE_NASM",         "", true, "IA-32 assembly support" }, // This feature is special in the regard, that it needs additional handling.
 	{      "opengl",      "USE_OPENGL", "opengl32", true, "OpenGL support" },
-	{      "indeo3",      "USE_INDEO3", "", true, "Indeo3 codec support"},
-	{ "translation", "USE_TRANSLATION", "", true, "Translation support" },
-	{  "langdetect",  "USE_DETECTLANG", "", true, "System language detection support" } // This feature actually depends on "translation", there
-	                                                                                    // is just no current way of properly detecting this...
+	{      "indeo3",      "USE_INDEO3",         "", true, "Indeo3 codec support"},
+	{ "translation", "USE_TRANSLATION",         "", true, "Translation support" },
+	{  "langdetect",  "USE_DETECTLANG",         "", true, "System language detection support" } // This feature actually depends on "translation", there
+	                                                                                            // is just no current way of properly detecting this...
 };
 } // End of anonymous namespace
 
@@ -977,7 +983,7 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
 	_uuidMap = createUUIDMap(setup);
 
 	// We also need to add the UUID of the main project file.
-	const std::string svmUUID = _uuidMap["scummvm"] = createUUID();
+	const std::string svmUUID = _uuidMap[PROJECT_NAME] = createUUID();
 
 	// Create Solution/Workspace file
 	createWorkspace(setup);
@@ -986,7 +992,7 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
 
 	// Create engine project files
 	for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
-		if (i->first == "scummvm")
+		if (i->first == PROJECT_NAME)
 			continue;
 
 		in.clear(); ex.clear();
@@ -996,10 +1002,10 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
 		createProjectFile(i->first, i->second, setup, moduleDir, in, ex);
 	}
 
-	// Last but not least create the main ScummVM project file.
+	// Last but not least create the main project file.
 	in.clear(); ex.clear();
 
-	// File list for the ScummVM project file
+	// File list for the Project file
 	createModuleList(setup.srcDir + "/backends", setup.defines, in, ex);
 	createModuleList(setup.srcDir + "/backends/platform/sdl", setup.defines, in, ex);
 	createModuleList(setup.srcDir + "/base", setup.defines, in, ex);
@@ -1009,11 +1015,13 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
 	createModuleList(setup.srcDir + "/gui", setup.defines, in, ex);
 	createModuleList(setup.srcDir + "/audio", setup.defines, in, ex);
 	createModuleList(setup.srcDir + "/audio/softsynth/mt32", setup.defines, in, ex);
+#if HAS_VIDEO_FOLDER
 	createModuleList(setup.srcDir + "/video", setup.defines, in, ex);
+#endif
 
 	// Resource files
-	in.push_back(setup.srcDir + "/icons/scummvm.ico");
-	in.push_back(setup.srcDir + "/dists/scummvm.rc");
+	in.push_back(setup.srcDir + "/icons/" + PROJECT_NAME + ".ico");
+	in.push_back(setup.srcDir + "/dists/" + PROJECT_NAME + ".rc");
 
 	// Various text files
 	in.push_back(setup.srcDir + "/AUTHORS");
@@ -1024,8 +1032,8 @@ void ProjectProvider::createProject(const BuildSetup &setup) {
 	in.push_back(setup.srcDir + "/README");
 	in.push_back(setup.srcDir + "/TODO");
 
-	// Create the scummvm project file.
-	createProjectFile("scummvm", svmUUID, setup, setup.srcDir, in, ex);
+	// Create the main project file.
+	createProjectFile(PROJECT_NAME, svmUUID, setup, setup.srcDir, in, ex);
 
 	// Create other misc. build files
 	createOtherBuildFiles(setup);
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index 8c4b8c7..c228c34 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -105,13 +105,13 @@ struct EngineDesc {
 typedef std::list<EngineDesc> EngineDescList;
 
 /**
- * This function parses the ScummVM configure file and creates a list
+ * This function parses the project configure file and creates a list
  * of available engines.
  *
  * It will also automatically setup the default build state (enabled
  * or disabled) to the state specified in the "configure" file.
  *
- * @param srcDir Path to the root of the ScummVM source.
+ * @param srcDir Path to the root of the project source.
  * @return List of available engines.
  */
 EngineDescList parseConfigure(const std::string &srcDir);
@@ -206,11 +206,11 @@ bool setFeatureBuildState(const std::string &name, FeatureList &features, bool e
  * Structure to describe a build setup.
  *
  * This includes various information about which engines to
- * enable, which features should be built into ScummVM.
- * It also contains the path to the ScummVM souce root.
+ * enable, which features should be built into the main executable.
+ * It also contains the path to the project source root.
  */
 struct BuildSetup {
-	std::string srcDir;     ///< Path to the ScummVM sources.
+	std::string srcDir;     ///< Path to the sources.
 	std::string filePrefix; ///< Prefix for the relative path arguments in the project files.
 	std::string outputDir;  ///< Path where to put the MSVC project files.
 
diff --git a/devtools/create_project/msbuild.cpp b/devtools/create_project/msbuild.cpp
index 1198ff9..9d8b9c0 100644
--- a/devtools/create_project/msbuild.cpp
+++ b/devtools/create_project/msbuild.cpp
@@ -23,10 +23,10 @@
  *
  */
 
+#include "config.h"
 #include "msbuild.h"
 
 #include <fstream>
-
 #include <algorithm>
 
 namespace CreateProjectTool {
@@ -60,7 +60,7 @@ int MSBuildProvider::getVisualStudioVersion() {
 
 #define OUTPUT_CONFIGURATION_TYPE_MSBUILD(config) \
 	(project << "\t<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='" << config << "'\" Label=\"Configuration\">\n" \
-	           "\t\t<ConfigurationType>" << (name == "scummvm" ? "Application" : "StaticLibrary") << "</ConfigurationType>\n" \
+	           "\t\t<ConfigurationType>" << (name == PROJECT_NAME ? "Application" : "StaticLibrary") << "</ConfigurationType>\n" \
 	           "\t</PropertyGroup>\n")
 
 #define OUTPUT_PROPERTIES_MSBUILD(config, properties) \
@@ -110,12 +110,12 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
 	           "\t<ImportGroup Label=\"ExtensionSettings\">\n"
 	           "\t</ImportGroup>\n";
 
-	OUTPUT_PROPERTIES_MSBUILD("Release|Win32",  "ScummVM_Release.props");
-	OUTPUT_PROPERTIES_MSBUILD("Analysis|Win32", "ScummVM_Analysis.props");
-	OUTPUT_PROPERTIES_MSBUILD("Debug|Win32",    "ScummVM_Debug.props");
-	OUTPUT_PROPERTIES_MSBUILD("Release|x64",    "ScummVM_Release64.props");
-	OUTPUT_PROPERTIES_MSBUILD("Analysis|x64",   "ScummVM_Analysis64.props");
-	OUTPUT_PROPERTIES_MSBUILD("Debug|x64",      "ScummVM_Debug64.props");
+	OUTPUT_PROPERTIES_MSBUILD("Release|Win32",  PROJECT_DESCRIPTION "_Release.props");
+	OUTPUT_PROPERTIES_MSBUILD("Analysis|Win32", PROJECT_DESCRIPTION "_Analysis.props");
+	OUTPUT_PROPERTIES_MSBUILD("Debug|Win32",    PROJECT_DESCRIPTION "_Debug.props");
+	OUTPUT_PROPERTIES_MSBUILD("Release|x64",    PROJECT_DESCRIPTION "_Release64.props");
+	OUTPUT_PROPERTIES_MSBUILD("Analysis|x64",   PROJECT_DESCRIPTION "_Analysis64.props");
+	OUTPUT_PROPERTIES_MSBUILD("Debug|x64",      PROJECT_DESCRIPTION "_Debug64.props");
 
 	project << "\t<PropertyGroup Label=\"UserMacros\" />\n";
 
@@ -140,8 +140,8 @@ void MSBuildProvider::createProjectFile(const std::string &name, const std::stri
 	else
 		addFilesToProject(moduleDir, project, includeList, excludeList, setup.filePrefix);
 
-	// Output references for scummvm project
-	if (name == "scummvm")
+	// Output references for the main project
+	if (name == PROJECT_NAME)
 		writeReferences(project);
 
 	project << "\t<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\" />\n"
@@ -212,7 +212,7 @@ void MSBuildProvider::writeReferences(std::ofstream &output) {
 	output << "\t<ItemGroup>\n";
 
 	for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
-		if (i->first == "scummvm")
+		if (i->first == PROJECT_NAME)
 			continue;
 
 		output << "\t<ProjectReference Include=\"" << i->first << ".vcxproj\">\n"
@@ -230,7 +230,7 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
 	std::map<std::string, StringList>::iterator warningsIterator = _projectWarnings.find(name);
 
 	// Nothing to add here, move along!
-	if (name != "scummvm" && name != "sword25" && name != "tinsel" && warningsIterator == _projectWarnings.end())
+	if (name != PROJECT_NAME && name != "sword25" && name != "tinsel" && name != "grim" && warningsIterator == _projectWarnings.end())
 		return;
 
 	std::string warnings = "";
@@ -242,7 +242,7 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
 	           "\t\t<ClCompile>\n";
 
 	// Compile configuration
-	if (name == "scummvm" || name == "sword25") {
+	if (name == PROJECT_NAME || name == "sword25" || name == "grim") {
 		project << "\t\t\t<DisableLanguageExtensions>false</DisableLanguageExtensions>\n";
 	} else {
 		if (name == "tinsel" && !isRelease)
@@ -254,21 +254,21 @@ void MSBuildProvider::outputProjectSettings(std::ofstream &project, const std::s
 
 	project << "\t\t</ClCompile>\n";
 
-	// Link configuration for scummvm project
-	if (name == "scummvm") {
+	// Link configuration for main project
+	if (name == PROJECT_NAME) {
 		std::string libraries;
 
 		for (StringList::const_iterator i = setup.libraries.begin(); i != setup.libraries.end(); ++i)
 			libraries += *i + ".lib;";
 
 		project << "\t\t<Link>\n"
-		           "\t\t\t<OutputFile>$(OutDir)scummvm.exe</OutputFile>\n"
+		           "\t\t\t<OutputFile>$(OutDir)" << PROJECT_NAME << ".exe</OutputFile>\n"
 		           "\t\t\t<AdditionalDependencies>" << libraries << "%(AdditionalDependencies)</AdditionalDependencies>\n"
 		           "\t\t</Link>\n";
 
 		if (setup.runBuildEvents) {
 			project << "\t\t<PreBuildEvent>\n"
-			           "\t\t\t<Message>Generate internal_version_build.h</Message>\n"
+			           "\t\t\t<Message>Generate revision</Message>\n"
 			           "\t\t\t<Command>" << getPreBuildEvent() << "</Command>\n"
 			           "\t\t</PreBuildEvent>\n";
 
@@ -295,16 +295,16 @@ void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits,
 
 	// Add define to include revision header
 	if (runBuildEvents)
-		definesList += "SCUMMVM_INTERNAL_REVISION;";
+		definesList += REVISION_DEFINE ";";
 
 	properties << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
 	              "<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n"
 	              "\t<PropertyGroup>\n"
-	              "\t\t<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n"
-	              "\t\t<_PropertySheetDisplayName>ScummVM_Global</_PropertySheetDisplayName>\n"
-	              "\t\t<ExecutablePath>$(SCUMMVM_LIBS)\\bin;$(ExecutablePath)</ExecutablePath>\n"
-	              "\t\t<LibraryPath>$(SCUMMVM_LIBS)\\lib\\" << (bits == 32 ? "x86" : "x64") << ";$(LibraryPath)</LibraryPath>\n"
-	              "\t\t<IncludePath>$(SCUMMVM_LIBS)\\include;$(IncludePath)</IncludePath>\n"
+	              "\t\t<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\n"
+	              "\t\t<_PropertySheetDisplayName>" << PROJECT_DESCRIPTION << "_Global</_PropertySheetDisplayName>\n"
+	              "\t\t<ExecutablePath>$(" << LIBS_DEFINE << ")\\bin;$(ExecutablePath)</ExecutablePath>\n"
+	              "\t\t<LibraryPath>$(" << LIBS_DEFINE << ")\\lib\\" << (bits == 32 ? "x86" : "x64") << ";$(LibraryPath)</LibraryPath>\n"
+	              "\t\t<IncludePath>$(" << LIBS_DEFINE << ")\\include;$(IncludePath)</IncludePath>\n"
 	              "\t\t<OutDir>$(Configuration)" << bits << "\\</OutDir>\n"
 	              "\t\t<IntDir>$(Configuration)" << bits << "/$(ProjectName)\\</IntDir>\n"
 	              "\t</PropertyGroup>\n"
@@ -312,11 +312,17 @@ void MSBuildProvider::outputGlobalPropFile(std::ofstream &properties, int bits,
 	              "\t\t<ClCompile>\n"
 	              "\t\t\t<DisableLanguageExtensions>true</DisableLanguageExtensions>\n"
 	              "\t\t\t<DisableSpecificWarnings>" << warnings << ";%(DisableSpecificWarnings)</DisableSpecificWarnings>\n"
-	              "\t\t\t<AdditionalIncludeDirectories>$(SCUMMVM_LIBS)\\include;" << prefix << ";" << prefix << "\\engines;$(TargetDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n"
+	              "\t\t\t<AdditionalIncludeDirectories>$(" << LIBS_DEFINE << ")\\include;" << prefix << ";" << prefix << "\\engines;$(TargetDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\n"
 	              "\t\t\t<PreprocessorDefinitions>" << definesList << "%(PreprocessorDefinitions)</PreprocessorDefinitions>\n"
-	              "\t\t\t<ExceptionHandling></ExceptionHandling>\n"
-	              "\t\t\t<RuntimeTypeInfo>false</RuntimeTypeInfo>\n"
-	              "\t\t\t<WarningLevel>Level4</WarningLevel>\n"
+	              "\t\t\t<ExceptionHandling></ExceptionHandling>\n";
+
+#if NEEDS_RTTI
+	properties << "\t\t\t<RuntimeTypeInfo>true</RuntimeTypeInfo>\n";
+#else
+	properties << "\t\t\t<RuntimeTypeInfo>false</RuntimeTypeInfo>\n";
+#endif
+
+	properties << "\t\t\t<WarningLevel>Level4</WarningLevel>\n"
 	              "\t\t\t<TreatWarningAsError>false</TreatWarningAsError>\n"
 	              "\t\t\t<CompileAs>Default</CompileAs>\n"
 	              "\t\t</ClCompile>\n"
@@ -339,18 +345,18 @@ void MSBuildProvider::createBuildProp(const BuildSetup &setup, bool isRelease, b
 	const std::string outputType = (enableAnalysis ? "Analysis" : (isRelease ? "Release" : "Debug"));
 	const std::string outputBitness = (isWin32 ? "32" : "64");
 
-	std::ofstream properties((setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str());
+	std::ofstream properties((setup.outputDir + '/' + PROJECT_DESCRIPTION "_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str());
 	if (!properties)
-		error("Could not open \"" + setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension() + "\" for writing");
+		error("Could not open \"" + setup.outputDir + '/' + PROJECT_DESCRIPTION "_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension() + "\" for writing");
 
 	properties << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
 	              "<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n"
 	              "\t<ImportGroup Label=\"PropertySheets\">\n"
-	              "\t\t<Import Project=\"ScummVM_Global" << (isWin32 ? "" : "64") << ".props\" />\n"
+	              "\t\t<Import Project=\"" << PROJECT_DESCRIPTION << "_Global" << (isWin32 ? "" : "64") << ".props\" />\n"
 	              "\t</ImportGroup>\n"
 	              "\t<PropertyGroup>\n"
-	              "\t\t<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\n"
-	              "\t\t<_PropertySheetDisplayName>ScummVM_" << outputType << outputBitness << "</_PropertySheetDisplayName>\n"
+	              "\t\t<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\n"
+	              "\t\t<_PropertySheetDisplayName>" << PROJECT_DESCRIPTION << "_" << outputType << outputBitness << "</_PropertySheetDisplayName>\n"
 	              "\t\t<LinkIncremental>" << (isRelease ? "false" : "true") << "</LinkIncremental>\n"
 	              "\t</PropertyGroup>\n"
 	              "\t<ItemDefinitionGroup>\n"
diff --git a/devtools/create_project/msvc.cpp b/devtools/create_project/msvc.cpp
index ccdf4ac..49998cd 100644
--- a/devtools/create_project/msvc.cpp
+++ b/devtools/create_project/msvc.cpp
@@ -23,10 +23,10 @@
  *
  */
 
+#include "config.h"
 #include "msvc.h"
 
 #include <fstream>
-
 #include <algorithm>
 
 namespace CreateProjectTool {
@@ -39,23 +39,23 @@ MSVCProvider::MSVCProvider(StringList &global_warnings, std::map<std::string, St
 }
 
 void MSVCProvider::createWorkspace(const BuildSetup &setup) {
-	UUIDMap::const_iterator svmUUID = _uuidMap.find("scummvm");
+	UUIDMap::const_iterator svmUUID = _uuidMap.find(PROJECT_NAME);
 	if (svmUUID == _uuidMap.end())
-		error("No UUID for \"scummvm\" project created");
+		error("No UUID for \"" PROJECT_NAME "\" project created");
 
 	const std::string svmProjectUUID = svmUUID->second;
 	assert(!svmProjectUUID.empty());
 
 	std::string solutionUUID = createUUID();
 
-	std::ofstream solution((setup.outputDir + '/' + "scummvm.sln").c_str());
+	std::ofstream solution((setup.outputDir + '/' + PROJECT_NAME ".sln").c_str());
 	if (!solution)
-		error("Could not open \"" + setup.outputDir + '/' + "scummvm.sln\" for writing");
+		error("Could not open \"" + setup.outputDir + '/' + PROJECT_NAME ".sln\" for writing");
 
 	solution << "Microsoft Visual Studio Solution File, Format Version " << _version + 1 << ".00\n";
 	solution << "# Visual Studio " << getVisualStudioVersion() << "\n";
 
-	solution << "Project(\"{" << solutionUUID << "}\") = \"scummvm\", \"scummvm" << getProjectExtension() << "\", \"{" << svmProjectUUID << "}\"\n";
+	solution << "Project(\"{" << solutionUUID << "}\") = \"" << PROJECT_NAME << "\", \"" << PROJECT_NAME << getProjectExtension() << "\", \"{" << svmProjectUUID << "}\"\n";
 
 	// Project dependencies are moved to vcxproj files in Visual Studio 2010
 	if (_version < 10)
@@ -65,7 +65,7 @@ void MSVCProvider::createWorkspace(const BuildSetup &setup) {
 
 	// Note we assume that the UUID map only includes UUIDs for enabled engines!
 	for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
-		if (i->first == "scummvm")
+		if (i->first == PROJECT_NAME)
 			continue;
 
 		solution << "Project(\"{" << solutionUUID << "}\") = \"" << i->first << "\", \"" << i->first << getProjectExtension() << "\", \"{" << i->second << "}\"\n"
@@ -120,16 +120,16 @@ void MSVCProvider::createOtherBuildFiles(const BuildSetup &setup) {
 }
 
 void MSVCProvider::createGlobalProp(const BuildSetup &setup) {
-	std::ofstream properties((setup.outputDir + '/' + "ScummVM_Global" + getPropertiesExtension()).c_str());
+	std::ofstream properties((setup.outputDir + '/' + PROJECT_DESCRIPTION "_Global" + getPropertiesExtension()).c_str());
 	if (!properties)
-		error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Global" + getPropertiesExtension() + "\" for writing");
+		error("Could not open \"" + setup.outputDir + '/' + PROJECT_DESCRIPTION "_Global" + getPropertiesExtension() + "\" for writing");
 
 	outputGlobalPropFile(properties, 32, setup.defines, convertPathToWin(setup.filePrefix), setup.runBuildEvents);
 	properties.close();
 
-	properties.open((setup.outputDir + '/' + "ScummVM_Global64" + getPropertiesExtension()).c_str());
+	properties.open((setup.outputDir + '/' + PROJECT_DESCRIPTION "_Global64" + getPropertiesExtension()).c_str());
 	if (!properties)
-		error("Could not open \"" + setup.outputDir + '/' + "ScummVM_Global64" + getPropertiesExtension() + "\" for writing");
+		error("Could not open \"" + setup.outputDir + '/' + PROJECT_DESCRIPTION "_Global64" + getPropertiesExtension() + "\" for writing");
 
 	// HACK: We must disable the "nasm" feature for x64. To achieve that we must duplicate the feature list and
 	// recreate a define list.
@@ -168,6 +168,8 @@ std::string MSVCProvider::getPostBuildEvent(bool isWin32) const {
 
 	cmdLine += (isWin32) ? "x86" : "x64";
 
+	cmdLine += " %SCUMMVM_LIBS%";
+
 	cmdLine += "\n"
 	           "EXIT /B0";
 
diff --git a/devtools/create_project/msvc10/create_project.vcxproj b/devtools/create_project/msvc10/create_project.vcxproj
index 532d6db..15ce217 100644
--- a/devtools/create_project/msvc10/create_project.vcxproj
+++ b/devtools/create_project/msvc10/create_project.vcxproj
@@ -101,6 +101,7 @@ xcopy /Y $(TargetPath) $(SolutionDir)\..\..\..\dists\codeblocks\</Command>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\codeblocks.h" />
+    <ClInclude Include="..\config.h" />
     <ClInclude Include="..\create_project.h" />
     <ClInclude Include="..\msbuild.h" />
     <ClInclude Include="..\msvc.h" />
diff --git a/devtools/create_project/msvc10/create_project.vcxproj.filters b/devtools/create_project/msvc10/create_project.vcxproj.filters
index 7922e1e..42db5aa 100644
--- a/devtools/create_project/msvc10/create_project.vcxproj.filters
+++ b/devtools/create_project/msvc10/create_project.vcxproj.filters
@@ -27,6 +27,9 @@
     <ClInclude Include="..\visualstudio.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\config.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\codeblocks.cpp">
diff --git a/devtools/create_project/msvc8/create_project.vcproj b/devtools/create_project/msvc8/create_project.vcproj
index bc3b243..9cd833e 100644
--- a/devtools/create_project/msvc8/create_project.vcproj
+++ b/devtools/create_project/msvc8/create_project.vcproj
@@ -199,6 +199,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\config.h"
+				>
+			</File>
+			<File
 				RelativePath="..\msvc.h"
 				>
 			</File>
diff --git a/devtools/create_project/msvc9/create_project.vcproj b/devtools/create_project/msvc9/create_project.vcproj
index c89b88a..4e0375c 100644
--- a/devtools/create_project/msvc9/create_project.vcproj
+++ b/devtools/create_project/msvc9/create_project.vcproj
@@ -200,6 +200,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\config.h"
+				>
+			</File>
+			<File
 				RelativePath="..\msvc.h"
 				>
 			</File>
diff --git a/devtools/create_project/scripts/postbuild.cmd b/devtools/create_project/scripts/postbuild.cmd
index f548b81..6c062f7 100644
--- a/devtools/create_project/scripts/postbuild.cmd
+++ b/devtools/create_project/scripts/postbuild.cmd
@@ -11,10 +11,12 @@ REM Expected parameters
 REM    Root folder

 REM    Output folder

 REM    Architecture

+REM    Libs folder

 

 if "%~1"=="" goto error_root

 if "%~2"=="" goto error_output

 if "%~3"=="" goto error_arch

+if "%~4"=="" goto error_libs

 

 echo Copying data files

 echo.

@@ -26,7 +28,7 @@ xcopy /F /Y "%~1/dists/engine-data/*.cpt" %~2 > NUL 2>&1
 xcopy /F /Y "%~1/dists/engine-data/README" %~2 > NUL 2>&1

 xcopy /F /Y "%~1/gui/themes/*.zip" %~2 > NUL 2>&1

 xcopy /F /Y "%~1/gui/themes/translations.dat" %~2 > NUL 2>&1

-xcopy /F /Y "%SCUMMVM_LIBS%/lib/%~3/SDL.dll" %~2 > NUL 2>&1

+xcopy /F /Y "%~4/lib/%~3/SDL.dll" %~2 > NUL 2>&1

 goto done

 

 :error_root

@@ -41,5 +43,9 @@ goto done
 echo Invalid arch parameter (was: %~3, allowed: x86, x64)!

 goto done

 

+:error_libs

+echo Invalid libs folder (%~4)!

+goto done

+

 :done

 exit /B0

diff --git a/devtools/create_project/visualstudio.cpp b/devtools/create_project/visualstudio.cpp
index 41693dc..2997e30 100644
--- a/devtools/create_project/visualstudio.cpp
+++ b/devtools/create_project/visualstudio.cpp
@@ -23,10 +23,10 @@
  *
  */
 
+#include "config.h"
 #include "visualstudio.h"
 
 #include <fstream>
-
 #include <algorithm>
 
 namespace CreateProjectTool {
@@ -54,7 +54,7 @@ int VisualStudioProvider::getVisualStudioVersion() {
 	if (_version == 8)
 		return 2005;
 
-	error("Unsupported version passed to createScummVMSolution");
+	error("Unsupported version passed to getVisualStudioVersion");
 }
 
 #define OUTPUT_BUILD_EVENTS(isWin32) \
@@ -67,20 +67,20 @@ int VisualStudioProvider::getVisualStudioVersion() {
 		           "\t\t\t/>\n"; \
 	}
 
-#define OUTPUT_CONFIGURATION_SCUMMVM(config, platform, props, isWin32) { \
-	project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\ScummVM_" << config << props << ".vsprops\">\n" \
+#define OUTPUT_CONFIGURATION_MAIN(config, platform, props, isWin32) { \
+	project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" \
 	           "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n" \
-	           "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/scummvm.exe\"\n" \
+	           "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/" << PROJECT_NAME << "\"\n" \
 	           "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" \
 	           "\t\t\t/>\n"; \
 	OUTPUT_BUILD_EVENTS(isWin32) \
 	project << "\t\t</Configuration>\n"; \
 }
 
-#define OUTPUT_CONFIGURATION_SCUMMVM_DEBUG(config, platform, props, isWin32) { \
-	project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\ScummVM_" << config << props << ".vsprops\">\n" \
+#define OUTPUT_CONFIGURATION_DEBUG(config, platform, props, isWin32) { \
+	project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"1\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" \
 	           "\t\t\t<Tool\tName=\"VCCLCompilerTool\" DisableLanguageExtensions=\"false\" />\n" \
-	           "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/scummvm.exe\"\n" \
+	           "\t\t\t<Tool\tName=\"VCLinkerTool\" OutputFile=\"$(OutDir)/" << PROJECT_NAME << ".exe\"\n" \
 	           "\t\t\t\tAdditionalDependencies=\"" << libraries << "\"\n" \
 	           "\t\t\t/>\n"; \
 	OUTPUT_BUILD_EVENTS(isWin32) \
@@ -88,7 +88,7 @@ int VisualStudioProvider::getVisualStudioVersion() {
 }
 
 #define OUTPUT_CONFIGURATION(config, platform, props) { \
-	project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\ScummVM_" << config << props << ".vsprops\">\n" \
+	project << "\t\t<Configuration Name=\"" << config << "|" << platform << "\" ConfigurationType=\"4\" InheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_" << config << props << ".vsprops\">\n" \
 	           "\t\t\t<Tool Name=\"VCCLCompilerTool\" "<< toolConfig << "/>\n" \
 	           "\t\t</Configuration>\n"; \
 }
@@ -122,24 +122,24 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
 	// Check for project-specific warnings:
 	std::map< std::string, std::list<std::string> >::iterator warningsIterator = _projectWarnings.find(name);
 
-	if (name == "scummvm") {
+	if (name == PROJECT_NAME) {
 		std::string libraries;
 
 		for (StringList::const_iterator i = setup.libraries.begin(); i != setup.libraries.end(); ++i)
 			libraries += ' ' + *i + ".lib";
 
 		// Win32
-		OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Debug", "Win32", "", true);
-		OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Analysis", "Win32", "", true);
-		OUTPUT_CONFIGURATION_SCUMMVM("Release", "Win32", "", true);
+		OUTPUT_CONFIGURATION_DEBUG("Debug", "Win32", "", true);
+		OUTPUT_CONFIGURATION_DEBUG("Analysis", "Win32", "", true);
+		OUTPUT_CONFIGURATION_MAIN("Release", "Win32", "", true);
 
 		// x64
 		// For 'x64' we must disable NASM support. Usually we would need to disable the "nasm" feature for that and
 		// re-create the library list, BUT since NASM doesn't link any additional libraries, we can just use the
 		// libraries list created for IA-32. If that changes in the future, we need to adjust this part!
-		OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Debug", "x64", "64", false);
-		OUTPUT_CONFIGURATION_SCUMMVM_DEBUG("Analysis", "x64", "64", false);
-		OUTPUT_CONFIGURATION_SCUMMVM("Release", "x64", "64", false);
+		OUTPUT_CONFIGURATION_DEBUG("Debug", "x64", "64", false);
+		OUTPUT_CONFIGURATION_DEBUG("Analysis", "x64", "64", false);
+		OUTPUT_CONFIGURATION_MAIN("Release", "x64", "64", false);
 
 	} else {
 		std::string warnings = "";
@@ -151,6 +151,7 @@ void VisualStudioProvider::createProjectFile(const std::string &name, const std:
 		toolConfig  = (!warnings.empty() ? "DisableSpecificWarnings=\"" + warnings + "\"" : "");
 		toolConfig += (name == "tinsel" ? "DebugInformationFormat=\"3\" " : "");
 		toolConfig += (name == "sword25" ? "DisableLanguageExtensions=\"false\" " : "");
+		toolConfig += (name == "grim" ? "DisableLanguageExtensions=\"false\" " : "");
 
 		// Win32
 		OUTPUT_CONFIGURATION("Debug", "Win32", "");
@@ -184,7 +185,7 @@ void VisualStudioProvider::writeReferences(std::ofstream &output) {
 	output << "\tProjectSection(ProjectDependencies) = postProject\n";
 
 	for (UUIDMap::const_iterator i = _uuidMap.begin(); i != _uuidMap.end(); ++i) {
-		if (i->first == "scummvm")
+		if (i->first == PROJECT_NAME)
 			continue;
 
 		output << "\t\t{" << i->second << "} = {" << i->second << "}\n";
@@ -207,13 +208,13 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
 
 	// Add define to include revision header
 	if (runBuildEvents)
-		definesList += "SCUMMVM_INTERNAL_REVISION;";
+		definesList += REVISION_DEFINE ";";
 
 	properties << "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n"
 	              "<VisualStudioPropertySheet\n"
 	              "\tProjectType=\"Visual C++\"\n"
 	              "\tVersion=\"8.00\"\n"
-	              "\tName=\"ScummVM_Global\"\n"
+	              "\tName=\"" << PROJECT_DESCRIPTION << "_Global\"\n"
 	              "\tOutputDirectory=\"$(ConfigurationName)" << bits << "\"\n"
 	              "\tIntermediateDirectory=\"$(ConfigurationName)" << bits << "/$(ProjectName)\"\n"
 	              "\t>\n"
@@ -221,10 +222,17 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
 	              "\t\tName=\"VCCLCompilerTool\"\n"
 	              "\t\tDisableLanguageExtensions=\"true\"\n"
 	              "\t\tDisableSpecificWarnings=\"" << warnings << "\"\n"
-	              "\t\tAdditionalIncludeDirectories=\"" << prefix << ";" << prefix << "\\engines;$(SCUMMVM_LIBS)\\include;$(TargetDir)\"\n"
+	              "\t\tAdditionalIncludeDirectories=\"" << prefix << ";" << prefix << "\\engines;$(" << LIBS_DEFINE << ")\\include;$(TargetDir)\"\n"
 	              "\t\tPreprocessorDefinitions=\"" << definesList << "\"\n"
-	              "\t\tExceptionHandling=\"0\"\n"
-	              "\t\tRuntimeTypeInfo=\"false\"\n"
+	              "\t\tExceptionHandling=\"0\"\n";
+
+#if NEEDS_RTTI
+	properties << "\t\tRuntimeTypeInfo=\"true\"\n";
+#else
+	properties << "\t\tRuntimeTypeInfo=\"false\"\n";
+#endif
+
+	properties << "\t\tRuntimeTypeInfo=\"false\"\n"
 	              "\t\tWarningLevel=\"4\"\n"
 	              "\t\tWarnAsError=\"false\"\n"
 	              "\t\tCompileAs=\"0\"\n"
@@ -238,7 +246,7 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
 	              "\t\tIgnoreDefaultLibraryNames=\"\"\n"
 	              "\t\tSubSystem=\"1\"\n"
 	              "\t\tEntryPointSymbol=\"WinMainCRTStartup\"\n"
-	              "\t\tAdditionalLibraryDirectories=\"$(SCUMMVM_LIBS)\\lib\\" << ((bits == 32) ? "x86" : "x64") << "\"\n"
+	              "\t\tAdditionalLibraryDirectories=\"$(" << LIBS_DEFINE << ")\\lib\\" << ((bits == 32) ? "x86" : "x64") << "\"\n"
 	              "\t/>\n"
 	              "\t<Tool\n"
 	              "\t\tName=\"VCResourceCompilerTool\"\n"
@@ -254,16 +262,16 @@ void VisualStudioProvider::createBuildProp(const BuildSetup &setup, bool isRelea
 	const std::string outputType = (enableAnalysis ? "Analysis" : (isRelease ? "Release" : "Debug"));
 	const std::string outputBitness = (isWin32 ? "32" : "64");
 
-	std::ofstream properties((setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str());
+	std::ofstream properties((setup.outputDir + '/' + PROJECT_DESCRIPTION "_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension()).c_str());
 	if (!properties)
-		error("Could not open \"" + setup.outputDir + '/' + "ScummVM_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension() + "\" for writing");
+		error("Could not open \"" + setup.outputDir + '/' + PROJECT_DESCRIPTION "_" + outputType + (isWin32 ? "" : "64") + getPropertiesExtension() + "\" for writing");
 
 	properties << "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n"
 	              "<VisualStudioPropertySheet\n"
 	              "\tProjectType=\"Visual C++\"\n"
 	              "\tVersion=\"8.00\"\n"
-	              "\tName=\"ScummVM_" << outputType << outputBitness << "\"\n"
-	              "\tInheritedPropertySheets=\".\\ScummVM_Global" << (isWin32 ? "" : "64") << ".vsprops\"\n"
+	              "\tName=\"" << PROJECT_DESCRIPTION << "_" << outputType << outputBitness << "\"\n"
+	              "\tInheritedPropertySheets=\".\\" << PROJECT_DESCRIPTION << "_Global" << (isWin32 ? "" : "64") << ".vsprops\"\n"
 	              "\t>\n"
 	              "\t<Tool\n"
 	              "\t\tName=\"VCCLCompilerTool\"\n";


Commit: 62e823300993fe1932173f8800b4088a20b75924
    https://github.com/scummvm/scummvm/commit/62e823300993fe1932173f8800b4088a20b75924
Author: Littleboy (littleboy at users.sourceforge.net)
Date: 2011-04-24T14:08:07-07:00

Commit Message:
COMMON: Fix MSVC warning in PEResources::parseResourceLevel()

Changed paths:
    common/winexe_pe.cpp



diff --git a/common/winexe_pe.cpp b/common/winexe_pe.cpp
index 17db004..99d44ca 100644
--- a/common/winexe_pe.cpp
+++ b/common/winexe_pe.cpp
@@ -123,7 +123,7 @@ void PEResources::parseResourceLevel(Section &section, uint32 offset, int level)
 	uint16 namedEntryCount = _exe->readUint16LE();
 	uint16 intEntryCount = _exe->readUint16LE();
 
-	for (uint32 i = 0; i < namedEntryCount + intEntryCount; i++) {
+	for (uint32 i = 0; i < (uint32)(namedEntryCount + intEntryCount); i++) {
 		uint32 value = _exe->readUint32LE();
 
 		WinResourceID id;






More information about the Scummvm-git-logs mailing list