Bool is only guaranteed to be one bit long. So passing any of the texture clamping values through that turns them all to 0 or 1 on some platforms. Not what was intended, with CLAMP clamping to border color.
This bug should be fixed by changing the parameter to an u32 from bool, in SMaterial.setFlag and all its wrappers.
setMaterialFlag(ETC_FOO) causes undefined behavior
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: setMaterialFlag(ETC_FOO) causes undefined behavior
The set function should work properly in all cases - as the function always maps false to the "OFF" enum and all other values to one distinct value chosen from all possible values. We should probably add an overloaded function which works for all enum values as expected, though. However, this would break backward compatibility. So we will probably have to invent a new name
Re: setMaterialFlag(ETC_FOO) causes undefined behavior
The ETC texture clamp flags are cast, it's not an ON/OFF case. So if you do setMaterialFlag(ETC_CLAMP_TO_EDGE), it actually gets set to ETC_CLAMP.