forked from Mirrors/wine-wine
wined3d: Use the wined3d_matrix structure for the identity matrix.
parent
e103a7a52d
commit
6b9018ccd2
|
@ -52,13 +52,13 @@ const struct wined3d_light WINED3D_default_light =
|
||||||
/**********************************************************
|
/**********************************************************
|
||||||
* Global variable / Constants follow
|
* Global variable / Constants follow
|
||||||
**********************************************************/
|
**********************************************************/
|
||||||
const float identity[] =
|
const struct wined3d_matrix identity =
|
||||||
{
|
{{{
|
||||||
1.0f, 0.0f, 0.0f, 0.0f,
|
1.0f, 0.0f, 0.0f, 0.0f,
|
||||||
0.0f, 1.0f, 0.0f, 0.0f,
|
0.0f, 1.0f, 0.0f, 0.0f,
|
||||||
0.0f, 0.0f, 1.0f, 0.0f,
|
0.0f, 0.0f, 1.0f, 0.0f,
|
||||||
0.0f, 0.0f, 0.0f, 1.0f,
|
0.0f, 0.0f, 0.0f, 1.0f,
|
||||||
}; /* When needed for comparisons */
|
}}}; /* When needed for comparisons */
|
||||||
|
|
||||||
/* Note that except for WINED3DPT_POINTLIST and WINED3DPT_LINELIST these
|
/* Note that except for WINED3DPT_POINTLIST and WINED3DPT_LINELIST these
|
||||||
* actually have the same values in GL and D3D. */
|
* actually have the same values in GL and D3D. */
|
||||||
|
@ -1832,7 +1832,7 @@ HRESULT CDECL wined3d_device_set_transform(struct wined3d_device *device,
|
||||||
* matrix. The Projection matrix stay projection matrix. */
|
* matrix. The Projection matrix stay projection matrix. */
|
||||||
|
|
||||||
if (d3dts == WINED3D_TS_VIEW)
|
if (d3dts == WINED3D_TS_VIEW)
|
||||||
device->view_ident = !memcmp(matrix, identity, 16 * sizeof(float));
|
device->view_ident = !memcmp(matrix, &identity, sizeof(identity));
|
||||||
|
|
||||||
if (d3dts < WINED3D_TS_WORLD_MATRIX(device->adapter->gl_info.limits.blends))
|
if (d3dts < WINED3D_TS_WORLD_MATRIX(device->adapter->gl_info.limits.blends))
|
||||||
device_invalidate_state(device, STATE_TRANSFORM(d3dts));
|
device_invalidate_state(device, STATE_TRANSFORM(d3dts));
|
||||||
|
|
|
@ -1108,11 +1108,11 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
|
||||||
memset(stateblock->changed.vertexShaderConstantsF, 0, device->d3d_vshader_constantF * sizeof(BOOL));
|
memset(stateblock->changed.vertexShaderConstantsF, 0, device->d3d_vshader_constantF * sizeof(BOOL));
|
||||||
|
|
||||||
/* Set some of the defaults for lights, transforms etc */
|
/* Set some of the defaults for lights, transforms etc */
|
||||||
memcpy(&state->transforms[WINED3D_TS_PROJECTION], identity, sizeof(identity));
|
memcpy(&state->transforms[WINED3D_TS_PROJECTION], &identity, sizeof(identity));
|
||||||
memcpy(&state->transforms[WINED3D_TS_VIEW], identity, sizeof(identity));
|
memcpy(&state->transforms[WINED3D_TS_VIEW], &identity, sizeof(identity));
|
||||||
for (i = 0; i < 256; ++i)
|
for (i = 0; i < 256; ++i)
|
||||||
{
|
{
|
||||||
memcpy(&state->transforms[WINED3D_TS_WORLD_MATRIX(i)], identity, sizeof(identity));
|
memcpy(&state->transforms[WINED3D_TS_WORLD_MATRIX(i)], &identity, sizeof(identity));
|
||||||
}
|
}
|
||||||
|
|
||||||
state->fb = &device->fb;
|
state->fb = &device->fb;
|
||||||
|
@ -1253,7 +1253,7 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
|
||||||
for (i = 0; i < MAX_TEXTURES; ++i)
|
for (i = 0; i < MAX_TEXTURES; ++i)
|
||||||
{
|
{
|
||||||
TRACE("Setting up default texture states for texture Stage %u.\n", i);
|
TRACE("Setting up default texture states for texture Stage %u.\n", i);
|
||||||
memcpy(&state->transforms[WINED3D_TS_TEXTURE0 + i], identity, sizeof(identity));
|
memcpy(&state->transforms[WINED3D_TS_TEXTURE0 + i], &identity, sizeof(identity));
|
||||||
state->texture_states[i][WINED3D_TSS_COLOR_OP] = i ? WINED3D_TOP_DISABLE : WINED3D_TOP_MODULATE;
|
state->texture_states[i][WINED3D_TSS_COLOR_OP] = i ? WINED3D_TOP_DISABLE : WINED3D_TOP_MODULATE;
|
||||||
state->texture_states[i][WINED3D_TSS_COLOR_ARG1] = WINED3DTA_TEXTURE;
|
state->texture_states[i][WINED3D_TSS_COLOR_ARG1] = WINED3DTA_TEXTURE;
|
||||||
state->texture_states[i][WINED3D_TSS_COLOR_ARG2] = WINED3DTA_CURRENT;
|
state->texture_states[i][WINED3D_TSS_COLOR_ARG2] = WINED3DTA_CURRENT;
|
||||||
|
|
|
@ -860,7 +860,7 @@ do {
|
||||||
debug_d3dformat(si->elements[name].format->id), si->elements[name].stream_idx); } while(0)
|
debug_d3dformat(si->elements[name].format->id), si->elements[name].stream_idx); } while(0)
|
||||||
|
|
||||||
/* Global variables */
|
/* Global variables */
|
||||||
extern const float identity[16] DECLSPEC_HIDDEN;
|
extern const struct wined3d_matrix identity DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
enum wined3d_ffp_idx
|
enum wined3d_ffp_idx
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue