Commit 483c085f authored by hybrid's avatar hybrid

Make float to double conversions for explicit string conversions also explicit...

Make float to double conversions for explicit string conversions also explicit and this better visible. Fixes compilation issues with DMC

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4199 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 4fb661ab
...@@ -168,7 +168,7 @@ public: ...@@ -168,7 +168,7 @@ public:
virtual core::stringw getStringW() virtual core::stringw getStringW()
{ {
return core::stringw(Value); return core::stringw((double)Value);
} }
virtual void setInt(s32 intValue) virtual void setInt(s32 intValue)
...@@ -1734,11 +1734,11 @@ public: ...@@ -1734,11 +1734,11 @@ public:
{ {
if (IsStringW) if (IsStringW)
{ {
ValueW = core::stringw(floatValue); ValueW = core::stringw((double)floatValue);
} }
else else
{ {
Value = core::stringc(floatValue); Value = core::stringc((double)floatValue);
} }
}; };
......
...@@ -770,7 +770,7 @@ bool CB3DMeshFileLoader::readChunkANIM() ...@@ -770,7 +770,7 @@ bool CB3DMeshFileLoader::readChunkANIM()
readFloats(&animFPS, 1); readFloats(&animFPS, 1);
if (animFPS>0.f) if (animFPS>0.f)
AnimatedMesh->setAnimationSpeed(animFPS); AnimatedMesh->setAnimationSpeed(animFPS);
os::Printer::log("FPS", io::path(animFPS), ELL_DEBUG); os::Printer::log("FPS", io::path((double)animFPS), ELL_DEBUG);
#ifdef __BIG_ENDIAN__ #ifdef __BIG_ENDIAN__
animFlags = os::Byteswap::byteswap(animFlags); animFlags = os::Byteswap::byteswap(animFlags);
......
...@@ -290,7 +290,7 @@ namespace ...@@ -290,7 +290,7 @@ namespace
core::stringc t; core::stringc t;
for (u32 i=0; i<16; ++i) for (u32 i=0; i<16; ++i)
{ {
t+=core::stringc(Transformation[i]); t+=core::stringc((double)Transformation[i]);
t+=" "; t+=" ";
} }
#ifdef COLLADA_READER_DEBUG #ifdef COLLADA_READER_DEBUG
......
...@@ -1876,7 +1876,7 @@ void CColladaMeshWriter::writeColorFx(const irr::core::stringw& meshname, const ...@@ -1876,7 +1876,7 @@ void CColladaMeshWriter::writeColorFx(const irr::core::stringw& meshname, const
void CColladaMeshWriter::writeFloatElement(irr::f32 value) void CColladaMeshWriter::writeFloatElement(irr::f32 value)
{ {
Writer->writeElement(L"float", false); Writer->writeElement(L"float", false);
Writer->writeText(core::stringw(value).c_str()); Writer->writeText(core::stringw((double)value).c_str());
Writer->writeClosingTag(L"float"); Writer->writeClosingTag(L"float");
Writer->writeLineBreak(); Writer->writeLineBreak();
} }
...@@ -1890,7 +1890,7 @@ void CColladaMeshWriter::writeRotateElement(const irr::core::vector3df& axis, ir ...@@ -1890,7 +1890,7 @@ void CColladaMeshWriter::writeRotateElement(const irr::core::vector3df& axis, ir
txt += L" "; txt += L" ";
txt += irr::core::stringw(axis.Z); txt += irr::core::stringw(axis.Z);
txt += L" "; txt += L" ";
txt += irr::core::stringw(angle); txt += irr::core::stringw((double)angle);
Writer->writeText(txt.c_str()); Writer->writeText(txt.c_str());
Writer->writeClosingTag(L"rotate"); Writer->writeClosingTag(L"rotate");
Writer->writeLineBreak(); Writer->writeLineBreak();
......
...@@ -176,7 +176,7 @@ IAnimatedMesh* CMY3DMeshFileLoader::createMesh(io::IReadFile* file) ...@@ -176,7 +176,7 @@ IAnimatedMesh* CMY3DMeshFileLoader::createMesh(io::IReadFile* file)
gotLightMap = true; gotLightMap = true;
} }
const core::stringc name = namebuf; const core::stringc name(namebuf);
const s32 pos = name.findLast('.'); const s32 pos = name.findLast('.');
const core::stringc LightingMapStr = "LightingMap"; const core::stringc LightingMapStr = "LightingMap";
const s32 ls = LightingMapStr.size(); const s32 ls = LightingMapStr.size();
......
...@@ -185,7 +185,7 @@ bool COBJMeshWriter::writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 fla ...@@ -185,7 +185,7 @@ bool COBJMeshWriter::writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 fla
file->write(num.c_str(),num.size()); file->write(num.c_str(),num.size());
getColorAsStringLine(mat[i]->EmissiveColor, "Ke", num); getColorAsStringLine(mat[i]->EmissiveColor, "Ke", num);
file->write(num.c_str(),num.size()); file->write(num.c_str(),num.size());
num = core::stringc(mat[i]->Shininess/0.128f); num = core::stringc((double)(mat[i]->Shininess/0.128f));
file->write("Ns ", 3); file->write("Ns ", 3);
file->write(num.c_str(),num.size()); file->write(num.c_str(),num.size());
file->write("\n", 1); file->write("\n", 1);
...@@ -227,11 +227,11 @@ void COBJMeshWriter::getColorAsStringLine(const video::SColor& color, const c8* ...@@ -227,11 +227,11 @@ void COBJMeshWriter::getColorAsStringLine(const video::SColor& color, const c8*
{ {
s = prefix; s = prefix;
s += " "; s += " ";
s += core::stringc(color.getRed()/255.f); s += core::stringc((double)(color.getRed()/255.f));
s += " "; s += " ";
s += core::stringc(color.getGreen()/255.f); s += core::stringc((double)(color.getGreen()/255.f));
s += " "; s += " ";
s += core::stringc(color.getBlue()/255.f); s += core::stringc((double)(color.getBlue()/255.f));
s += "\n"; s += "\n";
} }
......
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