Model loading update + build config update

This commit is contained in:
turanszkij
2016-09-11 22:13:34 +02:00
parent af94e51622
commit 1e0703a8c0
6 changed files with 29 additions and 10 deletions
@@ -93,6 +93,7 @@
<PreprocessorDefinitions>_WIN32_WINNT=0x0601;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>BULLET;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -116,6 +117,7 @@
<PreprocessorDefinitions>_WIN32_WINNT=0x0601;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>BULLET;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
+10
View File
@@ -88,3 +88,13 @@ bool wiArchive::SaveFile(const string& fileName)
return false;
}
string wiArchive::GetSourceDirectory()
{
return wiHelper::GetDirectoryFromPath(fileName);
}
string wiArchive::GetSourceFileName()
{
return fileName;
}
+2
View File
@@ -21,6 +21,8 @@ public:
bool IsOpen();
void Close();
bool SaveFile(const string& fileName);
string GetSourceDirectory();
string GetSourceFileName();
// It could be templated but we have to be extremely careful of different datasizes on different platforms
// because serialized data should be interchangeable!
+10
View File
@@ -172,6 +172,11 @@ namespace wiHelper
string GetFileNameFromPath(const string& fullPath)
{
if (fullPath.empty())
{
return fullPath;
}
string ret, empty;
SplitPath(fullPath, empty, ret);
return ret;
@@ -179,6 +184,11 @@ namespace wiHelper
string GetDirectoryFromPath(const string& fullPath)
{
if (fullPath.empty())
{
return fullPath;
}
string ret, empty;
SplitPath(fullPath, ret, empty);
return ret;
+4 -9
View File
@@ -1521,7 +1521,7 @@ void Material::Serialize(wiArchive& archive)
archive >> parallaxOcclusionMapping;
}
string texturesDir = "textures/";
string texturesDir = archive.GetSourceDirectory() + "textures/";
if (!refMapName.empty())
{
refMapName = texturesDir + refMapName;
@@ -2510,11 +2510,6 @@ void Model::CleanUp()
}
void Model::LoadFromDisk(const string& dir, const string& name, const string& identifier)
{
if (!dir.empty())
{
wiHelper::SetWorkingDirectory(wiHelper::GetOriginalWorkingDirectory() + dir);
}
wiArchive archive(name + ".wimf", true);
if (archive.IsOpen())
{
@@ -3828,7 +3823,7 @@ void Decal::Serialize(wiArchive& archive)
archive >> life;
archive >> fadeStart;
string texturesDir = "textures/";
string texturesDir = archive.GetSourceDirectory() + "textures/";
if (!texName.empty())
{
texName = texturesDir + texName;
@@ -4177,7 +4172,7 @@ void Light::Serialize(wiArchive& archive)
{
archive >> rim;
Texture2D* tex;
rim = "rims/" + rim;
rim = archive.GetSourceDirectory() + "rims/" + rim;
if (!rim.empty() && (tex = (Texture2D*)wiResourceManager::GetGlobal()->add(rim)) != nullptr) {
lensFlareRimTextures.push_back(tex);
lensFlareNames.push_back(rim);
@@ -4199,4 +4194,4 @@ void Light::Serialize(wiArchive& archive)
}
}
}
#pragma endregion
#pragma endregion
+1 -1
View File
@@ -7,7 +7,7 @@ namespace wiVersion
// minor features, major bug fixes
const int minor = 8;
// minor bug fixes, alterations, refactors
const int revision = 41;
const int revision = 42;
long GetVersion()