DirectDrawRenderer - opengl non power of 2 windows

Nathan Williams nathan.andrew.williams at gmail.com
Sat Mar 31 04:56:22 CDT 2007


Sorry about the last patch, I slipped up on my bitwise operators.
This should be correct to my intentions at least!


(I forgot to hit reply all, agh, i should probably power off my
computer now :P )

On 3/31/07, Chris Bandy <cbandy at jbandy.com> wrote:
>
>
> Stefan Dösinger wrote:
> >> @@ -3194,6 +3193,7 @@ static HRESULT WINAPI
> >>
> > IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) {
> >
> >>     } else {
> >>         /* No oversize, gl rect is the full texture size */
> >>          This->Flags &= ~SFLAG_OVERSIZE;
> >> +        This->Flags &= SFLAG_NONPOW2;
> >>
> >
> >
> > This is not correct. This removes every flag except SFLAG_NONPOW2. If you want
> > to remove the SFLAG_NONPOW2 flag you have to invert the flag:
> >
> > This->Flags &= ~SFLAG_NONPOW2
> >
> If you want to set the SFLAG_NONPOW2 flag...
>
> This->Flags |= SFLAG_NONPOW2
>


--
Nathan



-- 
Nathan
-------------- next part --------------
From 72a209c869b2ec91af771df6907dbe0638a33c04 Mon Sep 17 00:00:00 2001
From: Nathan Williams <nathan.andrew.williams at gmail.com>
Date: Sat, 31 Mar 2007 19:39:35 +1000
Subject: OpenGL ddraw renderer pow2 fix

---
 dlls/wined3d/surface.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 8ac924b..5312eba 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -955,7 +955,6 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This) {
 
         case WINED3DFMT_P8:
         {
-            int height = This->glRect.bottom - This->glRect.top;
             type = GL_UNSIGNED_BYTE;
             fmt = GL_RGBA;
 
@@ -969,7 +968,7 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This) {
                                    mem,
                                    pitch,
                                    pitch,
-                                   height,
+                                   This->currentDesc.Height,
                                    pitch * 4,
                                    CONVERT_PALETTED,
                                    This);
@@ -3194,6 +3193,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) {
     } else {
         /* No oversize, gl rect is the full texture size */
         This->Flags &= ~SFLAG_OVERSIZE;
+        This->Flags |= SFLAG_NONPOW2;
         This->glRect.left = 0;
         This->glRect.top = 0;
         This->glRect.right = This->pow2Width;
-- 
1.4.4.4


More information about the wine-devel mailing list