Not logged inOpenClonk Forum
Up Topic General / Help and Questions / Mape and GetPixel() and texture colors
- - By Pyrit Date 2015-08-16 14:37
I'm making a map where I use GetPixel() to check wich material I have at this position, but Mape seems to return false color indexes when you use the function.
I have a TEXMAP.txt loaded, where water has the index 25. However in Mape water has the index 17. That's a problem, because I constantly have to switch between 17 and 25 when I'm done with Mape and want to test it in the engine.

I don't know why Mape uses other indexes as the engine. 17 is not even defined in the TEXMAP. :o
Attachment: TEXMAP.TXT (485B)
Parent - By Zapper [de] Date 2015-08-16 14:38
Maybe Sven broke mape with this commit?
Parent - - By Sven2 [us] Date 2015-08-16 15:19
Does Mape even load a TexMap? I would think it just generated TexMap entries on the fly.
Parent - By Pyrit Date 2015-08-16 15:25
I don't know, but when you double click and load a different Material.ocg with a different TEXMAP, the indixes change, too.
Parent - By Clonk-Karl Date 2015-08-18 02:30
It uses C4TextureMap::LoadMap, so yes, it should properly load the texmap...
Reply
Parent - - By Clonk-Karl Date 2015-08-18 02:42 Edited 2015-08-18 02:52
Looks like a bug in mape.

What happens is that mape first loads the TexMap.txt, however adding all the texmap entries internally fails, because the materials and textures are not yet loaded. However, mape must first load the TexMap to see if OverloadMaterials or OverloadTextures are present in it, to know what materials/textures to actually load. Probably a second pass going over TexMap.txt after materials and textures are loaded would fix the issue.

Edit: Should be fixed in master.
Reply
Parent - By Pyrit Date 2015-08-18 18:47
Lightning-fast, you are great! :)
Up Topic General / Help and Questions / Mape and GetPixel() and texture colors

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill