mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
wined3d: Move volume booleans into a flags field.
This commit is contained in:
parent
6e4e1ad392
commit
7e7ee52486
@ -49,7 +49,6 @@ static void volume_bind_and_dirtify(const struct wined3d_volume *volume, struct
|
|||||||
|
|
||||||
void volume_add_dirty_box(struct wined3d_volume *volume, const struct wined3d_box *dirty_box)
|
void volume_add_dirty_box(struct wined3d_volume *volume, const struct wined3d_box *dirty_box)
|
||||||
{
|
{
|
||||||
volume->dirty = TRUE;
|
|
||||||
if (dirty_box)
|
if (dirty_box)
|
||||||
{
|
{
|
||||||
volume->lockedBox.left = min(volume->lockedBox.left, dirty_box->left);
|
volume->lockedBox.left = min(volume->lockedBox.left, dirty_box->left);
|
||||||
@ -233,7 +232,7 @@ HRESULT CDECL wined3d_volume_map(struct wined3d_volume *volume,
|
|||||||
wined3d_texture_set_dirty(volume->container, TRUE);
|
wined3d_texture_set_dirty(volume->container, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
volume->locked = TRUE;
|
volume->flags |= WINED3D_VFLAG_LOCKED;
|
||||||
|
|
||||||
TRACE("Returning memory %p, row pitch %d, slice pitch %d.\n",
|
TRACE("Returning memory %p, row pitch %d, slice pitch %d.\n",
|
||||||
map_desc->data, map_desc->row_pitch, map_desc->slice_pitch);
|
map_desc->data, map_desc->row_pitch, map_desc->slice_pitch);
|
||||||
@ -250,13 +249,13 @@ HRESULT CDECL wined3d_volume_unmap(struct wined3d_volume *volume)
|
|||||||
{
|
{
|
||||||
TRACE("volume %p.\n", volume);
|
TRACE("volume %p.\n", volume);
|
||||||
|
|
||||||
if (!volume->locked)
|
if (!(volume->flags & WINED3D_VFLAG_LOCKED))
|
||||||
{
|
{
|
||||||
WARN("Trying to unlock unlocked volume %p.\n", volume);
|
WARN("Trying to unlock unlocked volume %p.\n", volume);
|
||||||
return WINED3DERR_INVALIDCALL;
|
return WINED3DERR_INVALIDCALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
volume->locked = FALSE;
|
volume->flags &= ~WINED3D_VFLAG_LOCKED;
|
||||||
memset(&volume->lockedBox, 0, sizeof(volume->lockedBox));
|
memset(&volume->lockedBox, 0, sizeof(volume->lockedBox));
|
||||||
|
|
||||||
return WINED3D_OK;
|
return WINED3D_OK;
|
||||||
@ -293,10 +292,7 @@ static HRESULT volume_init(struct wined3d_volume *volume, struct wined3d_device
|
|||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
volume->lockable = TRUE;
|
|
||||||
volume->locked = FALSE;
|
|
||||||
memset(&volume->lockedBox, 0, sizeof(volume->lockedBox));
|
memset(&volume->lockedBox, 0, sizeof(volume->lockedBox));
|
||||||
volume->dirty = TRUE;
|
|
||||||
|
|
||||||
volume_add_dirty_box(volume, NULL);
|
volume_add_dirty_box(volume, NULL);
|
||||||
|
|
||||||
|
@ -2050,15 +2050,17 @@ void wined3d_texture_apply_state_changes(struct wined3d_texture *texture,
|
|||||||
const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
|
const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
|
||||||
void wined3d_texture_set_dirty(struct wined3d_texture *texture, BOOL dirty) DECLSPEC_HIDDEN;
|
void wined3d_texture_set_dirty(struct wined3d_texture *texture, BOOL dirty) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
#define WINED3D_VFLAG_LOCKED 0x00000001
|
||||||
|
|
||||||
struct wined3d_volume
|
struct wined3d_volume
|
||||||
{
|
{
|
||||||
struct wined3d_resource resource;
|
struct wined3d_resource resource;
|
||||||
struct wined3d_texture *container;
|
struct wined3d_texture *container;
|
||||||
BOOL lockable;
|
|
||||||
BOOL locked;
|
|
||||||
struct wined3d_box lockedBox;
|
struct wined3d_box lockedBox;
|
||||||
struct wined3d_box dirtyBox;
|
struct wined3d_box dirtyBox;
|
||||||
BOOL dirty;
|
|
||||||
|
DWORD flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource)
|
static inline struct wined3d_volume *volume_from_resource(struct wined3d_resource *resource)
|
||||||
|
Loading…
Reference in New Issue
Block a user