- stupid typos fixes on software vertex shader operands

- CopyRects fix (problem in error paths) based on Carlos Lozano patch
This commit is contained in:
Raphael Junqueira 2003-11-11 00:43:51 +00:00 committed by Alexandre Julliard
parent b330df5665
commit 63c1093f24
2 changed files with 40 additions and 43 deletions

View File

@ -990,8 +990,8 @@ HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface,
dst->myDesc.Format = src->myDesc.Format; dst->myDesc.Format = src->myDesc.Format;
/* Convert container as well */ /* Convert container as well */
IDirect3DSurface8Impl_GetContainer((LPDIRECT3DSURFACE8) dst, &IID_IDirect3DBaseTexture8, (void**) &texture); /* FIXME: Which refid? */ rc = IDirect3DSurface8Impl_GetContainer((LPDIRECT3DSURFACE8) dst, &IID_IDirect3DBaseTexture8, (void**) &texture); /* FIXME: Which refid? */
if (texture != NULL) { if (SUCCEEDED(rc) && NULL != texture) {
((IDirect3DBaseTexture8Impl*) texture)->format = src->myDesc.Format; ((IDirect3DBaseTexture8Impl*) texture)->format = src->myDesc.Format;
/** Releasing texture after GetContainer */ /** Releasing texture after GetContainer */
IDirect3DBaseTexture8_Release(texture); IDirect3DBaseTexture8_Release(texture);
@ -1000,7 +1000,8 @@ HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface,
} }
/* Quick if complete copy ... */ /* Quick if complete copy ... */
if (rc == D3D_OK && cRects == 0 && pSourceRectsArray == NULL && pDestPointsArray == NULL) { if (SUCCEEDED(rc)) {
if (cRects == 0 && pSourceRectsArray == NULL && pDestPointsArray == NULL) {
if (src->myDesc.Width == dst->myDesc.Width && src->myDesc.Height == dst->myDesc.Height) { if (src->myDesc.Width == dst->myDesc.Width && src->myDesc.Height == dst->myDesc.Height) {
@ -1040,7 +1041,6 @@ HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface,
D3DLOCKED_RECT lrDst; D3DLOCKED_RECT lrDst;
RECT dest_rect; RECT dest_rect;
TRACE("Copying rect %d (%ld,%ld),(%ld,%ld) -> (%ld,%ld)\n", i, r->left, r->top, r->right, r->bottom, p->x, p->y); TRACE("Copying rect %d (%ld,%ld),(%ld,%ld) -> (%ld,%ld)\n", i, r->left, r->top, r->right, r->bottom, p->x, p->y);
if (src->myDesc.Format == D3DFMT_DXT1) { if (src->myDesc.Format == D3DFMT_DXT1) {
copyperline = ((r->right - r->left) * bytesPerPixel)/2; /* DXT1 is half byte per pixel */ copyperline = ((r->right - r->left) * bytesPerPixel)/2; /* DXT1 is half byte per pixel */
@ -1059,17 +1059,14 @@ HRESULT WINAPI IDirect3DDevice8Impl_CopyRects(LPDIRECT3DDEVICE8 iface,
for (j = 0; j < (r->bottom - r->top - 1); j++) { for (j = 0; j < (r->bottom - r->top - 1); j++) {
memcpy((char*) lrDst.pBits + (j * lrDst.Pitch), (char*) lrSrc.pBits + (j * lrSrc.Pitch), copyperline); memcpy((char*) lrDst.pBits + (j * lrDst.Pitch), (char*) lrSrc.pBits + (j * lrSrc.Pitch), copyperline);
} }
IDirect3DSurface8Impl_UnlockRect((LPDIRECT3DSURFACE8) src); IDirect3DSurface8Impl_UnlockRect((LPDIRECT3DSURFACE8) src);
rc = IDirect3DSurface8Impl_UnlockRect((LPDIRECT3DSURFACE8) dst); rc = IDirect3DSurface8Impl_UnlockRect((LPDIRECT3DSURFACE8) dst);
TRACE("Unlocked src and dst\n"); TRACE("Unlocked src and dst\n");
} }
} else { } else {
FIXME("Wanted to copy partial surfaces not implemented\n"); FIXME("Wanted to copy partial surfaces not implemented\n");
rc = D3DERR_INVALIDCALL; rc = D3DERR_INVALIDCALL;
}
} }
} }

View File

@ -306,7 +306,7 @@ void vshader_m4x3(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0, D3DMATRIX43 mat) {
void vshader_m3x4(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0, D3DMATRIX34 mat) { void vshader_m3x4(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0, D3DMATRIX34 mat) {
d->x = mat[0][0] * s0->x + mat[0][1] * s0->y + mat[0][2] * s0->z; d->x = mat[0][0] * s0->x + mat[0][1] * s0->y + mat[0][2] * s0->z;
d->y = mat[2][0] * s0->x + mat[1][1] * s0->y + mat[1][2] * s0->z; d->y = mat[1][0] * s0->x + mat[1][1] * s0->y + mat[1][2] * s0->z;
d->z = mat[2][0] * s0->x + mat[2][1] * s0->y + mat[2][2] * s0->z; d->z = mat[2][0] * s0->x + mat[2][1] * s0->y + mat[2][2] * s0->z;
d->w = mat[3][0] * s0->x + mat[3][1] * s0->y + mat[3][2] * s0->z; d->w = mat[3][0] * s0->x + mat[3][1] * s0->y + mat[3][2] * s0->z;
VSTRACE(("executing m3x4(1): mat=(%f, %f, %f) s0=(%f) d=(%f) \n", mat[0][0], mat[0][1], mat[0][2], s0->x, d->x)); VSTRACE(("executing m3x4(1): mat=(%f, %f, %f) s0=(%f) d=(%f) \n", mat[0][0], mat[0][1], mat[0][2], s0->x, d->x));
@ -316,8 +316,8 @@ void vshader_m3x4(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0, D3DMATRIX34 mat) {
} }
void vshader_m3x3(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0, D3DMATRIX33 mat) { void vshader_m3x3(D3DSHADERVECTOR* d, D3DSHADERVECTOR* s0, D3DMATRIX33 mat) {
d->x = mat[0][0] * s0->x + mat[0][1] * s0->y + mat[2][2] * s0->z; d->x = mat[0][0] * s0->x + mat[0][1] * s0->y + mat[0][2] * s0->z;
d->y = mat[1][0] * s0->x + mat[1][1] * s0->y + mat[2][2] * s0->z; d->y = mat[1][0] * s0->x + mat[1][1] * s0->y + mat[1][2] * s0->z;
d->z = mat[2][0] * s0->x + mat[2][1] * s0->y + mat[2][2] * s0->z; d->z = mat[2][0] * s0->x + mat[2][1] * s0->y + mat[2][2] * s0->z;
d->w = 1.0f; d->w = 1.0f;
VSTRACE(("executing m3x3(1): mat=(%f, %f, %f) s0=(%f) d=(%f) \n", mat[0][0], mat[0][1], mat[0][2], s0->x, d->x)); VSTRACE(("executing m3x3(1): mat=(%f, %f, %f) s0=(%f) d=(%f) \n", mat[0][0], mat[0][1], mat[0][2], s0->x, d->x));