Morten Eriksen (mortene++at++pvv.unit.no)
Fri, 12 Apr 1996 15:20:24 +0200 (MET DST)
I've got an image which should behave as a "sprite" cursor in the
overlay planes. This works OK with the code below, but the cursor
"flashes" a lot - like gfx usually do when you try to update on wrong
rasterpositions or updates are too slow.
At first I thought the image I'm drawing (with rectwrite) was too big,
but the same problem occurs even when it's just 16x16 pixels. I'm
running this on an Onyx with RE2 gfx and 4 PUs, so I guess there's
enough horsepower present..
The problem also occurs regardless of if I'm running in SP- or
MP-mode.
Here's the code I use to visualize it (it gets called during
PostDraw):
[SNIP]
// Remember coordinates over invocations.
static long xstart = 0;
static long xstop = 0;
static long ystart = 0;
static long ystop = 0;
// Erase old image.
rectwrite(xstart, ystart, xstop, ystop, sharedmem->marker.store);
// Draw some simple stuff here (max 9 pixels each frame).
for(i = 0; i < sharedmem->replaycoordcounter; i++) {
x = sharedmem->replaycoords[i][0] * sharedmem->mouse.winSizeX;
y = sharedmem->replaycoords[i][1] * sharedmem->mouse.winSizeY;
rectwrite(x-1, y-1, x+1, y+1, trace);
}
// Calculate new position for cursor.
xstart = x - sharedmem->marker.xspot;
ystart = y - sharedmem->marker.yspot;
xstop = xstart + sharedmem->marker.width - 1;
ystop = ystart + sharedmem->marker.height - 1;
// Put underlying gfx in store buffer.
rectread(xstart, ystart, xstop, ystop, sharedmem->marker.store);
// Write cursor image.
rectwrite(xstart, ystart, xstop, ystop, sharedmem->marker.bitmap);
[SNIP]
I assume my problem is due to sloppy timing - that 'PostDraw' is not a
good time to draw this stuff..? I'd be grateful for any input on this.
Regards,
Morten Eriksen
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:42 PDT