mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-05 20:49:30 +00:00
Some minor todo and informational comments.
This commit is contained in:
parent
088f0cd118
commit
89553a195f
@ -472,6 +472,7 @@ image_shape::image_shape(const config& cfg, wfl::action_function_symbol_table& f
|
||||
, image_()
|
||||
, image_name_(cfg["name"])
|
||||
, resize_mode_(get_resize_mode(cfg["resize_mode"]))
|
||||
// TODO: highdpi - this is NOT vertical mirroring, but horizontal. rename.
|
||||
, vertical_mirror_(cfg["vertical_mirror"])
|
||||
, actions_formula_(cfg["actions"], &functions)
|
||||
{
|
||||
@ -586,7 +587,7 @@ void image_shape::draw(CVideo& video,
|
||||
// The clipping area should already be set by canvas::draw(),
|
||||
// so there's no need to set it here.
|
||||
|
||||
// TODO: highdpi - vertical_mirror_ - just needs a RenderCopyEx wrapper in CVideo
|
||||
// TODO: highdpi - vertical_mirror_ - just needs a RenderCopyEx wrapper in CVideo. Also note that it is NOT for vertical mirroring, but horizontal.
|
||||
|
||||
// What to do with the image depends on whether we need to tile it or not.
|
||||
switch (resize_mode_) {
|
||||
|
@ -187,6 +187,8 @@ int CVideo::fill(
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: highdpi - move all these drawing functions to a separate interface
|
||||
|
||||
int CVideo::fill(const SDL_Rect& area)
|
||||
{
|
||||
return SDL_RenderFillRect(*window, &area);
|
||||
@ -552,6 +554,8 @@ void CVideo::delay(unsigned int milliseconds)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: highdpi - separate drawing interface should also handle clipping
|
||||
|
||||
CVideo::clip_setter CVideo::set_clip(const SDL_Rect& clip)
|
||||
{
|
||||
return CVideo::clip_setter(*this, clip);
|
||||
@ -593,6 +597,7 @@ SDL_Rect CVideo::to_output(const SDL_Rect& r) const
|
||||
return {s*r.x, s*r.y, s*r.w, s*r.h};
|
||||
}
|
||||
|
||||
// TODO: highdpi - deprecate
|
||||
void CVideo::render_low_res()
|
||||
{
|
||||
if (!drawingSurface) {
|
||||
@ -619,6 +624,7 @@ void CVideo::render_low_res()
|
||||
SDL_RenderCopy(*window.get(), drawing_texture_, nullptr, nullptr);
|
||||
}
|
||||
|
||||
// TODO: highdpi - deprecate
|
||||
void CVideo::render_low_res(SDL_Rect* src_rect)
|
||||
{
|
||||
if (!drawingSurface) {
|
||||
@ -668,6 +674,10 @@ void CVideo::render_screen()
|
||||
return;
|
||||
}
|
||||
|
||||
// Note: this is not thread-safe.
|
||||
// Drawing functions should not be called while this is active.
|
||||
// SDL renderer usage is not thread-safe anyway, so this is fine.
|
||||
|
||||
if(window) {
|
||||
// Reset the render target to the window.
|
||||
SDL_SetRenderTarget(*window, nullptr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user