introduce GFX2_UpdateScreen()
This commit is contained in:
parent
bf29a6837c
commit
22e0bcc01f
@ -1093,11 +1093,17 @@ int Get_input(int sleep_time)
|
|||||||
{
|
{
|
||||||
Compute_paintbrush_coordinates();
|
Compute_paintbrush_coordinates();
|
||||||
Display_cursor();
|
Display_cursor();
|
||||||
|
#if defined(USE_SDL2)
|
||||||
|
//GFX2_UpdateScreen();
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (user_feedback_required)
|
if (user_feedback_required)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
#if defined(USE_SDL2)
|
||||||
|
GFX2_UpdateScreen();
|
||||||
|
#endif
|
||||||
// Nothing significant happened
|
// Nothing significant happened
|
||||||
if (sleep_time)
|
if (sleep_time)
|
||||||
SDL_Delay(sleep_time);
|
SDL_Delay(sleep_time);
|
||||||
|
|||||||
@ -57,4 +57,8 @@ extern volatile int Allow_colorcycling;
|
|||||||
/// Activates or desactivates file drag-dropping in program window.
|
/// Activates or desactivates file drag-dropping in program window.
|
||||||
void Allow_drag_and_drop(int flag);
|
void Allow_drag_and_drop(int flag);
|
||||||
|
|
||||||
|
#if defined(USE_SDL2)
|
||||||
|
void GFX2_UpdateScreen(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // SCREEN_H_INCLUDED
|
#endif // SCREEN_H_INCLUDED
|
||||||
|
|||||||
@ -178,8 +178,13 @@ static void GFX2_UpdateRect(int x, int y, int width, int height)
|
|||||||
|
|
||||||
source_rect.x = x;
|
source_rect.x = x;
|
||||||
source_rect.y = y;
|
source_rect.y = y;
|
||||||
source_rect.w = width;
|
if (width == 0 && height == 0) {
|
||||||
source_rect.h = height;
|
source_rect.w = Screen_SDL->w;
|
||||||
|
source_rect.h = Screen_SDL->h;
|
||||||
|
} else {
|
||||||
|
source_rect.w = width;
|
||||||
|
source_rect.h = height;
|
||||||
|
}
|
||||||
|
|
||||||
if (RGBcopy == NULL)
|
if (RGBcopy == NULL)
|
||||||
{
|
{
|
||||||
@ -196,7 +201,12 @@ static void GFX2_UpdateRect(int x, int y, int width, int height)
|
|||||||
memcpy(pixels + line * pitch, RGBcopy->pixels + source_rect.x * 4 + (source_rect.y+line)* RGBcopy->pitch, source_rect.w * 4 );
|
memcpy(pixels + line * pitch, RGBcopy->pixels + source_rect.x * 4 + (source_rect.y+line)* RGBcopy->pitch, source_rect.w * 4 );
|
||||||
}
|
}
|
||||||
SDL_UnlockTexture(Texture_SDL);
|
SDL_UnlockTexture(Texture_SDL);
|
||||||
SDL_RenderCopy(Renderer_SDL, Texture_SDL, &source_rect, &source_rect);
|
//SDL_RenderCopy(Renderer_SDL, Texture_SDL, &source_rect, &source_rect);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GFX2_UpdateScreen(void)
|
||||||
|
{
|
||||||
|
SDL_RenderCopy(Renderer_SDL, Texture_SDL, NULL, NULL);
|
||||||
SDL_RenderPresent(Renderer_SDL);
|
SDL_RenderPresent(Renderer_SDL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user