Commit 8dd6b237 authored by Sam Lantinga's avatar Sam Lantinga

Date: Wed, 15 Aug 2007 01:08:38 +0200

From: Couriersud
Subject: Some SDL1.3 patches

Modified UpdateTexture to lock and unlock DirectFB-Surface.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%402603
parent e00aa0f5
......@@ -505,27 +505,31 @@ DirectFB_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
DirectFB_RenderData *renderdata =
(DirectFB_RenderData *) renderer->driverdata;
if (data->pixels) {
DFBResult ret;
Uint8 *dpixels;
int dpitch;
Uint8 *src, *dst;
int row;
size_t length;
SDL_DFB_CHECKERR(data->surface->Lock(data->surface,
DSLF_WRITE | DSLF_READ, &dpixels,
&dpitch));
src = (Uint8 *) pixels;
dst =
(Uint8 *) data->pixels + rect->y * data->pitch +
(Uint8 *) dpixels + rect->y * dpitch +
rect->x * SDL_BYTESPERPIXEL(texture->format);
length = rect->w * SDL_BYTESPERPIXEL(texture->format);
for (row = 0; row < rect->h; ++row) {
SDL_memcpy(dst, src, length);
src += pitch;
dst += data->pitch;
}
} else {
SDL_SetError("FIXME: Update without lock!\n");
return -1;
dst += dpitch;
}
SDL_DFB_CHECKERR(data->surface->Unlock(data->surface) );
return 0;
error:
return 1;
}
static int
......
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