COBJMeshFileLoader using a bit more exact color conversion for 0-1 to 0-255 range

Same now as SColorf::toSColor


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6214 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2021-05-07 12:41:57 +00:00
parent e611f2c571
commit 9147d4ade8
2 changed files with 4 additions and 3 deletions

@ -1,5 +1,6 @@
-------------------------- --------------------------
Changes in 1.9 (not yet released) Changes in 1.9 (not yet released)
- COBJMeshFileLoader using a bit more exact color conversion for 0-1 to 0-255 range (same now as SColorf::toSColor uses).
- Speedup for COBJMeshWriter - Speedup for COBJMeshWriter
- Add blinkMode parameter to IGUIEnvironment::addModalScreen, so blinking can be suppressed - Add blinkMode parameter to IGUIEnvironment::addModalScreen, so blinking can be suppressed
- Speedup: Avoid string copy in CXMLReaderImpl::getAttributeByName - Speedup: Avoid string copy in CXMLReaderImpl::getAttributeByName

@ -711,11 +711,11 @@ const c8* COBJMeshFileLoader::readColor(const c8* bufPtr, video::SColor& color,
c8 colStr[COLOR_BUFFER_LENGTH]; c8 colStr[COLOR_BUFFER_LENGTH];
bufPtr = goAndCopyNextWord(colStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd); bufPtr = goAndCopyNextWord(colStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd);
color.setRed((s32)(core::fast_atof(colStr) * 255.0f)); color.setRed((u32)core::round32(core::fast_atof(colStr)*255.f));
bufPtr = goAndCopyNextWord(colStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd); bufPtr = goAndCopyNextWord(colStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd);
color.setGreen((s32)(core::fast_atof(colStr) * 255.0f)); color.setGreen((u32)core::round32(core::fast_atof(colStr)*255.f));
bufPtr = goAndCopyNextWord(colStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd); bufPtr = goAndCopyNextWord(colStr, bufPtr, COLOR_BUFFER_LENGTH, bufEnd);
color.setBlue((s32)(core::fast_atof(colStr) * 255.0f)); color.setBlue((u32)core::round32(core::fast_atof(colStr)*255.f));
return bufPtr; return bufPtr;
} }