diff options
author | yexo <yexo@openttd.org> | 2010-07-04 12:49:51 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-07-04 12:49:51 +0000 |
commit | 902cefaa417e8d9135ce30c4075e81d4c485139a (patch) | |
tree | 9c4120dfd0e50e746720969e23e0b2a5d34cdb7f /src | |
parent | 17ef1a2336b09eb9b727d4ef601e653038fde568 (diff) | |
download | openttd-902cefaa417e8d9135ce30c4075e81d4c485139a.tar.xz |
(svn r20077) -Codechange: remove the space between "open" and "ttd" in the title screen
Diffstat (limited to 'src')
-rw-r--r-- | src/main_gui.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 80ea150f8..09ef1b275 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -245,16 +245,19 @@ struct MainWindow : Window { this->DrawWidgets(); if (_game_mode == GM_MENU) { - int off_x = this->width / 2; + static const SpriteID title_sprites[] = {SPR_OTTD_O, SPR_OTTD_P, SPR_OTTD_E, SPR_OTTD_N, SPR_OTTD_T, SPR_OTTD_T, SPR_OTTD_D}; + static const uint LETTER_SPACING = 10; + uint name_width = (lengthof(title_sprites) - 1) * LETTER_SPACING; - DrawSprite(SPR_OTTD_O, PAL_NONE, off_x - 120, 50); - DrawSprite(SPR_OTTD_P, PAL_NONE, off_x - 86, 50); - DrawSprite(SPR_OTTD_E, PAL_NONE, off_x - 53, 50); - DrawSprite(SPR_OTTD_N, PAL_NONE, off_x - 22, 50); + for (uint i = 0; i < lengthof(title_sprites); i++) { + name_width += GetSpriteSize(title_sprites[i]).width; + } + int off_x = (this->width - name_width) / 2; - DrawSprite(SPR_OTTD_T, PAL_NONE, off_x + 34, 50); - DrawSprite(SPR_OTTD_T, PAL_NONE, off_x + 65, 50); - DrawSprite(SPR_OTTD_D, PAL_NONE, off_x + 96, 50); + for (uint i = 0; i < lengthof(title_sprites); i++) { + DrawSprite(title_sprites[i], PAL_NONE, off_x, 50); + off_x += GetSpriteSize(title_sprites[i]).width + LETTER_SPACING; + } } } |