gamma patch
Ove Kaaven
ovehk at ping.uio.no
Mon Mar 19 01:14:08 CST 2001
And here's the GDI stuff that makes that x11drv gamma code useful.
(Have I forgotten something now?)
Now OpenGL games' gamma/brightness controls can be used in all their
glory... (we're considering using DirectColor visuals to support more
advanced gamma ramps, but that's a bit more complicated)
Log:
Ove Kaaven <ovek at transgaming.com>
Implemented Get/SetDeviceGammaRamp.
Index: dlls/ttydrv/dc.c
===================================================================
RCS file: /cvsroot/winex/wine/dlls/ttydrv/dc.c,v
retrieving revision 1.1.1.4
retrieving revision 1.5
diff -u -r1.1.1.4 -r1.5
--- dlls/ttydrv/dc.c 2000/12/12 13:58:04 1.1.1.4
+++ dlls/ttydrv/dc.c 2001/03/02 12:39:11 1.5
@@ -54,6 +54,7 @@
NULL, /* pFrameRgn */
TTYDRV_DC_GetCharWidth, /* pGetCharWidth */
NULL, /* pGetDCOrgEx */
+ NULL, /* pGetDeviceGammaRamp */
TTYDRV_DC_GetPixel, /* pGetPixel */
NULL, /* pGetPixelFormat */
TTYDRV_DC_GetTextExtentPoint, /* pGetTextExtentPoint */
@@ -90,6 +91,7 @@
TTYDRV_DC_SetBkColor, /* pSetBkColor */
NULL, /* pSetBkMode */
TTYDRV_DC_SetDeviceClipping, /* pSetDeviceClipping */
+ NULL, /* pSetDeviceGammaRamp */
TTYDRV_DC_SetDIBitsToDevice, /* pSetDIBitsToDevice */
NULL, /* pSetMapMode (optional) */
NULL, /* pSetMapperFlags */
Index: graphics/x11drv/init.c
===================================================================
RCS file: /cvsroot/winex/wine/graphics/x11drv/init.c,v
retrieving revision 1.1.1.7
retrieving revision 1.8
diff -u -r1.1.1.7 -r1.8
--- graphics/x11drv/init.c 2000/12/21 03:34:11 1.1.1.7
+++ graphics/x11drv/init.c 2001/03/02 14:19:26 1.8
@@ -62,6 +62,7 @@
NULL, /* pFrameRgn */
X11DRV_GetCharWidth, /* pGetCharWidth */
X11DRV_GetDCOrgEx, /* pGetDCOrgEx */
+ X11DRV_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */
X11DRV_GetPixel, /* pGetPixel */
X11DRV_GetPixelFormat, /* pGetPixelFormat */
X11DRV_GetTextExtentPoint, /* pGetTextExtentPoint */
@@ -98,6 +99,7 @@
X11DRV_SetBkColor, /* pSetBkColor */
NULL, /* pSetBkMode */
X11DRV_SetDeviceClipping, /* pSetDeviceClipping */
+ X11DRV_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */
X11DRV_SetDIBitsToDevice, /* pSetDIBitsToDevice */
NULL, /* pSetMapMode (optional) */
NULL, /* pSetMapperFlags */
Index: include/gdi.h
===================================================================
RCS file: /cvsroot/winex/wine/include/gdi.h,v
retrieving revision 1.1.1.8
retrieving revision 1.3
diff -u -r1.1.1.8 -r1.3
--- include/gdi.h 2001/03/18 09:29:30 1.1.1.8
+++ include/gdi.h 2001/03/18 09:57:48 1.3
@@ -199,6 +199,7 @@
BOOL (*pFrameRgn)(DC*,HRGN,HBRUSH,INT,INT);
BOOL (*pGetCharWidth)(DC*,UINT,UINT,LPINT);
BOOL (*pGetDCOrgEx)(DC*,LPPOINT);
+ BOOL (*pGetDeviceGammaRamp)(DC*,LPVOID);
COLORREF (*pGetPixel)(DC*,INT,INT);
INT (*pGetPixelFormat)(DC*);
BOOL (*pGetTextExtentPoint)(DC*,LPCWSTR,INT,LPSIZE);
@@ -235,6 +236,7 @@
COLORREF (*pSetBkColor)(DC*,COLORREF);
INT (*pSetBkMode)(DC*,INT);
VOID (*pSetDeviceClipping)(DC*);
+ BOOL (*pSetDeviceGammaRamp)(DC*,LPVOID);
INT (*pSetDIBitsToDevice)(DC*,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,
LPCVOID,const BITMAPINFO*,UINT);
INT (*pSetMapMode)(DC*,INT);
Index: include/wingdi.h
===================================================================
RCS file: /cvsroot/winex/wine/include/wingdi.h,v
retrieving revision 1.1.1.8
retrieving revision 1.3
diff -u -r1.1.1.8 -r1.3
--- include/wingdi.h 2001/03/18 09:30:05 1.1.1.8
+++ include/wingdi.h 2001/03/18 09:57:48 1.3
@@ -3139,6 +3139,7 @@
HANDLE WINAPI GetCurrentObject(HDC,UINT);
BOOL WINAPI GetCurrentPositionEx(HDC,LPPOINT);
INT WINAPI GetDeviceCaps(HDC,INT);
+BOOL WINAPI GetDeviceGammaRamp(HDC,LPVOID);
COLORREF WINAPI GetDCBrushColor(HDC);
BOOL WINAPI GetDCOrgEx(HDC,LPPOINT);
COLORREF WINAPI GetDCPenColor(HDC);
@@ -3286,6 +3287,7 @@
BOOL WINAPI SetBrushOrgEx(HDC,INT,INT,LPPOINT);
BOOL WINAPI SetColorAdjustment(HDC,const COLORADJUSTMENT*);
HCOLORSPACE WINAPI SetColorSpace(HDC,HCOLORSPACE);
+BOOL WINAPI SetDeviceGammaRamp(HDC,LPVOID);
UINT WINAPI SetDIBColorTable(HDC,UINT,UINT,RGBQUAD*);
INT WINAPI SetDIBits(HDC,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT);
INT WINAPI SetDIBitsToDevice(HDC,INT,INT,DWORD,DWORD,INT,
Index: objects/dc.c
===================================================================
RCS file: /cvsroot/winex/wine/objects/dc.c,v
retrieving revision 1.1.1.5
retrieving revision 1.3
diff -u -r1.1.1.5 -r1.3
--- objects/dc.c 2001/03/02 11:36:01 1.1.1.5
+++ objects/dc.c 2001/03/02 14:16:02 1.3
@@ -1285,9 +1285,35 @@
/***********************************************************************
* GetDeviceGammaRamp (GDI32.@)
*/
-BOOL WINAPI GetDeviceGammaRamp(HDC hdc,LPVOID ptr) {
- FIXME("(%x,%p), empty stub!\n",hdc,ptr);
- return FALSE;
+BOOL WINAPI GetDeviceGammaRamp(HDC hDC, LPVOID ptr)
+{
+ BOOL ret = FALSE;
+ DC *dc = DC_GetDCPtr( hDC );
+
+ if( dc )
+ {
+ if (dc->funcs->pGetDeviceGammaRamp)
+ ret = dc->funcs->pGetDeviceGammaRamp(dc, ptr);
+ GDI_ReleaseObj( hDC );
+ }
+ return ret;
+}
+
+/***********************************************************************
+ * SetDeviceGammaRamp (GDI32.@)
+ */
+BOOL WINAPI SetDeviceGammaRamp(HDC hDC, LPVOID ptr)
+{
+ BOOL ret = FALSE;
+ DC *dc = DC_GetDCPtr( hDC );
+
+ if( dc )
+ {
+ if (dc->funcs->pSetDeviceGammaRamp)
+ ret = dc->funcs->pSetDeviceGammaRamp(dc, ptr);
+ GDI_ReleaseObj( hDC );
+ }
+ return ret;
}
/***********************************************************************
More information about the wine-patches
mailing list