IAttributes and UTF8

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
gheft
Posts: 34
Joined: Mon Jul 30, 2007 4:11 am

IAttributes and UTF8

Post by gheft »

Im making a really simple format for Irrlicht with support for skinned meshes and animations and I decided to also have materials and to simply use irrlichts method for reading materials...

SMaterial material;
IAttributes* attributes = FileSystem->createEmptyAttributes(driver);
attributes->read(xml, true, L"material");
Driver->fillMaterialStructureFromAttributes(material, attributes);

so I take part of an example file for irrmesh and make this - test.material

<material>
<enum name="Type" value="solid" />
<color name="Ambient" value="ff000000" />
<color name="Diffuse" value="ff000000" />
<color name="Emissive" value="ff000000" />
<color name="Specular" value="ff000000" />
<float name="Shininess" value="0.750000" />
<float name="Param1" value="1.000000" />
<float name="Param2" value="0.000000" />
<texture name="Texture1" value="" />
<texture name="Texture2" value="" />
<texture name="Texture3" value="" />
<texture name="Texture4" value="" />
<bool name="Wireframe" value="false" />
<bool name="GouraudShading" value="true" />
<bool name="Lighting" value="true" />
<bool name="ZWriteEnable" value="true" />
<int name="ZBuffer" value="1" />
<bool name="BackfaceCulling" value="true" />
<bool name="FogEnable" value="false" />
<bool name="NormalizeNormals" value="true" />
<bool name="BilinearFilter1" value="true" />
<bool name="BilinearFilter2" value="true" />
<bool name="BilinearFilter3" value="true" />
<bool name="BilinearFilter4" value="true" />
<bool name="TrilinearFilter1" value="false" />
<bool name="TrilinearFilter2" value="false" />
<bool name="TrilinearFilter3" value="false" />
<bool name="TrilinearFilter4" value="false" />
<bool name="AnisotropicFilter1" value="false" />
<bool name="AnisotropicFilter2" value="false" />
<bool name="AnisotropicFilter3" value="false" />
<bool name="AnisotropicFilter4" value="false" />
<enum name="TextureWrap1" value="texture_clamp_repeat" />
<enum name="TextureWrap2" value="texture_clamp_repeat" />
<enum name="TextureWrap3" value="texture_clamp_repeat" />
<enum name="TextureWrap4" value="texture_clamp_repeat" />
</material>

but it seems IAttributes->read will not work with IXMLReaderUTF8 because it compares values to widestrings. but the file is utf8 (I think) so using the standard IXMLReader gives me the wrong values?
how can I get the two to work together? can I get IAttributes->read to work with c-strings or do I have to get a utf16 file somehow?

btw my animation and skinning format is 90% done, I will probably make a post in open discussion when its done :wink:
Post Reply