Horde3D
http://horde3d.org/forums/

[solved] A slight mistake in LightNode::parsingFunc
http://horde3d.org/forums/viewtopic.php?f=3&t=306
Page 1 of 1

Author:  Bylkki [ 24.04.2008, 21:29 ]
Post subject:  [solved] A slight mistake in LightNode::parsingFunc

If a scene file contains lights, their color attributes won't be loaded.

In egLight.cpp LightNode::parsingFunc:
Code:
itr = attribs.find( "col_r" );
if( itr != attribs.end() ) lightTpl->col_R = (float)atof( itr->second.c_str() );
itr = attribs.find( "col_r" );
if( itr != attribs.end() ) lightTpl->col_G = (float)atof( itr->second.c_str() );
itr = attribs.find( "col_r" );
if( itr != attribs.end() ) lightTpl->col_B = (float)atof( itr->second.c_str() );

Should be:
Code:
itr = attribs.find( "col_R" );
if( itr != attribs.end() ) lightTpl->col_R = (float)atof( itr->second.c_str() );
itr = attribs.find( "col_G" );
if( itr != attribs.end() ) lightTpl->col_G = (float)atof( itr->second.c_str() );
itr = attribs.find( "col_B" );
if( itr != attribs.end() ) lightTpl->col_B = (float)atof( itr->second.c_str() );

Author:  AcidFaucet [ 25.04.2008, 01:29 ]
Post subject:  Re: A slight mistake in LightNode::parsingFunc

Nice find, that could of been an annoyance.

Author:  Volker [ 25.04.2008, 06:11 ]
Post subject:  Re: A slight mistake in LightNode::parsingFunc

Thanks for pointing this out,... I fixed it in the trunk version

Author:  DDd [ 25.04.2008, 07:49 ]
Post subject:  Re: A slight mistake in LightNode::parsingFunc

Hum strange... i used colored lights inside the editor with no problems at all :?

Author:  Bylkki [ 25.04.2008, 08:02 ]
Post subject:  Re: A slight mistake in LightNode::parsingFunc

DDd wrote:
Hum strange... i used colored lights inside the editor with no problems at all :?


That's exactly how I found the bug.
I created a scene in the editor with colored light and when I loaded the scene in my application, the light became white. :)

Author:  Volker [ 25.04.2008, 08:50 ]
Post subject:  Re: A slight mistake in LightNode::parsingFunc

The editor parses the nodes itself that's why you didn't noticed the bug in the editor

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/