Minor cleanup
This commit is contained in:
		
							parent
							
								
									c9d5059238
								
							
						
					
					
						commit
						05b32d76ca
					
				
					 3 changed files with 8 additions and 6 deletions
				
			
		| 
						 | 
					@ -943,8 +943,8 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align)
 | 
				
			||||||
	TTF_Font *font = p->font->getSdlFont();
 | 
						TTF_Font *font = p->font->getSdlFont();
 | 
				
			||||||
	const Color &fontColor = p->font->getColor();
 | 
						const Color &fontColor = p->font->getColor();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	SDL_Color c;
 | 
						SDL_Color c = fontColor.toSDLColor();
 | 
				
			||||||
	fontColor.toSDLColor(c);
 | 
						c.a = 255;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	float txtAlpha = fontColor.norm.w;
 | 
						float txtAlpha = fontColor.norm.w;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -146,13 +146,15 @@ void Color::updateExternal()
 | 
				
			||||||
	alpha = norm.w * 255;
 | 
						alpha = norm.w * 255;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Color::toSDLColor(SDL_Color &c) const
 | 
					SDL_Color Color::toSDLColor() const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						SDL_Color c;
 | 
				
			||||||
	c.r = clamp<double>(red, 0, 255);
 | 
						c.r = clamp<double>(red, 0, 255);
 | 
				
			||||||
	c.g = clamp<double>(green, 0, 255);
 | 
						c.g = clamp<double>(green, 0, 255);
 | 
				
			||||||
	c.b = clamp<double>(blue, 0, 255);
 | 
						c.b = clamp<double>(blue, 0, 255);
 | 
				
			||||||
//	c.a = clamp<double>(alpha, 0, 255);
 | 
						c.a = clamp<double>(alpha, 0, 255);
 | 
				
			||||||
	c.a = 255;
 | 
					
 | 
				
			||||||
 | 
						return c;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -79,7 +79,7 @@ struct Color : public Serializable
 | 
				
			||||||
		return (alpha != 0);
 | 
							return (alpha != 0);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	void toSDLColor(SDL_Color &c) const;
 | 
						SDL_Color toSDLColor() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Range (0.0 ~ 255.0) */
 | 
						/* Range (0.0 ~ 255.0) */
 | 
				
			||||||
	double red;
 | 
						double red;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue