Commit bffa0b19 authored by hybrid's avatar hybrid

Fix addHLShaderMaterialFromFiles to properly reset the file when being used...

Fix addHLShaderMaterialFromFiles to properly reset the file when being used twice, found by Kriolyth. Fixed affinityMask type, found by Kosuha.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1305 dfc29bdd-3216-0410-991c-e03cc46cb475
parent e480b85d
...@@ -1644,6 +1644,9 @@ s32 CNullDriver::addHighLevelShaderMaterialFromFiles( ...@@ -1644,6 +1644,9 @@ s32 CNullDriver::addHighLevelShaderMaterialFromFiles(
const long size = pixelShaderProgram->getSize(); const long size = pixelShaderProgram->getSize();
if (size) if (size)
{ {
// if both handles are the same we must reset the file
if (pixelShaderProgram==vertexShaderProgram)
pixelShaderProgram->seek(0);
ps = new c8[size+1]; ps = new c8[size+1];
pixelShaderProgram->read(ps, size); pixelShaderProgram->read(ps, size);
ps[size] = 0; ps[size] = 0;
......
...@@ -100,7 +100,7 @@ namespace os ...@@ -100,7 +100,7 @@ namespace os
#if !defined(_WIN32_WCE) #if !defined(_WIN32_WCE)
// Avoid potential timing inaccuracies across multiple cores by // Avoid potential timing inaccuracies across multiple cores by
// temporarily setting the affinity of this process to one core. // temporarily setting the affinity of this process to one core.
DWORD affinityMask; DWORD_PTR affinityMask;
if(MultiCore) if(MultiCore)
affinityMask = SetThreadAffinityMask(GetCurrentThread(), 1); affinityMask = SetThreadAffinityMask(GetCurrentThread(), 1);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment