(svn r11174) -Codechange: add possibility to show the bounding boxes of sprites using CTRL-B so one can get a better understanding of the used bounding boxes to fix the glitches that still exist. Patch by frosch.

Note that this is not completely glitch free, bounding boxes sometimes aren't removed properly. This is due to the fact that the bounding boxes sometimes are larger than the sprite, which causes a smaller part than the bounding box to be redrawn. This is NOT a bug, but a known implementation limit as we do not want to slow down normal games so the debug graphics are always 100% correct.
This commit is contained in:
rubidium
2007-09-26 19:27:29 +00:00
parent 127c7c9b0f
commit 8564e12554
5 changed files with 101 additions and 13 deletions

View File

@@ -59,6 +59,8 @@ static int _scengen_town_size = 1; // depress medium-sized towns per default
extern void GenerateIndustries();
extern bool GenerateTowns();
bool _draw_bounding_boxes = false;
void CcGiveMoney(bool success, TileIndex tile, uint32 p1, uint32 p2)
{
@@ -2208,6 +2210,13 @@ static void MainWindowWndProc(Window *w, WindowEvent *e)
break;
}
if (e->we.keypress.keycode == ('B' | WKC_CTRL)) {
e->we.keypress.cont = false;
_draw_bounding_boxes = !_draw_bounding_boxes;
MarkWholeScreenDirty();
break;
}
if (_game_mode == GM_MENU) break;
switch (e->we.keypress.keycode) {