From a633367e70d34f4a5419a0bb36e623ddb20ffa53 Mon Sep 17 00:00:00 2001 From: Mark Calderbank Date: Fri, 5 Dec 2008 15:50:25 +0000 Subject: [PATCH] DVB Subtitles: changes for Windows port --- dvbsubtitles.cc | 7 +++++++ surfacewin.cc | 2 ++ threadwin.h | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dvbsubtitles.cc b/dvbsubtitles.cc index 32836d9..43c3932 100644 --- a/dvbsubtitles.cc +++ b/dvbsubtitles.cc @@ -829,10 +829,17 @@ void DVBSubtitles::hide() void DVBSubtitles::nudge() { +#ifndef WIN32 pthread_mutex_lock(&threadCondMutex); threadNudged = true; pthread_cond_signal(&threadCond); pthread_mutex_unlock(&threadCondMutex); +#else + WaitForSingleObject(threadCondMutex, INFINITE); + threadNudged = true; + SetEvent(threadCond); + ReleaseMutex(threadCondMutex); +#endif } void DVBSubtitles::threadMethod() diff --git a/surfacewin.cc b/surfacewin.cc index 6b52b73..4139ae7 100644 --- a/surfacewin.cc +++ b/surfacewin.cc @@ -219,9 +219,11 @@ void SurfaceWin::drawVertLine(int x, int y1, int y2, unsigned int c) void SurfaceWin::drawBitmap(int x, int y, const Bitmap& bm) { // Temporary code? Draw one pixel at a time using drawPixel() + startFastDraw(); for (UINT j = 0; j < bm.getHeight(); ++j) for (UINT i = 0; i < bm.getWidth(); ++i) drawPixel(x+i, y+j, bm.getColour(i,j)); + endFastDraw(); } int SurfaceWin::updateToScreen(int sx, int sy, int w, int h, int dx, int dy) // FIXME new, replace others with this FIXME diff --git a/threadwin.h b/threadwin.h index 9a87fec..3c4903f 100644 --- a/threadwin.h +++ b/threadwin.h @@ -62,7 +62,8 @@ class ThreadWin : public Thread // Internal bits and pieces - private: +// private: // TODO: make these private again when dvbsubtitles.cc + // no longer needs direct access. HANDLE pthread; HANDLE threadCondMutex; HANDLE threadCond; -- 2.39.5