wined3d: Get rid of the WINED3DSTATEBLOCKTYPE typedef.

This commit is contained in:
Henri Verbeet 2012-01-17 21:13:39 +01:00 committed by Alexandre Julliard
parent ae2e5d65ff
commit ed417a6f13
7 changed files with 25 additions and 26 deletions

View File

@ -1622,7 +1622,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateStateBlock(IDirect3DDevice8 *if
} }
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_stateblock_create(This->wined3d_device, (WINED3DSTATEBLOCKTYPE)Type, &stateblock); hr = wined3d_stateblock_create(This->wined3d_device, (enum wined3d_stateblock_type)Type, &stateblock);
if (FAILED(hr)) if (FAILED(hr))
{ {
wined3d_mutex_unlock(); wined3d_mutex_unlock();

View File

@ -150,7 +150,7 @@ HRESULT stateblock_init(IDirect3DStateBlock9Impl *stateblock, IDirect3DDevice9Im
{ {
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_stateblock_create(device->wined3d_device, hr = wined3d_stateblock_create(device->wined3d_device,
(WINED3DSTATEBLOCKTYPE)type, &stateblock->wined3d_stateblock); (enum wined3d_stateblock_type)type, &stateblock->wined3d_stateblock);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
if (FAILED(hr)) if (FAILED(hr))
{ {

View File

@ -922,7 +922,7 @@ static HRESULT WINAPI ddraw7_SetCooperativeLevel(IDirectDraw7 *iface, HWND hwnd,
{ {
restore_state = TRUE; restore_state = TRUE;
if (FAILED(hr = wined3d_stateblock_create(This->wined3d_device, WINED3DSBT_ALL, &stateblock))) if (FAILED(hr = wined3d_stateblock_create(This->wined3d_device, WINED3D_SBT_ALL, &stateblock)))
{ {
ERR("Failed to create stateblock, hr %#x.\n", hr); ERR("Failed to create stateblock, hr %#x.\n", hr);
wined3d_mutex_unlock(); wined3d_mutex_unlock();

View File

@ -3915,7 +3915,7 @@ HRESULT CDECL wined3d_device_begin_stateblock(struct wined3d_device *device)
if (device->isRecordingState) if (device->isRecordingState)
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
hr = wined3d_stateblock_create(device, WINED3DSBT_RECORDED, &stateblock); hr = wined3d_stateblock_create(device, WINED3D_SBT_RECORDED, &stateblock);
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
@ -5609,7 +5609,7 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device,
} }
/* Note: No parent needed for initial internal stateblock */ /* Note: No parent needed for initial internal stateblock */
hr = wined3d_stateblock_create(device, WINED3DSBT_INIT, &device->stateBlock); hr = wined3d_stateblock_create(device, WINED3D_SBT_INIT, &device->stateBlock);
if (FAILED(hr)) if (FAILED(hr))
ERR("Resetting the stateblock failed with error %#x.\n", hr); ERR("Resetting the stateblock failed with error %#x.\n", hr);
else else
@ -5902,7 +5902,7 @@ HRESULT device_init(struct wined3d_device *device, struct wined3d *wined3d,
} }
device->blitter = adapter->blitter; device->blitter = adapter->blitter;
hr = wined3d_stateblock_create(device, WINED3DSBT_INIT, &device->stateBlock); hr = wined3d_stateblock_create(device, WINED3D_SBT_INIT, &device->stateBlock);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to create stateblock.\n"); WARN("Failed to create stateblock.\n");

View File

@ -924,8 +924,8 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
unsigned int i; unsigned int i;
DWORD map; DWORD map;
TRACE("Applying stateblock %p to device %p.\n", stateblock, device); TRACE("Applying stateblock %p of type %#x to device %p.\n",
TRACE("Blocktype: %#x.\n", stateblock->blockType); stateblock, stateblock->blockType, device);
if (stateblock->changed.vertexShader) if (stateblock->changed.vertexShader)
wined3d_device_set_vertex_shader(device, stateblock->state.vertex_shader); wined3d_device_set_vertex_shader(device, stateblock->state.vertex_shader);
@ -1105,7 +1105,7 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
TRACE("stateblock %p.\n", stateblock); TRACE("stateblock %p.\n", stateblock);
stateblock->blockType = WINED3DSBT_INIT; stateblock->blockType = WINED3D_SBT_INIT;
memset(stateblock->changed.pixelShaderConstantsF, 0, device->d3d_pshader_constantF * sizeof(BOOL)); memset(stateblock->changed.pixelShaderConstantsF, 0, device->d3d_pshader_constantF * sizeof(BOOL));
memset(stateblock->changed.vertexShaderConstantsF, 0, device->d3d_vshader_constantF * sizeof(BOOL)); memset(stateblock->changed.vertexShaderConstantsF, 0, device->d3d_vshader_constantF * sizeof(BOOL));
@ -1337,7 +1337,7 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
} }
static HRESULT stateblock_init(struct wined3d_stateblock *stateblock, static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
struct wined3d_device *device, WINED3DSTATEBLOCKTYPE type) struct wined3d_device *device, enum wined3d_stateblock_type type)
{ {
unsigned int i; unsigned int i;
HRESULT hr; HRESULT hr;
@ -1354,26 +1354,26 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
hr = stateblock_allocate_shader_constants(stateblock); hr = stateblock_allocate_shader_constants(stateblock);
if (FAILED(hr)) return hr; if (FAILED(hr)) return hr;
/* The WINED3DSBT_INIT stateblock type is used during initialization to /* The WINED3D_SBT_INIT stateblock type is used during initialization to
* produce a placeholder stateblock so other functions called can update a * produce a placeholder stateblock so other functions called can update a
* state block. */ * state block. */
if (type == WINED3DSBT_INIT || type == WINED3DSBT_RECORDED) return WINED3D_OK; if (type == WINED3D_SBT_INIT || type == WINED3D_SBT_RECORDED) return WINED3D_OK;
TRACE("Updating changed flags appropriate for type %#x.\n", type); TRACE("Updating changed flags appropriate for type %#x.\n", type);
switch (type) switch (type)
{ {
case WINED3DSBT_ALL: case WINED3D_SBT_ALL:
stateblock_init_lights(stateblock, device->stateBlock->state.light_map); stateblock_init_lights(stateblock, device->stateBlock->state.light_map);
stateblock_savedstates_set_all(&stateblock->changed, device->d3d_vshader_constantF, stateblock_savedstates_set_all(&stateblock->changed, device->d3d_vshader_constantF,
device->d3d_pshader_constantF); device->d3d_pshader_constantF);
break; break;
case WINED3DSBT_PIXELSTATE: case WINED3D_SBT_PIXEL_STATE:
stateblock_savedstates_set_pixel(&stateblock->changed, device->d3d_pshader_constantF); stateblock_savedstates_set_pixel(&stateblock->changed, device->d3d_pshader_constantF);
break; break;
case WINED3DSBT_VERTEXSTATE: case WINED3D_SBT_VERTEX_STATE:
stateblock_init_lights(stateblock, device->stateBlock->state.light_map); stateblock_init_lights(stateblock, device->stateBlock->state.light_map);
stateblock_savedstates_set_vertex(&stateblock->changed, device->d3d_vshader_constantF); stateblock_savedstates_set_vertex(&stateblock->changed, device->d3d_vshader_constantF);
break; break;
@ -1390,7 +1390,7 @@ static HRESULT stateblock_init(struct wined3d_stateblock *stateblock,
} }
HRESULT CDECL wined3d_stateblock_create(struct wined3d_device *device, HRESULT CDECL wined3d_stateblock_create(struct wined3d_device *device,
WINED3DSTATEBLOCKTYPE type, struct wined3d_stateblock **stateblock) enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock)
{ {
struct wined3d_stateblock *object; struct wined3d_stateblock *object;
HRESULT hr; HRESULT hr;

View File

@ -2310,7 +2310,7 @@ struct wined3d_stateblock
{ {
LONG ref; /* Note: Ref counting not required */ LONG ref; /* Note: Ref counting not required */
struct wined3d_device *device; struct wined3d_device *device;
WINED3DSTATEBLOCKTYPE blockType; enum wined3d_stateblock_type blockType;
/* Array indicating whether things have been set or changed */ /* Array indicating whether things have been set or changed */
struct wined3d_saved_states changed; struct wined3d_saved_states changed;

View File

@ -710,15 +710,14 @@ enum wined3d_query_type
#define WINED3DISSUE_END (1 << 0) #define WINED3DISSUE_END (1 << 0)
#define WINED3DGETDATA_FLUSH (1 << 0) #define WINED3DGETDATA_FLUSH (1 << 0)
typedef enum _WINED3DSTATEBLOCKTYPE enum wined3d_stateblock_type
{ {
WINED3DSBT_INIT = 0, WINED3D_SBT_INIT = 0,
WINED3DSBT_ALL = 1, WINED3D_SBT_ALL = 1,
WINED3DSBT_PIXELSTATE = 2, WINED3D_SBT_PIXEL_STATE = 2,
WINED3DSBT_VERTEXSTATE = 3, WINED3D_SBT_VERTEX_STATE = 3,
WINED3DSBT_RECORDED = 4, /* WineD3D private */ WINED3D_SBT_RECORDED = 4, /* WineD3D private */
WINED3DSBT_FORCE_DWORD = 0xffffffff };
} WINED3DSTATEBLOCKTYPE;
typedef enum _WINED3DDECLMETHOD typedef enum _WINED3DDECLMETHOD
{ {
@ -2292,7 +2291,7 @@ HRESULT __cdecl wined3d_shader_set_local_constants_float(struct wined3d_shader *
HRESULT __cdecl wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock); HRESULT __cdecl wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock);
HRESULT __cdecl wined3d_stateblock_capture(struct wined3d_stateblock *stateblock); HRESULT __cdecl wined3d_stateblock_capture(struct wined3d_stateblock *stateblock);
HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device, HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device,
WINED3DSTATEBLOCKTYPE type, struct wined3d_stateblock **stateblock); enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock);
ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock); ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock);
ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock); ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock);