jonls/freeserf — pull request #9 by jonls (2012-11-12 02:32:12+00:00)
Title: Add GUI object hierarchy.

These changes add a lot of structure to the code, separating gui code from core game logic (but there's still some work to do). To me this is a good foundation to move on from, because it add a lot of flexibility to the gui system, while resolving quite a bit of the spagheti code that was before. It is quite a big change, so a few bugs may have crept in. Regarding performance: I have not worked specifically on optimizing anything, but to me this feels a little faster, maybe it's just that more blits are done.

Changes:
Port viewport to gui object.
Port popup box to gui object.
Port control panel bar to gui object system.
Move input handling related to the viewport to viewport.c, and all related functions.
Move input handling related to popup box to popup.c, and related functions.
Move input handling related to panel to panel.c, and related functions.
Add top level gui interface.
sdl-video.c: All x,y coords are relative to destinaton frame clip. This makes more sense intuitively in a hierarchial drawing model.