clear_map() call draw_map() after #488

Merged
NQNStudios merged 1 commits from fix-map-refresh into master 2024-11-23 19:12:04 +00:00
NQNStudios commented 2024-11-21 22:32:39 +00:00 (Migrated from github.com)

I was looking to fix #487 and #428. While I was doing that, I looked through the call sites of clear_map() and found that nearly every call was used in a context where we wanted to redraw the map, not clear it. We only really want the "clear" behavior of clear_map() once, when the texture is initialized pure white and we want it black instead.

It turns out that modifying clear_map() so it calls `draw_map(true) fixes #487, and fixes #428 in one fell swoop. For whatever reason, clear_map() seems to be a misnomer.

I think draw_map() short-circuits safely if nothing can be drawn (i.e. the initialization "fill the new texture with black" case), and if that's correct, this is a simple fix.

I have a hunch that #267 was a manifestation of this bug too--because I've never reproduced the minimap data actually being wiped, but I can reproduce loading a file while the map is already open, and having the minimap wiped black in the new game until you move once.

I was looking to fix #487 and #428. While I was doing that, I looked through the call sites of `clear_map()` and found that nearly every call was used in a context where we wanted to *redraw* the map, not clear it. We only really want the "clear" behavior of clear_map() once, when the texture is initialized pure white and we want it black instead. It turns out that modifying `clear_map()` so it calls `draw_map(true) fixes #487, and fixes #428 in one fell swoop. For whatever reason, clear_map() seems to be a misnomer. I think draw_map() short-circuits safely if nothing can be drawn (i.e. the initialization "fill the new texture with black" case), and if that's correct, this is a simple fix. I have a hunch that #267 was a manifestation of this bug too--because I've never reproduced the minimap data actually being wiped, but I *can* reproduce loading a file while the map is already open, and having the minimap wiped black in the new game until you move once.
Sign in to join this conversation.
No description provided.