Skip to content

Commit

Permalink
Set the color mod before rendering.
Browse files Browse the repository at this point in the history
  • Loading branch information
lipk committed Jun 17, 2014
1 parent 20b0ea6 commit d6ea2e0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/sdl/texture.cpp
Expand Up @@ -199,6 +199,7 @@ void ttexture::draw(SDL_Renderer& renderer, const int x, const int y)
SDL_Rect dstrect = create_rect(x, y, clip_.w * hscale_, clip_.h * vscale_);

SDL_SetTextureAlphaMod(texture_, alpha_);
SDL_SetTextureColorMod(texture_, r, g, b);
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, smooth_scaling_ ? "linear" : "nearest");
SDL_RenderCopyEx(&renderer, texture_, &clip_, &dstrect,
rotation_, NULL, flip_);
Expand Down Expand Up @@ -342,8 +343,6 @@ void ttexture::set_color_mod(Uint8 r, Uint8 g, Uint8 b)
mod_r_ = r;
mod_g_ = g;
mod_b_ = b;

SDL_SetTextureColorMod(texture_, r, g, b);
}

Uint8 ttexture::red_mod() const
Expand Down

0 comments on commit d6ea2e0

Please sign in to comment.