Changeset - r22030:7f11b6623c7e
[Not reviewed]
master
0 3 0
frosch - 9 years ago 2015-03-15 12:19:58
frosch@openttd.org
(svn r27187) -Fix: Code style.
3 files changed with 8 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/ai/ai_gui.cpp
Show inline comments
 
@@ -967,13 +967,13 @@ static bool SetScriptButtonColour(NWidge
 
 * Window with everything an AI prints via ScriptLog.
 
 */
 
struct AIDebugWindow : public Window {
 
	static const int top_offset;    ///< Offset of the text at the top of the WID_AID_LOG_PANEL.
 
	static const int bottom_offset; ///< Offset of the text at the bottom of the WID_AID_LOG_PANEL.
 

	
 
	static const unsigned int MAX_BREAK_STR_STRING_LENGTH = 256; ///< Maximum length of the break string.
 
	static const uint MAX_BREAK_STR_STRING_LENGTH = 256;   ///< Maximum length of the break string.
 

	
 
	static CompanyID ai_debug_company;                     ///< The AI that is (was last) being debugged.
 
	int redraw_timer;                                      ///< Timer for redrawing the window, otherwise it'll happen every tick.
 
	int last_vscroll_pos;                                  ///< Last position of the scrolling.
 
	bool autoscroll;                                       ///< Whether automatically scrolling should be enabled or not.
 
	bool show_break_box;                                   ///< Whether the break/debug box is visible.
src/fontcache.cpp
Show inline comments
 
@@ -533,14 +533,14 @@ const Sprite *FreeTypeFontCache::GetGlyp
 
	FT_Render_Glyph(this->face->glyph, aa ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO);
 

	
 
	/* Despite requesting a normal glyph, FreeType may have returned a bitmap */
 
	aa = (slot->bitmap.pixel_mode == FT_PIXEL_MODE_GRAY);
 

	
 
	/* Add 1 pixel for the shadow on the medium font. Our sprite must be at least 1x1 pixel */
 
	unsigned int width  = max(1U, (unsigned int)slot->bitmap.width + (this->fs == FS_NORMAL));
 
	unsigned int height = max(1U, (unsigned int)slot->bitmap.rows  + (this->fs == FS_NORMAL));
 
	uint width  = max(1U, (uint)slot->bitmap.width + (this->fs == FS_NORMAL));
 
	uint height = max(1U, (uint)slot->bitmap.rows  + (this->fs == FS_NORMAL));
 

	
 
	/* Limit glyph size to prevent overflows later on. */
 
	if (width > 256 || height > 256) usererror("Font glyph is too large");
 

	
 
	/* FreeType has rendered the glyph, now we allocate a sprite and copy the image into it */
 
	SpriteLoader::Sprite sprite;
 
@@ -550,24 +550,24 @@ const Sprite *FreeTypeFontCache::GetGlyp
 
	sprite.height = height;
 
	sprite.x_offs = slot->bitmap_left;
 
	sprite.y_offs = this->ascender - slot->bitmap_top;
 

	
 
	/* Draw shadow for medium size */
 
	if (this->fs == FS_NORMAL && !aa) {
 
		for (unsigned int y = 0; y < (unsigned int)slot->bitmap.rows; y++) {
 
			for (unsigned int x = 0; x < (unsigned int)slot->bitmap.width; x++) {
 
		for (uint y = 0; y < (uint)slot->bitmap.rows; y++) {
 
			for (uint x = 0; x < (uint)slot->bitmap.width; x++) {
 
				if (aa ? (slot->bitmap.buffer[x + y * slot->bitmap.pitch] > 0) : HasBit(slot->bitmap.buffer[(x / 8) + y * slot->bitmap.pitch], 7 - (x % 8))) {
 
					sprite.data[1 + x + (1 + y) * sprite.width].m = SHADOW_COLOUR;
 
					sprite.data[1 + x + (1 + y) * sprite.width].a = aa ? slot->bitmap.buffer[x + y * slot->bitmap.pitch] : 0xFF;
 
				}
 
			}
 
		}
 
	}
 

	
 
	for (unsigned int y = 0; y < (unsigned int)slot->bitmap.rows; y++) {
 
		for (unsigned int x = 0; x < (unsigned int)slot->bitmap.width; x++) {
 
	for (uint y = 0; y < (uint)slot->bitmap.rows; y++) {
 
		for (uint x = 0; x < (uint)slot->bitmap.width; x++) {
 
			if (aa ? (slot->bitmap.buffer[x + y * slot->bitmap.pitch] > 0) : HasBit(slot->bitmap.buffer[(x / 8) + y * slot->bitmap.pitch], 7 - (x % 8))) {
 
				sprite.data[x + y * sprite.width].m = FACE_COLOUR;
 
				sprite.data[x + y * sprite.width].a = aa ? slot->bitmap.buffer[x + y * slot->bitmap.pitch] : 0xFF;
 
			}
 
		}
 
	}
src/townname.cpp
Show inline comments
 
@@ -632,13 +632,13 @@ static char *MakeCzechTownName(char *buf
 
		/* That was easy! */
 
		dynamic_subst = false;
 
		gender = _name_czech_subst_full[stem].gender;
 
		choose = _name_czech_subst_full[stem].choose;
 
		allow = _name_czech_subst_full[stem].allow;
 
	} else {
 
		unsigned int map[lengthof(_name_czech_subst_ending)];
 
		uint map[lengthof(_name_czech_subst_ending)];
 
		int ending_start = -1, ending_stop = -1;
 

	
 
		/* Load the substantive */
 
		dynamic_subst = true;
 
		stem -= lengthof(_name_czech_subst_full);
 
		stem %= lengthof(_name_czech_subst_stem);
0 comments (0 inline, 0 general)