mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-22 13:31:08 +00:00
trying to remove graphical anomalies, alternative deadlock fix branch
This commit is contained in:
parent
1b6a63edf7
commit
537412b959
@ -875,23 +875,26 @@ static int present_sdl_video()
|
|||||||
SDL_SetRenderDrawColor(sdl_renderer, 0, 0, 0, 0); // Use black
|
SDL_SetRenderDrawColor(sdl_renderer, 0, 0, 0, 0); // Use black
|
||||||
SDL_RenderClear(sdl_renderer); // Clear the display
|
SDL_RenderClear(sdl_renderer); // Clear the display
|
||||||
|
|
||||||
|
LOCK_PALETTE;
|
||||||
|
SDL_LockMutex(sdl_update_video_mutex);
|
||||||
// Convert from the guest OS' pixel format, to the host OS' texture, if necessary.
|
// Convert from the guest OS' pixel format, to the host OS' texture, if necessary.
|
||||||
if (host_surface != guest_surface &&
|
if (host_surface != guest_surface &&
|
||||||
host_surface != NULL &&
|
host_surface != NULL &&
|
||||||
guest_surface != NULL)
|
guest_surface != NULL)
|
||||||
{
|
{
|
||||||
SDL_Rect destRect = sdl_update_video_rect;
|
SDL_Rect destRect = sdl_update_video_rect;
|
||||||
LOCK_PALETTE;
|
|
||||||
SDL_LockMutex(sdl_update_video_mutex);
|
|
||||||
int result = SDL_BlitSurface(guest_surface, &sdl_update_video_rect, host_surface, &destRect);
|
int result = SDL_BlitSurface(guest_surface, &sdl_update_video_rect, host_surface, &destRect);
|
||||||
SDL_UnlockMutex(sdl_update_video_mutex);
|
if (result != 0) {
|
||||||
UNLOCK_PALETTE;
|
SDL_UnlockMutex(sdl_update_video_mutex);
|
||||||
if (result != 0) return -1;
|
UNLOCK_PALETTE;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
UNLOCK_PALETTE;
|
||||||
|
|
||||||
// We're about to work with sdl_update_video_rect, so stop other threads from
|
// We're about to work with sdl_update_video_rect, so stop other threads from
|
||||||
// modifying it!
|
// modifying it!
|
||||||
SDL_LockMutex(sdl_update_video_mutex);
|
// SDL_LockMutex(sdl_update_video_mutex);
|
||||||
|
|
||||||
// Update the host OS' texture
|
// Update the host OS' texture
|
||||||
void * srcPixels = (void *)((uint8_t *)host_surface->pixels +
|
void * srcPixels = (void *)((uint8_t *)host_surface->pixels +
|
||||||
|
Loading…
Reference in New Issue
Block a user