Henri Verbeet : ddraw: Implement ddraw7_GetMonitorFrequency() on top of wined3d_get_adapter_display_mode().

Alexandre Julliard julliard at winehq.org
Wed Jul 25 16:06:52 CDT 2012


Module: wine
Branch: master
Commit: 5b093e6ba9506f96c3d3f5d9460a406559bd73ce
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5b093e6ba9506f96c3d3f5d9460a406559bd73ce

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Jul 24 23:21:29 2012 +0200

ddraw: Implement ddraw7_GetMonitorFrequency() on top of wined3d_get_adapter_display_mode().

---

 dlls/ddraw/ddraw.c |   37 +++++++++++++++++--------------------
 1 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 3accf03..6a63d8a 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -1568,28 +1568,25 @@ static HRESULT WINAPI ddraw1_GetFourCCCodes(IDirectDraw *iface, DWORD *codes_cou
     return ddraw7_GetFourCCCodes(&ddraw->IDirectDraw7_iface, codes_count, codes);
 }
 
-/*****************************************************************************
- * IDirectDraw7::GetMonitorFrequency
- *
- * Returns the monitor's frequency
- *
- * Exists in Version 1, 2, 4 and 7
- *
- * Params:
- *  Freq: Pointer to a DWORD to write the frequency to
- *
- * Returns
- *  Always returns DD_OK
- *
- *****************************************************************************/
-static HRESULT WINAPI ddraw7_GetMonitorFrequency(IDirectDraw7 *iface, DWORD *Freq)
+static HRESULT WINAPI ddraw7_GetMonitorFrequency(IDirectDraw7 *iface, DWORD *frequency)
 {
-    FIXME("iface %p, frequency %p stub!\n", iface, Freq);
+    struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
+    struct wined3d_display_mode mode;
+    HRESULT hr;
+
+    TRACE("iface %p, frequency %p.\n", iface, frequency);
+
+    wined3d_mutex_lock();
+    hr = wined3d_get_adapter_display_mode(ddraw->wined3d, WINED3DADAPTER_DEFAULT, &mode, NULL);
+    wined3d_mutex_unlock();
+    if (FAILED(hr))
+    {
+        WARN("Failed to get display mode, hr %#x.\n", hr);
+        return hr;
+    }
+
+    *frequency = mode.refresh_rate;
 
-    /* Ideally this should be in WineD3D, as it concerns the screen setup,
-     * but for now this should make the games happy
-     */
-    *Freq = 60;
     return DD_OK;
 }
 




More information about the wine-cvs mailing list