<font face="Arial, Helvetica, sans-serif">I am sorry everyone for the spam =) <br>
been awhile since I developed stuff, been so used to designing things =)<br>
<br>
here in all its glorry is the diff -u context.c context.c.new > diff.txt file <br>
<br>
I couldnt get the -c option to work so here is just the -u<br>
<br>
--- context.c 2008-06-26 13:52:57.000000000 -0400<br>
+++ context.c.change 2008-06-26 14:32:48.000000000 -0400<br>
@@ -116,13 +116,12 @@<br>
int iPixelFormat=0;<br>
short redBits, greenBits, blueBits, alphaBits, colorBits;<br>
short depthBits=0, stencilBits=0;<br>
-<br>
int i = 0;<br>
int nCfgs = This->adapter->nCfgs;<br>
- WineD3D_PixelFormat *cfgs = This->adapter->cfgs;<br>
<br>
- TRACE("ColorFormat=%s, DepthStencilFormat=%s, auxBuffers=%d, numSamples=%d, pbuffer=%d, findCompatible=%d\n",<br>
- debug_d3dformat(ColorFormat), debug_d3dformat(DepthStencilFormat), auxBuffers, numSamples, pbuffer, findCompatible);<br>
+ WineD3D_PixelFormat *cfgs = This->adapter->cfgs;<br>
+ BOOL exactDepthMatch = FALSE; /*Changed june 23,08 */ <br>
+ PIXELFORMATDESCRIPTOR pfd; /*Changed june 23,08 */<br>
<br>
if(!getColorBits(ColorFormat, &redBits, &greenBits, &blueBits, &alphaBits, &colorBits)) {<br>
ERR("Unable to get color bits for format %s (%#x)!\n", debug_d3dformat(ColorFormat), ColorFormat);<br>
@@ -145,84 +144,91 @@<br>
<br>
DepthStencilFormat = WINED3DFMT_D24S8;<br>
<br>
- if(DepthStencilFormat) {<br>
- getDepthStencilBits(DepthStencilFormat, &depthBits, &stencilBits);<br>
- }<br>
+/* Changed Section June 24,08 */<br>
+<br>
+#if 0<br>
+ if(DepthStencilFormat) <br>
+ { <br>
+ getDepthStencilBits(DepthStencilFormat, &depthBits, &stencilBits);<br>
+ } <br>
+#endif<br>
+<br>
+/* Just call getDepthStencilBits as the above IF will always in this case be true */<br>
+<br>
+ getDepthStencilBits(DepthStencilFormat, &depthBits, &stencilBits);<br>
<br>
/* Find a pixel format which EXACTLY matches our requirements (except for depth) */<br>
- for(i=0; i<nCfgs; i++) {<br>
- BOOL exactDepthMatch = TRUE;<br>
+ for(i=0; i<nCfgs; i++) <br>
+ {<br>
cfgs = &This->adapter->cfgs[i];<br>
-<br>
+ <br>
/* For now only accept RGBA formats. Perhaps some day we will<br>
* allow floating point formats for pbuffers. */<br>
if(cfgs->iPixelType != WGL_TYPE_RGBA_ARB)<br>
- continue;<br>
+ continue;<br>
<br>
/* In window mode (!pbuffer) we need a window drawable format and double buffering. */<br>
if(!pbuffer && !(cfgs->windowDrawable && cfgs->doubleBuffer))<br>
- continue;<br>
+ continue;<br>
<br>
- /* We like to have aux buffers in backbuffer mode */<br>
+ /* We like to have aux buffers in backbuffer mode */<br>
if(auxBuffers && !cfgs->auxBuffers)<br>
- continue;<br>
+ continue;<br>
<br>
/* In pbuffer-mode we need a pbuffer-capable format but we don't want double buffering */<br>
if(pbuffer && (!cfgs->pbufferDrawable || cfgs->doubleBuffer))<br>
- continue;<br>
+ continue;<br>
<br>
- if(cfgs->redSize != redBits)<br>
- continue;<br>
- if(cfgs->greenSize != greenBits)<br>
- continue;<br>
- if(cfgs->blueSize != blueBits)<br>
- continue;<br>
- if(cfgs->alphaSize != alphaBits)<br>
- continue;<br>
-<br>
- /* We try to locate a format which matches our requirements exactly. In case of<br>
- * depth it is no problem to emulate 16-bit using e.g. 24-bit, so accept that. */<br>
- if(cfgs->depthSize < depthBits)<br>
- continue;<br>
- else if(cfgs->depthSize > depthBits)<br>
- exactDepthMatch = FALSE;<br>
+ if ((cfgs->redSize != redBits) || (cfgs->greenSize != greenBits) || (cfgs->blueSize != blueBits) || (cfgs->alphaSize != alphaBits))<br>
+ continue;<br>
<br>
/* In all cases make sure the number of stencil bits matches our requirements<br>
* even when we don't need stencil because it could affect performance EXCEPT<br>
* on cards which don't offer depth formats without stencil like the i915 drivers<br>
* on Linux. */<br>
- if(stencilBits != cfgs->stencilSize && !(This->adapter->brokenStencil && stencilBits <= cfgs->stencilSize))<br>
- continue;<br>
+ if((stencilBits != cfgs->stencilSize) && !((This->adapter->brokenStencil && stencilBits) <= cfgs->stencilSize))<br>
+ continue;<br>
<br>
/* Check multisampling support */<br>
if(cfgs->numSamples != numSamples)<br>
- continue;<br>
+ continue;<br>
<br>
- /* When we have passed all the checks then we have found a format which matches our<br>
- * requirements. Note that we only check for a limit number of capabilities right now,<br>
- * so there can easily be a dozen of pixel formats which appear to be the 'same' but<br>
- * can still differ in things like multisampling, stereo, SRGB and other flags.<br>
- */<br>
+ /* We try to locate a format which matches our requirements exactly. In case of<br>
+ * depth it is no problem to emulate 16-bit using e.g. 24-bit, so accept that. */<br>
+ if (cfgs->depthSize != depthBits)<br>
+ continue;<br>
<br>
/* Exit the loop as we have found a format :) */<br>
- if(exactDepthMatch) {<br>
+ if (exactDepthMatch) <br>
+ {<br>
+ TRACE("Exact Depth Match\n");<br>
iPixelFormat = cfgs->iPixelFormat;<br>
break;<br>
- } else if(!iPixelFormat) {<br>
+ } <br>
+ if (!iPixelFormat) <br>
+ {<br>
/* In the end we might end up with a format which doesn't exactly match our depth<br>
* requirements. Accept the first format we found because formats with higher iPixelFormat<br>
* values tend to have more extended capabilities (e.g. multisampling) which we don't need. */<br>
+<br>
+ TRACE("Emulating %d\n",cfgs->iPixelFormat);<br>
iPixelFormat = cfgs->iPixelFormat;<br>
- }<br>
+ break; /* Added June 24,08 */<br>
+ }<br>
}<br>
<br>
/* When findCompatible is set and no suitable format was found, let ChoosePixelFormat choose a pixel format in order not to crash. */<br>
- if(!iPixelFormat && !findCompatible) {<br>
+<br>
+#if 0 <br>
+if (!iPixelFormat && !findCompatible) <br>
+ {<br>
ERR("Can't find a suitable iPixelFormat\n");<br>
return FALSE;<br>
- } else if(!iPixelFormat) {<br>
- PIXELFORMATDESCRIPTOR pfd;<br>
-<br>
+ } <br>
+#endif<br>
+ <br>
+ if (!iPixelFormat) <br>
+ {<br>
TRACE("Falling back to ChoosePixelFormat as we weren't able to find an exactly matching pixel format\n");<br>
/* PixelFormat selection */<br>
ZeroMemory(&pfd, sizeof(pfd));<br>
@@ -235,16 +241,17 @@<br>
pfd.cDepthBits = depthBits;<br>
pfd.cStencilBits = stencilBits;<br>
pfd.iLayerType = PFD_MAIN_PLANE;<br>
-<br>
+ <br>
iPixelFormat = ChoosePixelFormat(hdc, &pfd);<br>
- if(!iPixelFormat) {<br>
- /* If this happens something is very wrong as ChoosePixelFormat barely fails */<br>
- ERR("Can't find a suitable iPixelFormat\n");<br>
- return FALSE;<br>
- }<br>
- }<br>
+ if (!iPixelFormat) <br>
+ {<br>
+ /* If this happens something is very wrong as ChoosePixelFormat barely fails */<br>
+ ERR("Can't find a suitable iPixelFormat\n");<br>
+ return FALSE;<br>
+ }<br>
+ }<br>
<br>
- TRACE("Found iPixelFormat=%d for ColorFormat=%s, DepthStencilFormat=%s\n", iPixelFormat, debug_d3dformat(ColorFormat), debug_d3dformat(DepthStencilFormat));<br>
+ TRACE("Found iPixelFormat\n");<br>
return iPixelFormat;<br>
}<br>
<br>
@@ -372,6 +379,7 @@<br>
<br>
/* If we still don't have a pixel format, something is very wrong as ChoosePixelFormat barely fails */<br>
if(!iPixelFormat) {<br>
+ TRACE("Choose Pixel Format Failed\n");<br>
ERR("Can't find a suitable iPixelFormat\n");<br>
return FALSE;<br>
}<br>
<br>
<br>
Better?<br>
<br>
Chris<br>
<br>
</font><div id='u8CAA5D2E9DAC778-1224-81E' class='aol_ad_footer'><FONT style="color: black; font: normal 10pt ARIAL, SAN-SERIF;"><HR style="MARGIN-TOP: 10px"><A title="http://toolbar.aol.com/moviefone/download.html?ncid=aolcmp00050000000011" href="http://toolbar.aol.com/moviefone/download.html?ncid=aolcmp00050000000011" target="_blank">Get the Moviefone Toolbar</A>. Showtimes, theaters, movie news, & more!</FONT> </div>