On Fri, 2004-11-26 at 17:31, Bill Kendrick wrote:
> On Fri, Nov 26, 2004 at 11:24:37AM -0500, Albert Cahalan wrote:

> > I'd like to have the stamp controls set up a bitmap for
> > the stamp outline renderer. I need to know if I must use
> > an SDL surface with locking, or if I can use something
> > simpler and faster.
> 
> If what you do interrupts the event loop (as most things do, like saving,
> loading, etc.), then if I understand things right (which I admittedly may
> not ;^) ), you can probably do it your 'faster' way.
> 
> Though I'm curious, what would that be?
> 
> 
> Also, you don't happen to be considering alpha-blended stamps under the
> mouse before placement...? :)

I didn't think of that. It has a bit of a downside though.
The outline might be easier to see. I did think of filling
in the outline though.

I was just preparing to cache the stamp outline. When the
stamp changes (new choice, flip, mirror, or scaling), the
outline needs to be recomputed. There's no need to be
computing it every time the mouse moves a tiny bit.

The code in CVS is prepared for this now. Notice that
update_stamp_xor has been split out of stamp_xor. Now
there are two reasonable options:

a. check for stamp changes in update_stamp_xor, and
   return early (without computation) if no changes

b. move the update_stamp_xor call from stamp_xor to
   the code (flip button, etc.) that causes the stamp
   outline to need replacement

If this works out well, maybe the low-quality stamp
outline code will be pointless to keep.

BTW, there's a bit of a problem with flicker. I suppose
the solution might involve a canvas-sized bitmap for the
outline. Then there would never be a need to clear the
old outline prior to painting the new one; the clearing
and painting would take place in one operation.


_______________________________________________
Tuxpaint-dev mailing list
[EMAIL PROTECTED]
http://tux4kids.net/mailman/listinfo/tuxpaint-dev

Reply via email to