Windows fixes

This commit is contained in:
Jack Andersen 2016-04-02 17:31:50 -10:00
parent 500589dbd3
commit 8534af8b4d
5 changed files with 22 additions and 16 deletions

View File

@ -47,7 +47,7 @@ extern "C" size_t HECL_BLENDERSHELL_SZ;
extern "C" uint8_t HECL_ADDON[];
extern "C" size_t HECL_ADDON_SZ;
extern "C" uint8_t HECL_STARTUP[];
extern "C" size_t HECL_STARTUP_SZ;
@ -59,7 +59,7 @@ static void InstallBlendershell(const SystemChar* path)
fwrite(HECL_BLENDERSHELL, 1, HECL_BLENDERSHELL_SZ, fp);
fclose(fp);
}
static void InstallAddon(const SystemChar* path)
{
FILE* fp = hecl::Fopen(path, _S("wb"));
@ -77,7 +77,7 @@ static void InstallStartup(const char* path)
fwrite(HECL_STARTUP, 1, HECL_STARTUP_SZ, fp);
fclose(fp);
}
size_t BlenderConnection::_readLine(char* buf, size_t bufSz)
{
size_t readBytes = 0;
@ -168,7 +168,7 @@ void BlenderConnection::_closePipe()
BlenderConnection::BlenderConnection(int verbosityLevel)
{
BlenderLog.report(logvisor::Info, "Establishing BlenderConnection...");
/* Put hecl_blendershell.py in temp dir */
#ifdef _WIN32
wchar_t* TMPDIR = _wgetenv(L"TEMP");
@ -188,7 +188,7 @@ BlenderConnection::BlenderConnection(int verbosityLevel)
hecl::SystemString blenderAddonPath(TMPDIR);
blenderAddonPath += _S("/hecl_blenderaddon.zip");
InstallAddon(blenderAddonPath.c_str());
m_startupBlend += "/hecl_startup.blend";
InstallStartup(m_startupBlend.c_str());
@ -239,7 +239,9 @@ BlenderConnection::BlenderConnection(int verbosityLevel)
if (verbosityLevel == 0)
{
SECURITY_ATTRIBUTES sattrs = {sizeof(SECURITY_ATTRIBUTES), NULL, TRUE};
nulHandle = CreateFileW(L"nul", GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, &sattrs, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
nulHandle = CreateFileW(L"nul", GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
&sattrs, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
sinfo.hStdInput = nulHandle;
sinfo.hStdError = nulHandle;
sinfo.hStdOutput = nulHandle;
sinfo.dwFlags = STARTF_USESTDHANDLES;

2
hecl/extern/boo vendored

@ -1 +1 @@
Subproject commit 165b40448fa651ab56891ec7f4e3f149f8db7ecf
Subproject commit 01649d42f68c09f377741113ccd139116cb243e8

View File

@ -701,12 +701,16 @@ public:
{
if (absPath.size() > m_projRoot.size())
{
if (!absPath.compare(0, m_projRoot.size(), m_projRoot))
SystemString absPathForward(absPath);
for (SystemChar& ch : absPathForward)
if (ch == _S('\\'))
ch = _S('/');
if (!absPathForward.compare(0, m_projRoot.size(), m_projRoot))
{
auto beginIt = absPath.cbegin() + m_projRoot.size();
while (*beginIt == _S('/') || *beginIt == _S('\\'))
auto beginIt = absPathForward.cbegin() + m_projRoot.size();
while (*beginIt == _S('/'))
++beginIt;
return SystemString(beginIt, absPath.cend());
return SystemString(beginIt, absPathForward.cend());
}
}
LogModule.report(logvisor::Fatal, "unable to resolve '%s' as project relative '%s'",

View File

@ -111,8 +111,8 @@ std::string HLSL::makeVert(unsigned col, unsigned uv, unsigned w,
if (s)
{
/* skinned */
retval += " vec4 posAccum = float4(0.0,0.0,0.0,0.0);\n"
" vec4 normAccum = float4(0.0,0.0,0.0,0.0);\n";
retval += " float4 posAccum = float4(0.0,0.0,0.0,0.0);\n"
" float4 normAccum = float4(0.0,0.0,0.0,0.0);\n";
for (size_t i=0 ; i<s ; ++i)
retval += hecl::Format(" posAccum += mul(mv[%" PRISize "], float4(v.posIn, 1.0)) * v.weightIn[%" PRISize "][%" PRISize "];\n"
" normAccum += mul(mvInv[%" PRISize "], float4(v.normIn, 1.0)) * v.weightIn[%" PRISize "][%" PRISize "];\n",
@ -169,7 +169,7 @@ std::string HLSL::makeFrag(const ShaderFunction& lighting) const
if (lighting.m_entry)
retval += hecl::Format(" float4 lighting = %s();\n", lighting.m_entry);
else
retval += " float4 lighting = vec4(1.0,1.0,1.0,1.0);\n";
retval += " float4 lighting = float4(1.0,1.0,1.0,1.0);\n";
}
unsigned sampIdx = 0;

View File

@ -86,9 +86,9 @@ void ProjectPath::assign(Database::Project& project, const std::string& path)
m_absPath = project.getProjectRootPath().getAbsolutePath() + _S('/') + m_relPath;
SanitizePath(m_relPath);
SanitizePath(m_absPath);
m_hash = Hash(m_relPath);
m_utf8AbsPath = WideToUTF8(m_absPath);
m_utf8RelPath = WideToUTF8(m_relPath);
m_hash = Hash(m_utf8RelPath);
}
#endif
@ -118,9 +118,9 @@ void ProjectPath::assign(const ProjectPath& parentPath, const std::string& path)
m_absPath = m_proj->getProjectRootPath().getAbsolutePath() + _S('/') + m_relPath;
SanitizePath(m_relPath);
SanitizePath(m_absPath);
m_hash = Hash(m_relPath);
m_utf8AbsPath = WideToUTF8(m_absPath);
m_utf8RelPath = WideToUTF8(m_relPath);
m_hash = Hash(m_utf8RelPath);
}
#endif