There seems to be no end to refactoring, but every step now makes something easier later. Also, it's made some things easier now, and I've been up to a few new things today. Rooms now have basic random monster and loot tables, and support is in for different room shapes:
The new ones are just made out of two overlapping rectangles. I need to fix up the door attachments a bit so they don't do the diagonal thing you see here.
Had to update the display code for these new rooms, since it's no longer possible to just draw a rectangle. Did a bit of research, skimmed the marching squares article on Wikipedia, and got to work. To my great pleasure, it worked perfectly the first time. Nice when that happens. This algorithm should work fine for other room shapes I want to do later; I'll have to adapt it, though, for rooms with "holes" in them.
Up next, implementing a couple more layout types to get a bit of variety and further explore what works (and looks, and plays) best with the engine's current capabilities. Then I think I'll get the AI working again (it's been broken since I converted the level indexing from unsigned to signed, quite a while ago).