Commit 027fdb31 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Rename the IWineD3DSurfaceImpl "Flags" field to "flags".

parent a59ee29d
......@@ -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(&current_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;
......
......@@ -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(&current_rect, 0, 0,
This->depth_stencil->ds_current_size.cx,
This->depth_stencil->ds_current_size.cy);
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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,
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment