[PATCH 4/5] wined3d: Rename the IWineD3DSurfaceImpl "Flags" field to "flags".
Henri Verbeet
hverbeet at codeweavers.com
Fri Nov 12 06:12:04 CST 2010
---
dlls/wined3d/device.c | 24 ++--
dlls/wined3d/drawprim.c | 2 +-
dlls/wined3d/surface.c | 345 +++++++++++++++++++++-------------------
dlls/wined3d/surface_base.c | 14 +-
dlls/wined3d/surface_gdi.c | 48 +++---
dlls/wined3d/swapchain.c | 17 +-
dlls/wined3d/wined3d_private.h | 3 +-
7 files changed, 242 insertions(+), 211 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index ed3df0a..8d375a5 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -609,7 +609,7 @@ static void prepare_ds_clear(IWineD3DSurfaceImpl *ds, struct wined3d_context *co
{
RECT current_rect, r;
- if (ds->Flags & location)
+ if (ds->flags & location)
SetRect(¤t_rect, 0, 0,
ds->ds_current_size.cx,
ds->ds_current_size.cy);
@@ -5820,7 +5820,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *
if (This->depth_stencil)
{
if (((IWineD3DSwapChainImpl *)This->swapchains[0])->presentParms.Flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
- || This->depth_stencil->Flags & SFLAG_DISCARD)
+ || This->depth_stencil->flags & SFLAG_DISCARD)
{
surface_modify_ds_location(This->depth_stencil, SFLAG_DS_DISCARDED,
This->depth_stencil->currentDesc.Width,
@@ -6078,7 +6078,8 @@ static HRESULT updateSurfaceDesc(IWineD3DSurfaceImpl *surface, const WINED3DPRES
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
/* Reallocate proper memory for the front and back buffer and adjust their sizes */
- if(surface->Flags & SFLAG_DIBSECTION) {
+ if (surface->flags & SFLAG_DIBSECTION)
+ {
/* Release the DC */
SelectObject(surface->hDC, surface->dib.holdbitmap);
DeleteDC(surface->hDC);
@@ -6086,7 +6087,7 @@ static HRESULT updateSurfaceDesc(IWineD3DSurfaceImpl *surface, const WINED3DPRES
DeleteObject(surface->dib.DIBsection);
surface->dib.bitmap_data = NULL;
surface->resource.allocatedMemory = NULL;
- surface->Flags &= ~SFLAG_DIBSECTION;
+ surface->flags &= ~SFLAG_DIBSECTION;
}
surface->currentDesc.Width = pPresentationParameters->BackBufferWidth;
surface->currentDesc.Height = pPresentationParameters->BackBufferHeight;
@@ -6109,13 +6110,16 @@ static HRESULT updateSurfaceDesc(IWineD3DSurfaceImpl *surface, const WINED3DPRES
LEAVE_GL();
context_release(context);
surface->texture_name = 0;
- surface->Flags &= ~SFLAG_CLIENT;
+ surface->flags &= ~SFLAG_CLIENT;
+ }
+ if (surface->pow2Width != pPresentationParameters->BackBufferWidth
+ || surface->pow2Height != pPresentationParameters->BackBufferHeight)
+ {
+ surface->flags |= SFLAG_NONPOW2;
}
- if(surface->pow2Width != pPresentationParameters->BackBufferWidth ||
- surface->pow2Height != pPresentationParameters->BackBufferHeight) {
- surface->Flags |= SFLAG_NONPOW2;
- } else {
- surface->Flags &= ~SFLAG_NONPOW2;
+ else
+ {
+ surface->flags &= ~SFLAG_NONPOW2;
}
HeapFree(GetProcessHeap(), 0, surface->resource.heapMemory);
surface->resource.allocatedMemory = NULL;
diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c
index 4804ced..0a90da0 100644
--- a/dlls/wined3d/drawprim.c
+++ b/dlls/wined3d/drawprim.c
@@ -611,7 +611,7 @@ void drawPrimitive(IWineD3DDevice *iface, UINT index_count, UINT StartIdx, UINT
if (location == SFLAG_DS_ONSCREEN && This->depth_stencil != This->onscreen_depth_stencil)
device_switch_onscreen_ds(This, context, This->depth_stencil);
- if (This->depth_stencil->Flags & location)
+ if (This->depth_stencil->flags & location)
SetRect(¤t_rect, 0, 0,
This->depth_stencil->ds_current_size.cx,
This->depth_stencil->ds_current_size.cy);
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 618e3f0..f9cddc8 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -38,7 +38,7 @@ static void surface_cleanup(IWineD3DSurfaceImpl *This)
{
TRACE("(%p) : Cleaning up.\n", This);
- if (This->texture_name || (This->Flags & SFLAG_PBO) || !list_empty(&This->renderbuffers))
+ if (This->texture_name || (This->flags & SFLAG_PBO) || !list_empty(&This->renderbuffers))
{
const struct wined3d_gl_info *gl_info;
renderbuffer_entry_t *entry, *entry2;
@@ -55,7 +55,7 @@ static void surface_cleanup(IWineD3DSurfaceImpl *This)
glDeleteTextures(1, &This->texture_name);
}
- if (This->Flags & SFLAG_PBO)
+ if (This->flags & SFLAG_PBO)
{
TRACE("Deleting PBO %u.\n", This->pbo);
GL_EXTCALL(glDeleteBuffersARB(1, &This->pbo));
@@ -73,7 +73,7 @@ static void surface_cleanup(IWineD3DSurfaceImpl *This)
context_release(context);
}
- if (This->Flags & SFLAG_DIBSECTION)
+ if (This->flags & SFLAG_DIBSECTION)
{
/* Release the DC. */
SelectObject(This->hDC, This->dib.holdbitmap);
@@ -84,7 +84,7 @@ static void surface_cleanup(IWineD3DSurfaceImpl *This)
This->resource.allocatedMemory = NULL;
}
- if (This->Flags & SFLAG_USERPTR) IWineD3DSurface_SetMem((IWineD3DSurface *)This, NULL);
+ if (This->flags & SFLAG_USERPTR) IWineD3DSurface_SetMem((IWineD3DSurface *)This, NULL);
if (This->overlay_dest) list_remove(&This->overlay_entry);
HeapFree(GetProcessHeap(), 0, This->palette9);
@@ -391,9 +391,9 @@ HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type,
list_init(&surface->overlays);
/* Flags */
- surface->Flags = SFLAG_NORMCOORD; /* Default to normalized coords. */
- if (discard) surface->Flags |= SFLAG_DISCARD;
- if (lockable || format_id == WINED3DFMT_D16_LOCKABLE) surface->Flags |= SFLAG_LOCKABLE;
+ surface->flags = SFLAG_NORMCOORD; /* Default to normalized coords. */
+ if (discard) surface->flags |= SFLAG_DISCARD;
+ if (lockable || format_id == WINED3DFMT_D16_LOCKABLE) surface->flags |= SFLAG_LOCKABLE;
/* Quick lockable sanity check.
* TODO: remove this after surfaces, usage and lockability have been debugged properly
@@ -455,7 +455,7 @@ HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type,
static void surface_force_reload(IWineD3DSurfaceImpl *surface)
{
- surface->Flags &= ~(SFLAG_ALLOCATED | SFLAG_SRGBALLOCATED);
+ surface->flags &= ~(SFLAG_ALLOCATED | SFLAG_SRGBALLOCATED);
}
void surface_set_texture_name(IWineD3DSurfaceImpl *surface, GLuint new_name, BOOL srgb)
@@ -480,7 +480,7 @@ void surface_set_texture_name(IWineD3DSurfaceImpl *surface, GLuint new_name, BOO
{
/* FIXME: We shouldn't need to remove SFLAG_INTEXTURE if the
* surface has no texture name yet. See if we can get rid of this. */
- if (surface->Flags & flag)
+ if (surface->flags & flag)
ERR("Surface has %s set, but no texture name.\n", debug_surflocation(flag));
surface_modify_location(surface, flag, FALSE);
}
@@ -497,11 +497,11 @@ void surface_set_texture_target(IWineD3DSurfaceImpl *surface, GLenum target)
{
if (target == GL_TEXTURE_RECTANGLE_ARB)
{
- surface->Flags &= ~SFLAG_NORMCOORD;
+ surface->flags &= ~SFLAG_NORMCOORD;
}
else if (surface->texture_target == GL_TEXTURE_RECTANGLE_ARB)
{
- surface->Flags |= SFLAG_NORMCOORD;
+ surface->flags |= SFLAG_NORMCOORD;
}
}
surface->texture_target = target;
@@ -557,7 +557,7 @@ static void surface_download_data(IWineD3DSurfaceImpl *This, const struct wined3
const struct wined3d_format *format = This->resource.format;
/* Only support read back of converted P8 surfaces */
- if (This->Flags & SFLAG_CONVERTED && format->id != WINED3DFMT_P8_UINT)
+ if (This->flags & SFLAG_CONVERTED && format->id != WINED3DFMT_P8_UINT)
{
FIXME("Readback conversion not supported for format %s.\n", debug_d3dformat(format->id));
return;
@@ -571,7 +571,7 @@ static void surface_download_data(IWineD3DSurfaceImpl *This, const struct wined3
This, This->texture_level, format->glFormat, format->glType,
This->resource.allocatedMemory);
- if (This->Flags & SFLAG_PBO)
+ if (This->flags & SFLAG_PBO)
{
GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, This->pbo));
checkGLcall("glBindBufferARB");
@@ -602,7 +602,8 @@ static void surface_download_data(IWineD3DSurfaceImpl *This, const struct wined3
gl_type = GL_UNSIGNED_BYTE;
}
- if (This->Flags & SFLAG_NONPOW2) {
+ if (This->flags & SFLAG_NONPOW2)
+ {
unsigned char alignment = This->resource.device->surface_alignment;
src_pitch = format->byte_count * This->pow2Width;
dst_pitch = IWineD3DSurface_GetPitch((IWineD3DSurface *) This);
@@ -615,7 +616,8 @@ static void surface_download_data(IWineD3DSurfaceImpl *This, const struct wined3
TRACE("(%p) : Calling glGetTexImage level %d, format %#x, type %#x, data %p\n",
This, This->texture_level, gl_format, gl_type, mem);
- if(This->Flags & SFLAG_PBO) {
+ if (This->flags & SFLAG_PBO)
+ {
GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, This->pbo));
checkGLcall("glBindBufferARB");
@@ -630,7 +632,8 @@ static void surface_download_data(IWineD3DSurfaceImpl *This, const struct wined3
}
LEAVE_GL();
- if (This->Flags & SFLAG_NONPOW2) {
+ if (This->flags & SFLAG_NONPOW2)
+ {
const BYTE *src_data;
BYTE *dst_data;
UINT y;
@@ -699,7 +702,7 @@ static void surface_download_data(IWineD3DSurfaceImpl *This, const struct wined3
}
/* Surface has now been downloaded */
- This->Flags |= SFLAG_INSYSMEM;
+ This->flags |= SFLAG_INSYSMEM;
}
/* This call just uploads data, the caller is responsible for binding the
@@ -734,7 +737,7 @@ static void surface_upload_data(IWineD3DSurfaceImpl *This, const struct wined3d_
ENTER_GL();
- if (This->Flags & SFLAG_PBO)
+ if (This->flags & SFLAG_PBO)
{
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, This->pbo));
checkGLcall("glBindBufferARB");
@@ -760,7 +763,7 @@ static void surface_upload_data(IWineD3DSurfaceImpl *This, const struct wined3d_
checkGLcall("glTexSubImage2D");
}
- if (This->Flags & SFLAG_PBO)
+ if (This->flags & SFLAG_PBO)
{
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
checkGLcall("glBindBufferARB");
@@ -815,7 +818,7 @@ static void surface_allocate_surface(IWineD3DSurfaceImpl *This, const struct win
if (gl_info->supported[APPLE_CLIENT_STORAGE])
{
- if (This->Flags & (SFLAG_NONPOW2 | SFLAG_DIBSECTION | SFLAG_CONVERTED)
+ if (This->flags & (SFLAG_NONPOW2 | SFLAG_DIBSECTION | SFLAG_CONVERTED)
|| !This->resource.allocatedMemory)
{
/* In some cases we want to disable client storage.
@@ -826,10 +829,12 @@ static void surface_allocate_surface(IWineD3DSurfaceImpl *This, const struct win
*/
glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_FALSE);
checkGLcall("glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, GL_FALSE)");
- This->Flags &= ~SFLAG_CLIENT;
+ This->flags &= ~SFLAG_CLIENT;
enable_client_storage = TRUE;
- } else {
- This->Flags |= SFLAG_CLIENT;
+ }
+ else
+ {
+ This->flags |= SFLAG_CLIENT;
/* Point opengl to our allocated texture memory. Do not use resource.allocatedMemory here because
* it might point into a pbo. Instead use heapMemory, but get the alignment right.
@@ -950,7 +955,7 @@ void surface_add_dirty_rect(IWineD3DSurfaceImpl *surface, const RECT *dirty_rect
{
TRACE("surface %p, dirty_rect %s.\n", surface, wine_dbgstr_rect(dirty_rect));
- if (!(surface->Flags & SFLAG_INSYSMEM) && (surface->Flags & SFLAG_INTEXTURE))
+ if (!(surface->flags & SFLAG_INSYSMEM) && (surface->flags & SFLAG_INTEXTURE))
/* No partial locking for textures yet. */
surface_load_location(surface, SFLAG_INSYSMEM, NULL);
@@ -1127,7 +1132,7 @@ static void surface_remove_pbo(IWineD3DSurfaceImpl *This, const struct wined3d_g
LEAVE_GL();
This->pbo = 0;
- This->Flags &= ~SFLAG_PBO;
+ This->flags &= ~SFLAG_PBO;
}
BOOL surface_init_sysmem(IWineD3DSurfaceImpl *surface)
@@ -1186,13 +1191,13 @@ static void WINAPI IWineD3DSurfaceImpl_UnLoad(IWineD3DSurface *iface)
}
surface_modify_location(This, SFLAG_INTEXTURE, FALSE);
surface_modify_location(This, SFLAG_INSRGBTEX, FALSE);
- This->Flags &= ~(SFLAG_ALLOCATED | SFLAG_SRGBALLOCATED);
+ This->flags &= ~(SFLAG_ALLOCATED | SFLAG_SRGBALLOCATED);
context = context_acquire(device, NULL);
gl_info = context->gl_info;
/* Destroy PBOs, but load them into real sysmem before */
- if (This->Flags & SFLAG_PBO)
+ if (This->flags & SFLAG_PBO)
surface_remove_pbo(This, gl_info);
/* Destroy fbo render buffers. This is needed for implicit render targets, for
@@ -1338,7 +1343,8 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v
bpp = This->resource.format->byte_count;
}
- if(This->Flags & SFLAG_PBO) {
+ if (This->flags & SFLAG_PBO)
+ {
GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, This->pbo));
checkGLcall("glBindBufferARB");
if (mem)
@@ -1378,7 +1384,8 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v
glPixelStorei(GL_PACK_SKIP_ROWS, skipRow);
checkGLcall("glPixelStorei");
- if(This->Flags & SFLAG_PBO) {
+ if (This->flags & SFLAG_PBO)
+ {
GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, 0));
checkGLcall("glBindBufferARB");
@@ -1423,7 +1430,8 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, const RECT *rect, v
HeapFree(GetProcessHeap(), 0, row);
/* Unmap the temp PBO buffer */
- if(This->Flags & SFLAG_PBO) {
+ if (This->flags & SFLAG_PBO)
+ {
GL_EXTCALL(glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB));
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
}
@@ -1523,15 +1531,15 @@ static void surface_prepare_texture_internal(IWineD3DSurfaceImpl *surface,
CONVERT_TYPES convert;
struct wined3d_format format;
- if (surface->Flags & alloc_flag) return;
+ if (surface->flags & alloc_flag) return;
d3dfmt_get_conv(surface, TRUE, TRUE, &format, &convert);
- if (convert != NO_CONVERSION || format.convert) surface->Flags |= SFLAG_CONVERTED;
- else surface->Flags &= ~SFLAG_CONVERTED;
+ if (convert != NO_CONVERSION || format.convert) surface->flags |= SFLAG_CONVERTED;
+ else surface->flags &= ~SFLAG_CONVERTED;
surface_bind_and_dirtify(surface, srgb);
surface_allocate_surface(surface, gl_info, &format, srgb);
- surface->Flags |= alloc_flag;
+ surface->flags |= alloc_flag;
}
/* Context activation is done by the caller. */
@@ -1566,20 +1574,21 @@ static void surface_prepare_system_memory(IWineD3DSurfaceImpl *This)
* This avoids the need to download the surface from opengl all the time. The surface is still downloaded if the opengl texture is
* changed
*/
- if(!(This->Flags & SFLAG_DYNLOCK)) {
+ if (!(This->flags & SFLAG_DYNLOCK))
+ {
This->lockCount++;
/* MAXLOCKCOUNT is defined in wined3d_private.h */
if(This->lockCount > MAXLOCKCOUNT) {
TRACE("Surface is locked regularly, not freeing the system memory copy any more\n");
- This->Flags |= SFLAG_DYNLOCK;
+ This->flags |= SFLAG_DYNLOCK;
}
}
/* Create a PBO for dynamically locked surfaces but don't do it for converted or non-pow2 surfaces.
* Also don't create a PBO for systemmem surfaces.
*/
- if (gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] && (This->Flags & SFLAG_DYNLOCK)
- && !(This->Flags & (SFLAG_PBO | SFLAG_CONVERTED | SFLAG_NONPOW2))
+ if (gl_info->supported[ARB_PIXEL_BUFFER_OBJECT] && (This->flags & SFLAG_DYNLOCK)
+ && !(This->flags & (SFLAG_PBO | SFLAG_CONVERTED | SFLAG_NONPOW2))
&& (This->resource.pool != WINED3DPOOL_SYSTEMMEM))
{
GLenum error;
@@ -1605,16 +1614,17 @@ static void surface_prepare_system_memory(IWineD3DSurfaceImpl *This)
checkGLcall("glBindBufferARB");
/* We don't need the system memory anymore and we can't even use it for PBOs */
- if(!(This->Flags & SFLAG_CLIENT)) {
+ if (!(This->flags & SFLAG_CLIENT))
+ {
HeapFree(GetProcessHeap(), 0, This->resource.heapMemory);
This->resource.heapMemory = NULL;
}
This->resource.allocatedMemory = NULL;
- This->Flags |= SFLAG_PBO;
+ This->flags |= SFLAG_PBO;
LEAVE_GL();
context_release(context);
}
- else if (!(This->resource.allocatedMemory || This->Flags & SFLAG_PBO))
+ else if (!(This->resource.allocatedMemory || This->flags & SFLAG_PBO))
{
/* Whatever surface we have, make sure that there is memory allocated for the downloaded copy,
* or a pbo to map
@@ -1624,7 +1634,8 @@ static void surface_prepare_system_memory(IWineD3DSurfaceImpl *This)
}
This->resource.allocatedMemory =
(BYTE *)(((ULONG_PTR) This->resource.heapMemory + (RESOURCE_ALIGNMENT - 1)) & ~(RESOURCE_ALIGNMENT - 1));
- if(This->Flags & SFLAG_INSYSMEM) {
+ if (This->flags & SFLAG_INSYSMEM)
+ {
ERR("Surface without memory or pbo has SFLAG_INSYSMEM set!\n");
}
}
@@ -1644,13 +1655,14 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Map(IWineD3DSurface *iface,
* gl into the sysmem copy. The PBO may be mapped, a different rectangle locked, the discard flag
* may interfere, and all other bad things may happen
*/
- if (This->Flags & SFLAG_LOCKED) {
+ if (This->flags & SFLAG_LOCKED)
+ {
WARN("Surface is already locked, returning D3DERR_INVALIDCALL\n");
return WINED3DERR_INVALIDCALL;
}
- This->Flags |= SFLAG_LOCKED;
+ This->flags |= SFLAG_LOCKED;
- if (!(This->Flags & SFLAG_LOCKABLE))
+ if (!(This->flags & SFLAG_LOCKABLE))
{
TRACE("Warning: trying to lock unlockable surf@%p\n", This);
}
@@ -1679,7 +1691,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Map(IWineD3DSurface *iface,
}
lock_end:
- if (This->Flags & SFLAG_PBO)
+ if (This->flags & SFLAG_PBO)
{
const struct wined3d_gl_info *gl_info;
struct wined3d_context *context;
@@ -1738,7 +1750,7 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This,
RECT rect;
UINT w, h;
- if (This->Flags & SFLAG_LOCKED)
+ if (This->flags & SFLAG_LOCKED)
rect = This->lockedRect;
else
SetRect(&rect, 0, 0, This->currentDesc.Width, This->currentDesc.Height);
@@ -1786,7 +1798,8 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This,
* be any interfering gdi accesses, because UnlockRect is called from
* ReleaseDC, and the app won't use the dc any more afterwards.
*/
- if((This->Flags & SFLAG_DIBSECTION) && !(This->Flags & SFLAG_PBO)) {
+ if ((This->flags & SFLAG_DIBSECTION) && !(This->flags & SFLAG_PBO))
+ {
volatile BYTE read;
read = This->resource.allocatedMemory[0];
}
@@ -1794,7 +1807,8 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This,
/* If not fullscreen, we need to skip a number of bytes to find the next row of data */
glPixelStorei(GL_UNPACK_ROW_LENGTH, This->currentDesc.Width);
- if(This->Flags & SFLAG_PBO) {
+ if (This->flags & SFLAG_PBO)
+ {
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, This->pbo));
checkGLcall("glBindBufferARB");
}
@@ -1802,7 +1816,8 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This,
glDrawPixels(w, h, fmt, type, mem);
checkGLcall("glDrawPixels");
- if(This->Flags & SFLAG_PBO) {
+ if (This->flags & SFLAG_PBO)
+ {
GL_EXTCALL(glBindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0));
checkGLcall("glBindBufferARB");
}
@@ -1820,12 +1835,13 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Unmap(IWineD3DSurface *iface)
IWineD3DDeviceImpl *device = This->resource.device;
BOOL fullsurface;
- if (!(This->Flags & SFLAG_LOCKED)) {
+ if (!(This->flags & SFLAG_LOCKED))
+ {
WARN("trying to Unlock an unlocked surf@%p\n", This);
return WINEDDERR_NOTLOCKED;
}
- if (This->Flags & SFLAG_PBO)
+ if (This->flags & SFLAG_PBO)
{
const struct wined3d_gl_info *gl_info;
struct wined3d_context *context;
@@ -1846,9 +1862,10 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Unmap(IWineD3DSurface *iface)
This->resource.allocatedMemory = NULL;
}
- TRACE("(%p) : dirtyfied(%d)\n", This, This->Flags & (SFLAG_INDRAWABLE | SFLAG_INTEXTURE) ? 0 : 1);
+ TRACE("(%p) : dirtyfied(%d)\n", This, This->flags & (SFLAG_INDRAWABLE | SFLAG_INTEXTURE) ? 0 : 1);
- if (This->Flags & (SFLAG_INDRAWABLE | SFLAG_INTEXTURE)) {
+ if (This->flags & (SFLAG_INDRAWABLE | SFLAG_INTEXTURE))
+ {
TRACE("(%p) : Not Dirtified so nothing to do, return now\n", This);
goto unlock_end;
}
@@ -1873,7 +1890,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Unmap(IWineD3DSurface *iface)
} else {
/* TODO: Proper partial rectangle tracking */
fullsurface = FALSE;
- This->Flags |= SFLAG_INSYSMEM;
+ This->flags |= SFLAG_INSYSMEM;
}
surface_load_location(This, SFLAG_INDRAWABLE, fullsurface ? NULL : &This->dirtyRect);
@@ -1888,8 +1905,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Unmap(IWineD3DSurface *iface)
* sysmem copy are written back to the drawable, thus the surface
* is merged again in the drawable. The sysmem copy is not fully
* up to date because only a subrectangle was read in Map(). */
- This->Flags &= ~SFLAG_INSYSMEM;
- This->Flags |= SFLAG_INDRAWABLE;
+ This->flags &= ~SFLAG_INSYSMEM;
+ This->flags |= SFLAG_INDRAWABLE;
}
This->dirtyRect.left = This->currentDesc.Width;
@@ -1903,7 +1920,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Unmap(IWineD3DSurface *iface)
}
unlock_end:
- This->Flags &= ~SFLAG_LOCKED;
+ This->flags &= ~SFLAG_LOCKED;
memset(&This->lockedRect, 0, sizeof(RECT));
/* Overlays have to be redrawn manually after changes with the GL implementation */
@@ -1952,17 +1969,18 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
TRACE("(%p)->(%p)\n",This,pHDC);
- if(This->Flags & SFLAG_USERPTR) {
+ if (This->flags & SFLAG_USERPTR)
+ {
ERR("Not supported on surfaces with an application-provided surfaces\n");
return WINEDDERR_NODC;
}
/* Give more detailed info for ddraw */
- if (This->Flags & SFLAG_DCINUSE)
+ if (This->flags & SFLAG_DCINUSE)
return WINEDDERR_DCALREADYCREATED;
/* Can't GetDC if the surface is locked */
- if (This->Flags & SFLAG_LOCKED)
+ if (This->flags & SFLAG_LOCKED)
return WINED3DERR_INVALIDCALL;
memset(&lock, 0, sizeof(lock)); /* To be sure */
@@ -1970,7 +1988,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
/* Create a DIB section if there isn't a hdc yet */
if (!This->hDC)
{
- if (This->Flags & SFLAG_CLIENT)
+ if (This->flags & SFLAG_CLIENT)
{
surface_load_location(This, SFLAG_INSYSMEM, NULL);
surface_release_client_storage(This);
@@ -1979,7 +1997,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
if(FAILED(hr)) return WINED3DERR_INVALIDCALL;
/* Use the dib section from now on if we are not using a PBO */
- if(!(This->Flags & SFLAG_PBO))
+ if (!(This->flags & SFLAG_PBO))
This->resource.allocatedMemory = This->dib.bitmap_data;
}
@@ -1988,7 +2006,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
/* Sync the DIB with the PBO. This can't be done earlier because Map()
* activates the allocatedMemory. */
- if (This->Flags & SFLAG_PBO)
+ if (This->flags & SFLAG_PBO)
memcpy(This->dib.bitmap_data, This->resource.allocatedMemory, This->dib.bitmap_size);
if (FAILED(hr))
@@ -2030,7 +2048,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
*pHDC = This->hDC;
TRACE("returning %p\n",*pHDC);
- This->Flags |= SFLAG_DCINUSE;
+ This->flags |= SFLAG_DCINUSE;
return WINED3D_OK;
}
@@ -2041,7 +2059,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
TRACE("(%p)->(%p)\n",This,hDC);
- if (!(This->Flags & SFLAG_DCINUSE))
+ if (!(This->flags & SFLAG_DCINUSE))
return WINEDDERR_NODC;
if (This->hDC !=hDC) {
@@ -2049,7 +2067,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
return WINEDDERR_NODC;
}
- if((This->Flags & SFLAG_PBO) && This->resource.allocatedMemory) {
+ if ((This->flags & SFLAG_PBO) && This->resource.allocatedMemory)
+ {
/* Copy the contents of the DIB over to the PBO */
memcpy(This->resource.allocatedMemory, This->dib.bitmap_data, This->dib.bitmap_size);
}
@@ -2057,7 +2076,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
/* we locked first, so unlock now */
IWineD3DSurface_Unmap(iface);
- This->Flags &= ~SFLAG_DCINUSE;
+ This->flags &= ~SFLAG_DCINUSE;
return WINED3D_OK;
}
@@ -2441,12 +2460,13 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, BO
TRACE("iface %p, srgb %#x.\n", iface, srgb_mode);
- if (!(This->Flags & flag)) {
+ if (!(This->flags & flag))
+ {
TRACE("Reloading because surface is dirty\n");
}
/* Reload if either the texture and sysmem have different ideas about the
* color key, or the actual key values changed. */
- else if (!(This->Flags & SFLAG_GLCKEY) != !(This->CKeyFlags & WINEDDSD_CKSRCBLT)
+ else if (!(This->flags & SFLAG_GLCKEY) != !(This->CKeyFlags & WINEDDSD_CKSRCBLT)
|| ((This->CKeyFlags & WINEDDSD_CKSRCBLT)
&& (This->glCKey.dwColorSpaceLowValue != This->SrcBltCKey.dwColorSpaceLowValue
|| This->glCKey.dwColorSpaceHighValue != This->SrcBltCKey.dwColorSpaceHighValue)))
@@ -2478,7 +2498,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadTexture(IWineD3DSurface *iface, BO
surface_load_location(This, flag, NULL /* no partial locking for textures yet */);
- if (!(This->Flags & SFLAG_DONOTFREE)) {
+ if (!(This->flags & SFLAG_DONOTFREE))
+ {
HeapFree(GetProcessHeap(), 0, This->resource.heapMemory);
This->resource.allocatedMemory = NULL;
This->resource.heapMemory = NULL;
@@ -2550,8 +2571,9 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, enum
TRACE("(%p) : Calling base function first\n", This);
hr = IWineD3DBaseSurfaceImpl_SetFormat(iface, format);
- if(SUCCEEDED(hr)) {
- This->Flags &= ~(SFLAG_ALLOCATED | SFLAG_SRGBALLOCATED);
+ if (SUCCEEDED(hr))
+ {
+ This->flags &= ~(SFLAG_ALLOCATED | SFLAG_SRGBALLOCATED);
TRACE("(%p) : glFormat %d, glFormatInternal %d, glType %d\n", This, This->resource.format->glFormat,
This->resource.format->glInternal, This->resource.format->glType);
}
@@ -2561,7 +2583,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_SetFormat(IWineD3DSurface *iface, enum
static HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *Mem) {
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
- if(This->Flags & (SFLAG_LOCKED | SFLAG_DCINUSE)) {
+ if (This->flags & (SFLAG_LOCKED | SFLAG_DCINUSE))
+ {
WARN("Surface is locked or the HDC is in use\n");
return WINED3DERR_INVALIDCALL;
}
@@ -2570,46 +2593,45 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *M
void *release = NULL;
/* Do I have to copy the old surface content? */
- if(This->Flags & SFLAG_DIBSECTION) {
- /* Release the DC. No need to hold the critical section for the update
- * Thread because this thread runs only on front buffers, but this method
- * fails for render targets in the check above.
- */
- SelectObject(This->hDC, This->dib.holdbitmap);
- DeleteDC(This->hDC);
- /* Release the DIB section */
- DeleteObject(This->dib.DIBsection);
- This->dib.bitmap_data = NULL;
- This->resource.allocatedMemory = NULL;
- This->hDC = NULL;
- This->Flags &= ~SFLAG_DIBSECTION;
- } else if(!(This->Flags & SFLAG_USERPTR)) {
+ if (This->flags & SFLAG_DIBSECTION)
+ {
+ SelectObject(This->hDC, This->dib.holdbitmap);
+ DeleteDC(This->hDC);
+ /* Release the DIB section */
+ DeleteObject(This->dib.DIBsection);
+ This->dib.bitmap_data = NULL;
+ This->resource.allocatedMemory = NULL;
+ This->hDC = NULL;
+ This->flags &= ~SFLAG_DIBSECTION;
+ }
+ else if (!(This->flags & SFLAG_USERPTR))
+ {
release = This->resource.heapMemory;
This->resource.heapMemory = NULL;
}
This->resource.allocatedMemory = Mem;
- This->Flags |= SFLAG_USERPTR | SFLAG_INSYSMEM;
+ This->flags |= SFLAG_USERPTR | SFLAG_INSYSMEM;
/* Now the surface memory is most up do date. Invalidate drawable and texture */
surface_modify_location(This, SFLAG_INSYSMEM, TRUE);
/* For client textures opengl has to be notified */
- if (This->Flags & SFLAG_CLIENT)
+ if (This->flags & SFLAG_CLIENT)
surface_release_client_storage(This);
/* Now free the old memory if any */
HeapFree(GetProcessHeap(), 0, release);
}
- else if (This->Flags & SFLAG_USERPTR)
+ else if (This->flags & SFLAG_USERPTR)
{
/* Map and GetDC will re-create the dib section and allocated memory. */
This->resource.allocatedMemory = NULL;
/* HeapMemory should be NULL already */
if (This->resource.heapMemory)
ERR("User pointer surface has heap memory allocated.\n");
- This->Flags &= ~SFLAG_USERPTR;
+ This->flags &= ~SFLAG_USERPTR;
- if (This->Flags & SFLAG_CLIENT)
+ if (This->flags & SFLAG_CLIENT)
surface_release_client_storage(This);
}
return WINED3D_OK;
@@ -2629,15 +2651,15 @@ void flip_surface(IWineD3DSurfaceImpl *front, IWineD3DSurfaceImpl *back) {
/* Flip the DIBsection */
{
HBITMAP tmp;
- BOOL hasDib = front->Flags & SFLAG_DIBSECTION;
+ BOOL hasDib = front->flags & SFLAG_DIBSECTION;
tmp = front->dib.DIBsection;
front->dib.DIBsection = back->dib.DIBsection;
back->dib.DIBsection = tmp;
- if(back->Flags & SFLAG_DIBSECTION) front->Flags |= SFLAG_DIBSECTION;
- else front->Flags &= ~SFLAG_DIBSECTION;
- if(hasDib) back->Flags |= SFLAG_DIBSECTION;
- else back->Flags &= ~SFLAG_DIBSECTION;
+ if (back->flags & SFLAG_DIBSECTION) front->flags |= SFLAG_DIBSECTION;
+ else front->flags &= ~SFLAG_DIBSECTION;
+ if (hasDib) back->flags |= SFLAG_DIBSECTION;
+ else back->flags &= ~SFLAG_DIBSECTION;
}
/* Flip the surface data */
@@ -2686,9 +2708,9 @@ void flip_surface(IWineD3DSurfaceImpl *front, IWineD3DSurfaceImpl *back) {
}
{
- DWORD tmp_flags = back->Flags;
- back->Flags = front->Flags;
- front->Flags = tmp_flags;
+ DWORD tmp_flags = back->flags;
+ back->flags = front->flags;
+ front->flags = tmp_flags;
}
}
@@ -2928,7 +2950,7 @@ static void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *dst_surface, IWine
checkGLcall("glEnable(texture_target)");
/* For now invalidate the texture copy of the back buffer. Drawable and sysmem copy are untouched */
- src_surface->Flags &= ~SFLAG_INTEXTURE;
+ src_surface->flags &= ~SFLAG_INTEXTURE;
}
/* Make sure that the top pixel is always above the bottom pixel, and keep a separate upside down flag
@@ -3027,7 +3049,7 @@ static void fb_copy_to_texture_hwstretch(IWineD3DSurfaceImpl *dst_surface, IWine
bottom = src_surface->currentDesc.Height - src_rect->top;
}
- if (src_surface->Flags & SFLAG_NORMCOORD)
+ if (src_surface->flags & SFLAG_NORMCOORD)
{
left /= src_surface->pow2Width;
right /= src_surface->pow2Width;
@@ -3634,7 +3656,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *dst_surface,
fb_copy_to_texture_hwstretch(dst_surface, src_surface, &src_rect, &dst_rect, Filter);
}
- if (!(dst_surface->Flags & SFLAG_DONOTFREE))
+ if (!(dst_surface->flags & SFLAG_DONOTFREE))
{
HeapFree(GetProcessHeap(), 0, dst_surface->resource.heapMemory);
dst_surface->resource.allocatedMemory = NULL;
@@ -3642,7 +3664,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *dst_surface,
}
else
{
- dst_surface->Flags &= ~SFLAG_INSYSMEM;
+ dst_surface->flags &= ~SFLAG_INSYSMEM;
}
return WINED3D_OK;
@@ -3790,7 +3812,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT
Flags, DDBltFx, debug_d3dtexturefiltertype(Filter));
TRACE("Usage is %s.\n", debug_d3dusage(This->resource.usage));
- if ((This->Flags & SFLAG_LOCKED) || (src && (src->Flags & SFLAG_LOCKED)))
+ if ((This->flags & SFLAG_LOCKED) || (src && (src->flags & SFLAG_LOCKED)))
{
WARN(" Surface is busy, returning DDERR_SURFACEBUSY\n");
return WINEDDERR_SURFACEBUSY;
@@ -3837,7 +3859,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD
TRACE("iface %p, dst_x %u, dst_y %u, src_surface %p, src_rect %s, flags %#x.\n",
iface, dstx, dsty, src_surface, wine_dbgstr_rect(rsrc), trans);
- if ((This->Flags & SFLAG_LOCKED) || (src->Flags & SFLAG_LOCKED))
+ if ((This->flags & SFLAG_LOCKED) || (src->flags & SFLAG_LOCKED))
{
WARN(" Surface is busy, returning DDERR_SURFACEBUSY\n");
return WINEDDERR_SURFACEBUSY;
@@ -3906,7 +3928,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface)
}
else
{
- if (!(This->Flags & SFLAG_INSYSMEM))
+ if (!(This->flags & SFLAG_INSYSMEM))
{
TRACE("Palette changed with surface that does not have an up to date system memory copy.\n");
surface_load_location(This, SFLAG_INSYSMEM, NULL);
@@ -3916,7 +3938,8 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_RealizePalette(IWineD3DSurface *iface)
}
}
- if(This->Flags & SFLAG_DIBSECTION) {
+ if (This->flags & SFLAG_DIBSECTION)
+ {
TRACE("(%p): Updating the hdc's palette\n", This);
for (n=0; n<256; n++) {
col[n].rgbRed = pal->palents[n].peRed;
@@ -3970,9 +3993,10 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) {
}
}
- if(pow2Width != This->currentDesc.Width ||
- pow2Height != This->currentDesc.Height) {
- This->Flags |= SFLAG_NONPOW2;
+ if (pow2Width != This->currentDesc.Width
+ || pow2Height != This->currentDesc.Height)
+ {
+ This->flags |= SFLAG_NONPOW2;
}
TRACE("%p\n", This);
@@ -4000,7 +4024,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) {
is used in combination with texture uploads (RTL_READTEX/RTL_TEXTEX). The reason is that EXT_PALETTED_TEXTURE
doesn't work in combination with ARB_TEXTURE_RECTANGLE.
*/
- if (This->Flags & SFLAG_NONPOW2 && gl_info->supported[ARB_TEXTURE_RECTANGLE]
+ if (This->flags & SFLAG_NONPOW2 && gl_info->supported[ARB_TEXTURE_RECTANGLE]
&& !(This->resource.format->id == WINED3DFMT_P8_UINT
&& gl_info->supported[EXT_PALETTED_TEXTURE]
&& wined3d_settings.rendertargetlock_mode == RTL_READTEX))
@@ -4008,7 +4032,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) {
This->texture_target = GL_TEXTURE_RECTANGLE_ARB;
This->pow2Width = This->currentDesc.Width;
This->pow2Height = This->currentDesc.Height;
- This->Flags &= ~(SFLAG_NONPOW2 | SFLAG_NORMCOORD);
+ This->flags &= ~(SFLAG_NONPOW2 | SFLAG_NORMCOORD);
}
}
@@ -4027,7 +4051,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) {
return WINED3DERR_INVALIDCALL;
}
- This->Flags |= SFLAG_INSYSMEM;
+ This->flags |= SFLAG_INSYSMEM;
return WINED3D_OK;
}
@@ -4098,8 +4122,8 @@ void surface_modify_ds_location(IWineD3DSurfaceImpl *surface,
surface->ds_current_size.cx = w;
surface->ds_current_size.cy = h;
- surface->Flags &= ~SFLAG_DS_LOCATIONS;
- surface->Flags |= location;
+ surface->flags &= ~SFLAG_DS_LOCATIONS;
+ surface->flags |= location;
}
/* Context activation is done by the caller. */
@@ -4113,7 +4137,7 @@ void surface_load_ds_location(IWineD3DSurfaceImpl *surface, struct wined3d_conte
/* TODO: Make this work for modes other than FBO */
if (wined3d_settings.offscreen_rendering_mode != ORM_FBO) return;
- if (!(surface->Flags & location))
+ if (!(surface->flags & location))
{
surface->ds_current_size.cx = 0;
surface->ds_current_size.cy = 0;
@@ -4132,10 +4156,10 @@ void surface_load_ds_location(IWineD3DSurfaceImpl *surface, struct wined3d_conte
return;
}
- if (!(surface->Flags & SFLAG_LOCATIONS))
+ if (!(surface->flags & SFLAG_LOCATIONS))
{
FIXME("No up to date depth stencil location.\n");
- surface->Flags |= location;
+ surface->flags |= location;
return;
}
@@ -4239,7 +4263,7 @@ void surface_load_ds_location(IWineD3DSurfaceImpl *surface, struct wined3d_conte
ERR("Invalid location (%#x) specified.\n", location);
}
- surface->Flags |= location;
+ surface->flags |= location;
surface->ds_current_size.cx = surface->currentDesc.Width;
surface->ds_current_size.cy = surface->currentDesc.Height;
}
@@ -4266,8 +4290,8 @@ void surface_modify_location(IWineD3DSurfaceImpl *surface, DWORD flag, BOOL pers
if (persistent)
{
- if (((surface->Flags & SFLAG_INTEXTURE) && !(flag & SFLAG_INTEXTURE))
- || ((surface->Flags & SFLAG_INSRGBTEX) && !(flag & SFLAG_INSRGBTEX)))
+ if (((surface->flags & SFLAG_INTEXTURE) && !(flag & SFLAG_INTEXTURE))
+ || ((surface->flags & SFLAG_INSRGBTEX) && !(flag & SFLAG_INSRGBTEX)))
{
if (surface->container.type == WINED3D_CONTAINER_TEXTURE)
{
@@ -4275,8 +4299,8 @@ void surface_modify_location(IWineD3DSurfaceImpl *surface, DWORD flag, BOOL pers
IWineD3DBaseTexture_SetDirty((IWineD3DBaseTexture *)surface->container.u.texture, TRUE);
}
}
- surface->Flags &= ~SFLAG_LOCATIONS;
- surface->Flags |= flag;
+ surface->flags &= ~SFLAG_LOCATIONS;
+ surface->flags |= flag;
/* Redraw emulated overlays, if any */
if (flag & SFLAG_INDRAWABLE && !list_empty(&surface->overlays))
@@ -4289,7 +4313,7 @@ void surface_modify_location(IWineD3DSurfaceImpl *surface, DWORD flag, BOOL pers
}
else
{
- if ((surface->Flags & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX)) && (flag & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX)))
+ if ((surface->flags & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX)) && (flag & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX)))
{
if (surface->container.type == WINED3D_CONTAINER_TEXTURE)
{
@@ -4297,10 +4321,10 @@ void surface_modify_location(IWineD3DSurfaceImpl *surface, DWORD flag, BOOL pers
IWineD3DBaseTexture_SetDirty((IWineD3DBaseTexture *)surface->container.u.texture, TRUE);
}
}
- surface->Flags &= ~flag;
+ surface->flags &= ~flag;
}
- if (!(surface->Flags & SFLAG_LOCATIONS))
+ if (!(surface->flags & SFLAG_LOCATIONS))
{
ERR("Surface %p does not have any up to date location.\n", surface);
}
@@ -4351,16 +4375,16 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
}
}
- if (surface->Flags & flag)
+ if (surface->flags & flag)
{
TRACE("Location already up to date\n");
return WINED3D_OK;
}
- if (!(surface->Flags & SFLAG_LOCATIONS))
+ if (!(surface->flags & SFLAG_LOCATIONS))
{
ERR("Surface %p does not have any up to date location.\n", surface);
- surface->Flags |= SFLAG_LOST;
+ surface->flags |= SFLAG_LOST;
return WINED3DERR_DEVICELOST;
}
@@ -4369,13 +4393,13 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
surface_prepare_system_memory(surface);
/* Download the surface to system memory */
- if (surface->Flags & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX))
+ if (surface->flags & (SFLAG_INTEXTURE | SFLAG_INSRGBTEX))
{
struct wined3d_context *context = NULL;
if (!device->isInDraw) context = context_acquire(device, NULL);
- surface_bind_and_dirtify(surface, !(surface->Flags & SFLAG_INTEXTURE));
+ surface_bind_and_dirtify(surface, !(surface->flags & SFLAG_INTEXTURE));
surface_download_data(surface, gl_info);
if (context) context_release(context);
@@ -4392,7 +4416,7 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
if (wined3d_settings.rendertargetlock_mode == RTL_READTEX)
surface_load_location(surface, SFLAG_INTEXTURE, NULL);
- if (surface->Flags & SFLAG_INTEXTURE)
+ if (surface->flags & SFLAG_INTEXTURE)
{
RECT r;
@@ -4402,7 +4426,7 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
else
{
int byte_count;
- if ((surface->Flags & SFLAG_LOCATIONS) == SFLAG_INSRGBTEX)
+ if ((surface->flags & SFLAG_LOCATIONS) == SFLAG_INSRGBTEX)
{
/* This needs a shader to convert the srgb data sampled from the GL texture into RGB
* values, otherwise we get incorrect values in the target. For now go the slow way
@@ -4420,7 +4444,7 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
/* Don't use PBOs for converted surfaces. During PBO conversion we look at SFLAG_CONVERTED
* but it isn't set (yet) in all cases it is getting called. */
- if ((convert != NO_CONVERSION) && (surface->Flags & SFLAG_PBO))
+ if ((convert != NO_CONVERSION) && (surface->flags & SFLAG_PBO))
{
struct wined3d_context *context = NULL;
@@ -4448,11 +4472,11 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
d3dfmt_convert_surface(surface->resource.allocatedMemory, mem, pitch,
width, height, outpitch, convert, surface);
- surface->Flags |= SFLAG_CONVERTED;
+ surface->flags |= SFLAG_CONVERTED;
}
else
{
- surface->Flags &= ~SFLAG_CONVERTED;
+ surface->flags &= ~SFLAG_CONVERTED;
mem = surface->resource.allocatedMemory;
byte_count = format.byte_count;
}
@@ -4460,7 +4484,7 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
flush_to_framebuffer_drawpixels(surface, format.glFormat, format.glType, byte_count, mem);
/* Don't delete PBO memory */
- if ((mem != surface->resource.allocatedMemory) && !(surface->Flags & SFLAG_PBO))
+ if ((mem != surface->resource.allocatedMemory) && !(surface->flags & SFLAG_PBO))
HeapFree(GetProcessHeap(), 0, mem);
}
}
@@ -4468,11 +4492,11 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
{
const DWORD attach_flags = WINED3DFMT_FLAG_FBO_ATTACHABLE | WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB;
- if (drawable_read_ok && (surface->Flags & SFLAG_INDRAWABLE))
+ if (drawable_read_ok && (surface->flags & SFLAG_INDRAWABLE))
{
read_from_framebuffer_texture(surface, flag == SFLAG_INSRGBTEX);
}
- else if (surface->Flags & (SFLAG_INSRGBTEX | SFLAG_INTEXTURE)
+ else if (surface->flags & (SFLAG_INSRGBTEX | SFLAG_INTEXTURE)
&& (surface->resource.format->Flags & attach_flags) == attach_flags
&& fbo_blit_supported(gl_info, BLIT_OP_BLIT,
NULL, surface->resource.usage, surface->resource.pool, surface->resource.format,
@@ -4495,7 +4519,7 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
if (srgb)
{
- if ((surface->Flags & (SFLAG_INTEXTURE | SFLAG_INSYSMEM)) == SFLAG_INTEXTURE)
+ if ((surface->flags & (SFLAG_INTEXTURE | SFLAG_INSYSMEM)) == SFLAG_INTEXTURE)
{
/* Performance warning... */
FIXME("Downloading RGB surface %p to reload it as sRGB.\n", surface);
@@ -4504,14 +4528,14 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
}
else
{
- if ((surface->Flags & (SFLAG_INSRGBTEX | SFLAG_INSYSMEM)) == SFLAG_INSRGBTEX)
+ if ((surface->flags & (SFLAG_INSRGBTEX | SFLAG_INSYSMEM)) == SFLAG_INSRGBTEX)
{
/* Performance warning... */
FIXME("Downloading sRGB surface %p to reload it as RGB.\n", surface);
surface_load_location(surface, SFLAG_INSYSMEM, rect);
}
}
- if (!(surface->Flags & SFLAG_INSYSMEM))
+ if (!(surface->flags & SFLAG_INSYSMEM))
{
WARN("Trying to load a texture from sysmem, but SFLAG_INSYSMEM is not set.\n");
/* Lets hope we get it from somewhere... */
@@ -4525,10 +4549,10 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
if (surface->CKeyFlags & WINEDDSD_CKSRCBLT)
{
- surface->Flags |= SFLAG_GLCKEY;
+ surface->flags |= SFLAG_GLCKEY;
surface->glCKey = surface->SrcBltCKey;
}
- else surface->Flags &= ~SFLAG_GLCKEY;
+ else surface->flags &= ~SFLAG_GLCKEY;
/* The width is in 'length' not in bytes */
width = surface->currentDesc.Width;
@@ -4536,7 +4560,7 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
/* Don't use PBOs for converted surfaces. During PBO conversion we look at SFLAG_CONVERTED
* but it isn't set (yet) in all cases it is getting called. */
- if ((convert != NO_CONVERSION || format.convert) && (surface->Flags & SFLAG_PBO))
+ if ((convert != NO_CONVERSION || format.convert) && (surface->flags & SFLAG_PBO))
{
TRACE("Removing the pbo attached to surface %p.\n", surface);
surface_remove_pbo(surface, gl_info);
@@ -4587,7 +4611,7 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
glPixelStorei(GL_UNPACK_ROW_LENGTH, width);
LEAVE_GL();
- if (mem || (surface->Flags & SFLAG_PBO))
+ if (mem || (surface->flags & SFLAG_PBO))
surface_upload_data(surface, gl_info, &format, srgb, mem);
/* Restore the default pitch */
@@ -4598,17 +4622,17 @@ HRESULT surface_load_location(IWineD3DSurfaceImpl *surface, DWORD flag, const RE
if (context) context_release(context);
/* Don't delete PBO memory */
- if ((mem != surface->resource.allocatedMemory) && !(surface->Flags & SFLAG_PBO))
+ if ((mem != surface->resource.allocatedMemory) && !(surface->flags & SFLAG_PBO))
HeapFree(GetProcessHeap(), 0, mem);
}
}
- if (!rect) surface->Flags |= flag;
+ if (!rect) surface->flags |= flag;
- if (in_fbo && (surface->Flags & (SFLAG_INTEXTURE | SFLAG_INDRAWABLE)))
+ if (in_fbo && (surface->flags & (SFLAG_INTEXTURE | SFLAG_INDRAWABLE)))
{
/* With ORM_FBO, SFLAG_INTEXTURE and SFLAG_INDRAWABLE are the same for offscreen targets. */
- surface->Flags |= (SFLAG_INTEXTURE | SFLAG_INDRAWABLE);
+ surface->flags |= (SFLAG_INTEXTURE | SFLAG_INDRAWABLE);
}
return WINED3D_OK;
@@ -4626,16 +4650,15 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_DrawOverlay(IWineD3DSurface *iface) {
if(!This->overlay_dest) return WINED3D_OK;
/* Blt calls ModifyLocation on the dest surface, which in turn calls DrawOverlay to
- * update the overlay. Prevent an endless recursion
- */
- if(This->overlay_dest->Flags & SFLAG_INOVERLAYDRAW) {
+ * update the overlay. Prevent an endless recursion. */
+ if (This->overlay_dest->flags & SFLAG_INOVERLAYDRAW)
return WINED3D_OK;
- }
- This->overlay_dest->Flags |= SFLAG_INOVERLAYDRAW;
- hr = IWineD3DSurfaceImpl_Blt((IWineD3DSurface *) This->overlay_dest, &This->overlay_destrect,
- iface, &This->overlay_srcrect, WINEDDBLT_WAIT,
- NULL, WINED3DTEXF_LINEAR);
- This->overlay_dest->Flags &= ~SFLAG_INOVERLAYDRAW;
+
+ This->overlay_dest->flags |= SFLAG_INOVERLAYDRAW;
+ hr = IWineD3DSurfaceImpl_Blt((IWineD3DSurface *)This->overlay_dest,
+ &This->overlay_destrect, iface, &This->overlay_srcrect,
+ WINEDDBLT_WAIT, NULL, WINED3DTEXF_LINEAR);
+ This->overlay_dest->flags &= ~SFLAG_INOVERLAYDRAW;
return hr;
}
diff --git a/dlls/wined3d/surface_base.c b/dlls/wined3d/surface_base.c
index b9dd634..61ecb7c 100644
--- a/dlls/wined3d/surface_base.c
+++ b/dlls/wined3d/surface_base.c
@@ -197,7 +197,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_IsLost(IWineD3DSurface *iface) {
TRACE("(%p)\n", This);
/* D3D8 and 9 loose full devices, ddraw only surfaces */
- return This->Flags & SFLAG_LOST ? WINED3DERR_DEVICELOST : WINED3D_OK;
+ return This->flags & SFLAG_LOST ? WINED3DERR_DEVICELOST : WINED3D_OK;
}
HRESULT WINAPI IWineD3DBaseSurfaceImpl_Restore(IWineD3DSurface *iface) {
@@ -205,7 +205,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Restore(IWineD3DSurface *iface) {
TRACE("(%p)\n", This);
/* So far we don't lose anything :) */
- This->Flags &= ~SFLAG_LOST;
+ This->flags &= ~SFLAG_LOST;
return WINED3D_OK;
}
@@ -483,7 +483,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetFormat(IWineD3DSurface *iface, enum wi
This->resource.size = wined3d_format_calculate_size(format, This->resource.device->surface_alignment,
This->pow2Width, This->pow2Height);
- This->Flags |= (WINED3DFMT_D16_LOCKABLE == format_id) ? SFLAG_LOCKABLE : 0;
+ This->flags |= (WINED3DFMT_D16_LOCKABLE == format_id) ? SFLAG_LOCKABLE : 0;
This->resource.format = format;
@@ -612,7 +612,7 @@ HRESULT IWineD3DBaseSurfaceImpl_CreateDIBSection(IWineD3DSurface *iface)
memcpy(This->dib.bitmap_data, This->resource.allocatedMemory, This->currentDesc.Height * IWineD3DSurface_GetPitch(iface));
} else {
/* This is to make LockRect read the gl Texture although memory is allocated */
- This->Flags &= ~SFLAG_INSYSMEM;
+ This->flags &= ~SFLAG_INSYSMEM;
}
This->dib.bitmap_size = b_info->bmiHeader.biSizeImage;
@@ -626,7 +626,7 @@ HRESULT IWineD3DBaseSurfaceImpl_CreateDIBSection(IWineD3DSurface *iface)
This->palette ? This->palette->hpal : 0,
FALSE);
- This->Flags |= SFLAG_DIBSECTION;
+ This->flags |= SFLAG_DIBSECTION;
HeapFree(GetProcessHeap(), 0, This->resource.heapMemory);
This->resource.heapMemory = NULL;
@@ -941,7 +941,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Blt(IWineD3DSurface *iface, const RECT *D
iface, wine_dbgstr_rect(DestRect), src_surface, wine_dbgstr_rect(SrcRect),
Flags, DDBltFx, debug_d3dtexturefiltertype(Filter));
- if ((This->Flags & SFLAG_LOCKED) || (src && (src->Flags & SFLAG_LOCKED)))
+ if ((This->flags & SFLAG_LOCKED) || (src && (src->flags & SFLAG_LOCKED)))
{
WARN(" Surface is busy, returning DDERR_SURFACEBUSY\n");
return WINEDDERR_SURFACEBUSY;
@@ -1571,7 +1571,7 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, DWORD dst
TRACE("iface %p, dst_x %u, dst_y %u, src_surface %p, src_rect %s, flags %#x.\n",
iface, dstx, dsty, src_surface, wine_dbgstr_rect(rsrc), trans);
- if ((This->Flags & SFLAG_LOCKED) || (src->Flags & SFLAG_LOCKED))
+ if ((This->flags & SFLAG_LOCKED) || (src->flags & SFLAG_LOCKED))
{
WARN(" Surface is busy, returning DDERR_SURFACEBUSY\n");
return WINEDDERR_SURFACEBUSY;
diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c
index 9386a88..6be94b0 100644
--- a/dlls/wined3d/surface_gdi.c
+++ b/dlls/wined3d/surface_gdi.c
@@ -38,7 +38,7 @@ void surface_gdi_cleanup(IWineD3DSurfaceImpl *This)
{
TRACE("(%p) : Cleaning up.\n", This);
- if (This->Flags & SFLAG_DIBSECTION)
+ if (This->flags & SFLAG_DIBSECTION)
{
/* Release the DC. */
SelectObject(This->hDC, This->dib.holdbitmap);
@@ -49,7 +49,7 @@ void surface_gdi_cleanup(IWineD3DSurfaceImpl *This)
This->resource.allocatedMemory = NULL;
}
- if (This->Flags & SFLAG_USERPTR) IWineD3DSurface_SetMem((IWineD3DSurface *)This, NULL);
+ if (This->flags & SFLAG_USERPTR) IWineD3DSurface_SetMem((IWineD3DSurface *)This, NULL);
if (This->overlay_dest) list_remove(&This->overlay_entry);
HeapFree(GetProcessHeap(), 0, This->palette9);
@@ -115,13 +115,13 @@ static HRESULT WINAPI IWineGDISurfaceImpl_Map(IWineD3DSurface *iface,
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
/* Already locked? */
- if(This->Flags & SFLAG_LOCKED)
+ if (This->flags & SFLAG_LOCKED)
{
WARN("(%p) Surface already locked\n", This);
/* What should I return here? */
return WINED3DERR_INVALIDCALL;
}
- This->Flags |= SFLAG_LOCKED;
+ This->flags |= SFLAG_LOCKED;
if(!This->resource.allocatedMemory) {
/* This happens on gdi surfaces if the application set a user pointer and resets it.
@@ -139,7 +139,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_Unmap(IWineD3DSurface *iface)
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
TRACE("(%p)\n", This);
- if (!(This->Flags & SFLAG_LOCKED))
+ if (!(This->flags & SFLAG_LOCKED))
{
WARN("Trying to unmap unmapped surfaces %p.\n", iface);
return WINEDDERR_NOTLOCKED;
@@ -155,7 +155,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_Unmap(IWineD3DSurface *iface)
}
}
- This->Flags &= ~SFLAG_LOCKED;
+ This->flags &= ~SFLAG_LOCKED;
memset(&This->lockedRect, 0, sizeof(RECT));
return WINED3D_OK;
}
@@ -225,23 +225,24 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
TRACE("(%p)->(%p)\n",This,pHDC);
- if(!(This->Flags & SFLAG_DIBSECTION))
+ if (!(This->flags & SFLAG_DIBSECTION))
{
WARN("DC not supported on this surface\n");
return WINED3DERR_INVALIDCALL;
}
- if(This->Flags & SFLAG_USERPTR) {
+ if (This->flags & SFLAG_USERPTR)
+ {
ERR("Not supported on surfaces with an application-provided surfaces\n");
return WINEDDERR_NODC;
}
/* Give more detailed info for ddraw */
- if (This->Flags & SFLAG_DCINUSE)
+ if (This->flags & SFLAG_DCINUSE)
return WINEDDERR_DCALREADYCREATED;
/* Can't GetDC if the surface is locked */
- if (This->Flags & SFLAG_LOCKED)
+ if (This->flags & SFLAG_LOCKED)
return WINED3DERR_INVALIDCALL;
memset(&lock, 0, sizeof(lock)); /* To be sure */
@@ -287,7 +288,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
*pHDC = This->hDC;
TRACE("returning %p\n",*pHDC);
- This->Flags |= SFLAG_DCINUSE;
+ This->flags |= SFLAG_DCINUSE;
return WINED3D_OK;
}
@@ -297,7 +298,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
TRACE("(%p)->(%p)\n",This,hDC);
- if (!(This->Flags & SFLAG_DCINUSE))
+ if (!(This->flags & SFLAG_DCINUSE))
return WINEDDERR_NODC;
if (This->hDC !=hDC) {
@@ -308,7 +309,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_ReleaseDC(IWineD3DSurface *iface, HDC
/* we locked first, so unlock now */
IWineD3DSurface_Unmap(iface);
- This->Flags &= ~SFLAG_DCINUSE;
+ This->flags &= ~SFLAG_DCINUSE;
return WINED3D_OK;
}
@@ -322,7 +323,8 @@ static HRESULT WINAPI IWineGDISurfaceImpl_RealizePalette(IWineD3DSurface *iface)
if (!pal) return WINED3D_OK;
- if(This->Flags & SFLAG_DIBSECTION) {
+ if (This->flags & SFLAG_DIBSECTION)
+ {
TRACE("(%p): Updating the hdc's palette\n", This);
for (n=0; n<256; n++) {
col[n].rgbRed = pal->palents[n].peRed;
@@ -404,7 +406,8 @@ static HRESULT WINAPI IWineGDISurfaceImpl_SetMem(IWineD3DSurface *iface, void *M
return WINED3DERR_INVALIDCALL;
}
- if(This->Flags & (SFLAG_LOCKED | SFLAG_DCINUSE)) {
+ if (This->flags & (SFLAG_LOCKED | SFLAG_DCINUSE))
+ {
WARN("Surface is locked or the HDC is in use\n");
return WINED3DERR_INVALIDCALL;
}
@@ -413,7 +416,8 @@ static HRESULT WINAPI IWineGDISurfaceImpl_SetMem(IWineD3DSurface *iface, void *M
void *release = NULL;
/* Do I have to copy the old surface content? */
- if(This->Flags & SFLAG_DIBSECTION) {
+ if (This->flags & SFLAG_DIBSECTION)
+ {
/* Release the DC. No need to hold the critical section for the update
* Thread because this thread runs only on front buffers, but this method
* fails for render targets in the check above.
@@ -425,21 +429,23 @@ static HRESULT WINAPI IWineGDISurfaceImpl_SetMem(IWineD3DSurface *iface, void *M
This->dib.bitmap_data = NULL;
This->resource.allocatedMemory = NULL;
This->hDC = NULL;
- This->Flags &= ~SFLAG_DIBSECTION;
- } else if(!(This->Flags & SFLAG_USERPTR)) {
+ This->flags &= ~SFLAG_DIBSECTION;
+ }
+ else if(!(This->flags & SFLAG_USERPTR))
+ {
release = This->resource.allocatedMemory;
}
This->resource.allocatedMemory = Mem;
- This->Flags |= SFLAG_USERPTR | SFLAG_INSYSMEM;
+ This->flags |= SFLAG_USERPTR | SFLAG_INSYSMEM;
/* Now free the old memory if any */
HeapFree(GetProcessHeap(), 0, release);
}
- else if(This->Flags & SFLAG_USERPTR)
+ else if (This->flags & SFLAG_USERPTR)
{
/* Map() and GetDC() will re-create the dib section and allocated memory. */
This->resource.allocatedMemory = NULL;
- This->Flags &= ~SFLAG_USERPTR;
+ This->flags &= ~SFLAG_USERPTR;
}
return WINED3D_OK;
}
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index c0467db..a29eeb4 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -154,7 +154,7 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *
context2 = context_acquire(This->device, This->back_buffers[0]);
context_apply_blit_state(context2, device);
- if(backbuffer->Flags & SFLAG_NORMCOORD)
+ if (backbuffer->flags & SFLAG_NORMCOORD)
{
tex_left /= src_w;
tex_right /= src_w;
@@ -273,7 +273,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
cursor.pow2Width = cursor.currentDesc.Width;
cursor.pow2Height = cursor.currentDesc.Height;
/* The surface is in the texture */
- cursor.Flags |= SFLAG_INTEXTURE;
+ cursor.flags |= SFLAG_INTEXTURE;
/* DDBLT_KEYSRC will cause BltOverride to enable the alpha test with GL_NOTEQUAL, 0.0,
* which is exactly what we want :-)
*/
@@ -394,8 +394,8 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
WINED3DCLEAR_TARGET, 0xff00ffff, 1.0f, 0);
}
- if (!This->render_to_fbo && ((This->front_buffer->Flags & SFLAG_INSYSMEM)
- || (This->back_buffers[0]->Flags & SFLAG_INSYSMEM)))
+ if (!This->render_to_fbo && ((This->front_buffer->flags & SFLAG_INSYSMEM)
+ || (This->back_buffers[0]->flags & SFLAG_INSYSMEM)))
{
/* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying
* Doesn't work with render_to_fbo because we're not flipping
@@ -409,11 +409,10 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
/* Tell the front buffer surface that is has been modified. However,
* the other locations were preserved during that, so keep the flags.
- * This serves to update the emulated overlay, if any
- */
- fbflags = front->Flags;
+ * This serves to update the emulated overlay, if any. */
+ fbflags = front->flags;
surface_modify_location(front, SFLAG_INDRAWABLE, TRUE);
- front->Flags = fbflags;
+ front->flags = fbflags;
}
else
{
@@ -438,7 +437,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
if (This->device->depth_stencil)
{
if (This->presentParms.Flags & WINED3DPRESENTFLAG_DISCARD_DEPTHSTENCIL
- || This->device->depth_stencil->Flags & SFLAG_DISCARD)
+ || This->device->depth_stencil->flags & SFLAG_DISCARD)
{
surface_modify_ds_location(This->device->depth_stencil, SFLAG_DS_DISCARDED,
This->device->depth_stencil->currentDesc.Width,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index badd3bb..65d6959 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -2106,8 +2106,7 @@ struct IWineD3DSurfaceImpl
IWineD3DPaletteImpl *palette; /* D3D7 style palette handling */
PALETTEENTRY *palette9; /* D3D8/9 style palette handling */
- /* TODO: move this off into a management class(maybe!) */
- DWORD Flags;
+ DWORD flags;
UINT pow2Width;
UINT pow2Height;
--
1.7.2.2
More information about the wine-patches
mailing list