HomeWildfire Games

Allow random map scripts to load heightmap image files, fixes #5018.
AuditedrP21113

Description

Allow random map scripts to load heightmap image files, fixes #5018.

Move the atlas heightmap import code to MapIO.cpp and reuse it.
Implements what rP18523 and rP20525 wanted to be.

Event Timeline

Silier raised a concern with this commit.Apr 3 2019, 8:53 PM
Silier added a subscriber: Silier.
Silier added inline comments.
/ps/trunk/source/graphics/MapIO.cpp
68

@elexis the upper or lower line should be removed ?
value is reassigned without usage of previous value

This commit now has outstanding concerns.Apr 3 2019, 8:53 PM
elexis added inline comments.Apr 3 2019, 11:01 PM
/ps/trunk/source/graphics/MapIO.cpp
68

Did I leave a line of debug code in there? only picking the red channel instead of max(r,g,b)
The two lines incidentally give the same value since vanilla maps are shades of gray IIRC.
So looks like L68 should be deleted. Perhaps can inline the remaining line then, static_cast<u16>(...) and \n after ,.
Good catch

elexis requested verification of this commit.Sep 12 2019, 9:30 PM
This commit now requires verification by auditors.Sep 12 2019, 9:30 PM
All concerns with this commit have now been addressed.Sep 12 2019, 9:48 PM
wraitii added inline comments.
/ps/trunk/source/graphics/MapIO.cpp
68

Funnily enough, this 'debug' line made the code not buggy instead of buggy. See D1816 / rP22892 for the bug