A patch that temporarily removed solid masks when using
I hereby license the file 0001-Fix-double-MatCount-update-when-usi.patch under the CC-BY license
ClearFreeRect
accidentally removed the pixels twice from the MatCount
array.I hereby license the file 0001-Fix-double-MatCount-update-when-usi.patch under the CC-BY license
Attachment: 0001-Fix-double-MatCount-update-when-usi.patch (3k)
I'd like to test the patch but it's the first time I'm hearing about this problem.
Is there a good test case, way to reproduce it, or at least a related bug tracker entry?
(Looking at the patch with my naive eyes makes it seem like the pixels are not removed from the
Is there a good test case, way to reproduce it, or at least a related bug tracker entry?
(Looking at the patch with my naive eyes makes it seem like the pixels are not removed from the
MatCount
at all now, but it's hard to tell if you can't see it moving.)
- Start Gold Rush
- Run
- The output is a positive, non-zero integer
- Run
- Run
- The expected output is 0, but the actual output is the same as the output of the first call but with a negative sign
The commit that introduced the bug is https://github.com/openclonk/openclonk/commit/e8a90e7d23735eb7ac09ddd8c466ac987cb1fba6
- Run
/script GetMaterialCount(Material("Gold"))
- The output is a positive, non-zero integer
- Run
/script ClearFreeRect(0, 0, LandscapeWidth(), LandscapeHeight())
- Run
/script GetMaterialCount(Material("Gold"))
- The expected output is 0, but the actual output is the same as the output of the first call but with a negative sign
The commit that introduced the bug is https://github.com/openclonk/openclonk/commit/e8a90e7d23735eb7ac09ddd8c466ac987cb1fba6
ClearFreeRect
calls _SetPix2
(ClearFreeRect -> ClearPix -> SetPix2 -> _SetPix2
) and _SetPix2
updates MatCount
. PrepareChange
/FinishChange
then update MatCount
again by calling UpdateMatCnt()
, which results in the pixels being removed from MatCount
twice.
I should probably test this a bit more thoroughly, but oh well.
https://github.com/openclonk/openclonk/commit/804bbf9fdbe9d0ba92171cb27d4081fb91b9893d
https://github.com/openclonk/openclonk/commit/804bbf9fdbe9d0ba92171cb27d4081fb91b9893d
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill