Henri Verbeet : wined3d: Take EXT_vertex_array_bgra into account in send_attribute() and loadNumberedArrays().

Alexandre Julliard julliard at winehq.org
Fri Jan 23 10:06:53 CST 2009


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Fri Jan 23 10:22:33 2009 +0100

wined3d: Take EXT_vertex_array_bgra into account in send_attribute() and loadNumberedArrays().

---

 dlls/wined3d/drawprim.c |   12 +++++++++++-
 dlls/wined3d/state.c    |   12 +++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 929565f..c9a8f4a 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -534,8 +534,18 @@ static inline void send_attribute(IWineD3DDeviceImpl *This, const DWORD type, co
         case WINED3DDECLTYPE_UBYTE4:
             GL_EXTCALL(glVertexAttrib4ubvARB(index, ptr));
             break;
-        case WINED3DDECLTYPE_UBYTE4N:
         case WINED3DDECLTYPE_D3DCOLOR:
+            if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA))
+            {
+                const DWORD *src = ptr;
+                DWORD c = *src & 0xff00ff00;
+                c |= (*src & 0xff0000) >> 16;
+                c |= (*src & 0xff) << 16;
+                GL_EXTCALL(glVertexAttrib4NubvARB(index, (GLubyte *)&c));
+                break;
+            }
+            /* else fallthrough */
+        case WINED3DDECLTYPE_UBYTE4N:
             GL_EXTCALL(glVertexAttrib4NubvARB(index, ptr));
             break;
 
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index b15eacc..ce85403 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -3925,8 +3925,18 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
                 case WINED3DDECLTYPE_UBYTE4:
                     GL_EXTCALL(glVertexAttrib4NubvARB(i, ptr));
                     break;
-                case WINED3DDECLTYPE_UBYTE4N:
                 case WINED3DDECLTYPE_D3DCOLOR:
+                    if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA))
+                    {
+                        const DWORD *src = (const DWORD *)ptr;
+                        DWORD c = *src & 0xff00ff00;
+                        c |= (*src & 0xff0000) >> 16;
+                        c |= (*src & 0xff) << 16;
+                        GL_EXTCALL(glVertexAttrib4NubvARB(i, (GLubyte *)&c));
+                        break;
+                    }
+                    /* else fallthrough */
+                case WINED3DDECLTYPE_UBYTE4N:
                     GL_EXTCALL(glVertexAttrib4NubvARB(i, ptr));
                     break;
 




More information about the wine-cvs mailing list