DXGL r592 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r591‎ | r592 | r593 >
Date:20:20, 8 February 2015
Author:admin
Status:new
Tags:
Comment:
Prevent crash on queue full event.
Sync on Blt to primary.
Modified paths:
  • /ddraw/glDirectDrawSurface.cpp (modified) (history)
  • /ddraw/opqueue.c (modified) (history)

Diff [purge]

Index: ddraw/glDirectDrawSurface.cpp
@@ -867,6 +867,7 @@
868868 this->Blt(lpDestRect, ddInterface->tmpsurface, &tmprect, dwFlags, lpDDBltFx);
869869 }
870870 else glRenderer_Blt(ddInterface->renderer,lpDestRect,src,this,lpSrcRect,dwFlags,lpDDBltFx);
 871+ if (this == ddInterface->primary) glRenderer_Sync(ddInterface->renderer);
871872 TRACE_EXIT(23, DD_OK);
872873 return DD_OK;
873874 }
Index: ddraw/opqueue.c
@@ -93,9 +93,11 @@
9494 while(queue->readptr)
9595 {
9696 waitfull = TRUE;
 97+ _exitspinlock(&queue->writelock);
9798 _enterspinlock(&queue->readlock);
9899 queue->waitfull = TRUE;
99100 _exitspinlock(&queue->readlock);
 101+ _enterspinlock(&queue->writelock);
100102 WaitForSingleObject(queue->waitevent, 10);
101103 }
102104 if (waitfull) ResetEvent(queue->waitevent);