Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move font constants to their own compilation unit
avoids including SDL_TTF unnecessarily
- Loading branch information
Showing
29 changed files
with
119 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
Copyright (C) 2008 - 2016 by Mark de Wever <koraq@xs4all.nl> | ||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/ | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY. | ||
See the COPYING file for more details. | ||
*/ | ||
|
||
#include "constants.hpp" | ||
|
||
#include "sdl/utils.hpp" | ||
|
||
#include <SDL.h> | ||
|
||
namespace font { | ||
|
||
const SDL_Color NORMAL_COLOR = {0xDD,0xDD,0xDD,0}, | ||
GRAY_COLOR = {0x77,0x77,0x77,0}, | ||
LOBBY_COLOR = {0xBB,0xBB,0xBB,0}, | ||
GOOD_COLOR = {0x00,0xFF,0x00,0}, | ||
BAD_COLOR = {0xFF,0x00,0x00,0}, | ||
BLACK_COLOR = {0x00,0x00,0x00,0}, | ||
YELLOW_COLOR = {0xFF,0xFF,0x00,0}, | ||
BUTTON_COLOR = {0xBC,0xB0,0x88,0}, | ||
PETRIFIED_COLOR = {0xA0,0xA0,0xA0,0}, | ||
TITLE_COLOR = {0xBC,0xB0,0x88,0}, | ||
LABEL_COLOR = {0x6B,0x8C,0xFF,0}, | ||
BIGMAP_COLOR = {0xFF,0xFF,0xFF,0}; | ||
const SDL_Color DISABLED_COLOR = inverse(PETRIFIED_COLOR); | ||
|
||
} // end namespace font |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
Copyright (C) 2008 - 2016 by Mark de Wever <koraq@xs4all.nl> | ||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/ | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY. | ||
See the COPYING file for more details. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <SDL.h> | ||
|
||
namespace font { | ||
|
||
//various standard colors | ||
extern const SDL_Color NORMAL_COLOR, GRAY_COLOR, LOBBY_COLOR, GOOD_COLOR, BAD_COLOR, | ||
BLACK_COLOR, YELLOW_COLOR, BUTTON_COLOR, BIGMAP_COLOR, | ||
PETRIFIED_COLOR, TITLE_COLOR, DISABLED_COLOR, LABEL_COLOR; | ||
|
||
// font sizes, to be made theme parameters | ||
constexpr int SIZE_NORMAL = 14; | ||
// automatic computation of other font sizes, to be made a default for theme-provided values | ||
constexpr int | ||
SIZE_TINY = 10 * SIZE_NORMAL / 14, | ||
SIZE_SMALL = 12 * SIZE_NORMAL / 14, | ||
|
||
SIZE_15 = 15 * SIZE_NORMAL / 14, | ||
SIZE_PLUS = 16 * SIZE_NORMAL / 14, | ||
SIZE_LARGE = 18 * SIZE_NORMAL / 14, | ||
SIZE_TITLE = 20 * SIZE_NORMAL / 14, | ||
SIZE_XLARGE = 24 * SIZE_NORMAL / 14 | ||
; | ||
// For arbitrary scaling: | ||
// (Not used in defining the SIZE_* consts because of spurious compiler warnings.) | ||
constexpr inline int relative_size(int size) | ||
{ | ||
return (SIZE_NORMAL * size / 14); | ||
} | ||
|
||
// GUI1 built-in maximum | ||
constexpr size_t max_text_line_width = 4096; | ||
|
||
} // end namespace font |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.