Display: exit render_scaled_to_zoom early if passed texture is null

This commit is contained in:
Charles Dang 2017-07-22 18:21:47 +11:00
parent d9f284f926
commit eeece5e3c7

View file

@ -899,6 +899,10 @@ public:
template<typename... T>
void render_scaled_to_zoom(const texture& tex, const int x_pos, const int y_pos, T&&... extra_args) const
{
if(tex.null()) {
return;
}
texture::info info = tex.get_info();
// Scale the coordinates to the appropriate zoom factor.
@ -926,6 +930,10 @@ public:
template<typename... T>
void render_scaled_to_zoom(const texture& tex, const map_location& loc, T&&... extra_args) const
{
if(tex.null()) {
return;
}
SDL_Point origin = get_loc_drawing_origin(loc);
render_scaled_to_zoom(tex, origin.x, origin.y, std::forward<T>(extra_args)...);