Alright, I’ve looked into the catacurse.cpp fixes a bit more, in particular the reimplementation of getch() and moving InvalidateRect from that function into the DrawWindow function.
First off, I noticed that you’re redrawing the entire window every time you repaint even a small part of the window. That probably explains some of the flickering you saw when you first made that change. To fix that, you should probably use the second arg to InvalidateRect (lpRect, defines the dirty area), rather than leaving it null. See the MSDN documentation. You may also want to move that InvalidateRect call into the for loop, so that you can target only the areas that have actually changed.
After making those modifications to your version of DrawWindow and getch, I was able to get a Windows user on IRC to test it for me. He was using MSVC, and having it make optimized builds. He reported that in the vanilla build, stuff worked just fine. In the modified build, everything was about the same, except that hit animations wouldn’t complete (it would show the red box, as normal, and then fail to reset to the normal screen state). However, pressing a button apparently fixed it.
That suggests to me that having getch redraw the window may actually be intended behavior, because it works just fine on the Linux version. After all, ncurses is a lot better tested and more robust than catacurses, and afaik catacurses is a Windows emulation of ncurses, so I tend to consider ncurses to be correct in cases where they differ. And… yeah, a documentation page for the ncurses getch implementation indicates that wrefresh is called if necessary. So, refreshing the window in getch() is actually intended behavior, and your catacurses implementation is out of compliance with ncurses :-/.
The changes you made to window refreshes and such are, as I’ve said, demonstrably broken under Linux (possibly due to the non-compliant catacurses emulation of ncurses?), so can’t be merged in as-is. At a minimum, they’d require editing to get back to correct behavior under Linux. I get the feeling that they’ll also be time-consuming to isolate, since the relevant code is strewn all over the place, as you correctly pointed out.
Which, if I’m not mistaken, leaves the missile silo fix, the enhancements that you’ve just mentioned, and assorted miscellanea. The missile silo fix has been submitted to Github, although I don’t know what the status of that is. The enhancements need to contend with other things on peoples’ to-do lists. I’d like to remind people that the Github issue tracker is the first thing that devs tend to go for, followed by the subforums for bug reports and suggestions. So, if there’s something that somebody really wants to see in mainline, it might be a good idea to post something in one of those three places.
So… yeah. Interesting ideas, and some drawing changes that make the game work better on Windows and worse on Linux. Unless someone volunteers to merge in the vanilla-appropriate stuff from this mod, though, the best way to get the good parts into mainline DDA would be to bring it up on the suggestions/bug reports subforums, or the Github issue tracker.