diff options
Diffstat (limited to 'sources/TZR_DrawEnd.c')
-rw-r--r-- | sources/TZR_DrawEnd.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sources/TZR_DrawEnd.c b/sources/TZR_DrawEnd.c index a1d09da..070accd 100644 --- a/sources/TZR_DrawEnd.c +++ b/sources/TZR_DrawEnd.c @@ -8,6 +8,24 @@ static int pixel_draw_end(void) { + if (___tzr_config.interlace) { + static int odd = 0; + odd ^= 1; + for (int i = odd; i < ___tzr_config.height; i += 2) { + const SDL_Rect rect = { + 0, + i, + ___tzr_config.width, + 1 + }; + if (SDL_RenderCopy(___tzr_renderer, + ___tzr_target_pre, + &rect, + &rect) < 0) + return sdl_error(-1); + } + } + if (SDL_SetRenderTarget(___tzr_renderer, NULL) < 0) return sdl_error(-1); if (SDL_SetRenderDrawColor(___tzr_renderer, 0, 0, 0, 255) < 0) |