Commit 1cfbc903 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Add some surface flags.

parent c7bb8bd4
......@@ -702,9 +702,14 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Wid
/* Internal data */
object->pow2Width = pow2Width;
object->pow2Height = pow2Height;
object->nonpow2 = (pow2Width != Width || pow2Height != Height) ? TRUE : FALSE;
object->discard = Discard;
object->activeLock = FALSE;
/* Flags */
object->Flags = 0; /* We start without flags set */
object->Flags |= (pow2Width != Width || pow2Height != Height) ? SFLAG_NONPOW2 : 0;
object->Flags |= Discard ? SFLAG_DISCARD : 0;
object->Flags |= (WINED3DFMT_D16_LOCKABLE == Format) ? SFLAG_LOCKABLE : 0;
object->Flags |= Lockable ? SFLAG_LOCKABLE : 0;
if (WINED3DFMT_UNKNOWN != Format) {
object->bytesPerPixel = D3DFmtGetBpp(This, Format);
......@@ -751,10 +756,6 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Wid
FIXME("Trying to create a render target that isn't in the default pool\n");
}
object->locked = FALSE;
object->lockable = (WINED3DFMT_D16_LOCKABLE == Format) ? TRUE : Lockable;
/* mark the texture as dirty so that it get's loaded first time around*/
IWineD3DSurface_AddDirtyRect(*ppSurface, NULL);
TRACE("(%p) : w(%d) h(%d) fmt(%d,%s) lockable(%d) surf@%p, surfmem@%p, %d bytes\n",
......
......@@ -836,7 +836,7 @@ struct IWineD3DSurfaceImpl
UINT bytesPerPixel;
/* TODO: move this off into a management class(maybe!) */
BOOL nonpow2;
WORD Flags;
UINT pow2Width;
UINT pow2Height;
......@@ -848,23 +848,48 @@ struct IWineD3DSurfaceImpl
float pow2scalingFactorY; /* = (Height / pow2Height) */
#endif
BOOL lockable;
BOOL discard;
BOOL locked;
BOOL activeLock;
RECT lockedRect;
RECT dirtyRect;
BOOL Dirty;
BOOL inTexture;
BOOL inPBuffer;
glDescriptor glDescription;
};
extern const IWineD3DSurfaceVtbl IWineD3DSurface_Vtbl;
/* Surface flags: */
#define SFLAG_OVERSIZE 0x0001 /* Surface is bigger than gl size, blts only */
#define SFLAG_CONVERTED 0x0002 /* Converted for color keying or Palettized */
#define SFLAG_DIBSECTION 0x0004 /* Has a DIB section attached for getdc */
#define SFLAG_DIRTY 0x0008 /* Surface was locked by the app */
#define SFLAG_LOCKABLE 0x0010 /* Surface can be locked */
#define SFLAG_DISCARD 0x0020 /* ??? */
#define SFLAG_LOCKED 0x0040 /* Surface is locked atm */
#define SFLAG_ACTIVELOCK 0x0080 /* Not locked, but surface memory is needed */
#define SFLAG_INTEXTURE 0x0100 /* ??? */
#define SFLAG_INPBUFFER 0x0200 /* ??? */
#define SFLAG_NONPOW2 0x0400 /* Surface sizes are not a power of 2 */
#define SFLAG_DYNLOCK 0x0800 /* Surface is often locked by the app */
#define SFLAG_DYNCHANGE 0x1800 /* Surface contents are changed very often, implies DYNLOCK */
/* In some conditions the surface memory must not be freed:
* SFLAG_OVERSIZE: Not all data can be kept in GL
* SFLAG_CONVERTED: Converting the data back would take too long
* SFLAG_DIBSECTION: The dib code manages the memory
* SFLAG_DIRTY: GL surface isn't up to date
* SFLAG_LOCKED: The app requires access to the surface data
* SFLAG_ACTIVELOCK: Some wined3d code needs the memory
* SFLAG_DYNLOCK: Avoid freeing the data for performance
* SFLAG_DYNCHANGE: Same reason as DYNLOCK
*/
#define SFLAG_DONOTFREE (SFLAG_OVERSIZE | \
SFLAG_CONVERTED | \
SFLAG_DIBSECTION | \
SFLAG_DIRTY | \
SFLAG_LOCKED | \
SFLAG_ACTIVELOCK | \
SFLAG_DYNLOCK | \
SFLAG_DYNCHANGE )
/*****************************************************************************
* IWineD3DVertexDeclaration implementation structure
*/
......
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