Mail Archives: djgpp/2000/01/05/14:55:39
The reason you are delaying is to make it visible?
in that case make a mouse_move function...
read_mouse();
if cur_mouse_loc is != to old_mouse_ loc then
move_mouse();
move_mouse() {
erase_old_mouse();
get_back_ground_for_new_location();
draw_new_mouse();
old_mouse_loc = cur_mouse_loc;
}
//No delay needed, and no additional code needed.
Something like that should have the desired effect, the only problem is that
changes behind the mouse after it's background has been copied will mess it
up.. Your choices are to erase the mouse before drawing info in that area,
or go to a "windowed' system that can actively draw the area behind the
mouse at any time..
The first suggestion is the easiest..
Charles.
--
Charles Wood
REMOVEMEc DOT r DOT wood AT worldnet DOT att DOT net
hellbaron wrote in message <210046ed DOT e1267171 AT usw-ex0101-007 DOT remarq DOT com>...
>I've been working on a big graphix project all week, everything is
>going ok, exept for this mouse function. The thing is, I would like to
>save some valuable time when executing this function by eliminating the
>delay(50), but I just cant seem to be able to substitute it with
>anything else, I tried with a simple if, but it just doesnt work..
>Please help me out!!, any feedback will be greatly apriciated, thanx in
>advance to anyone who replies to this message, and here is the function:
>
>void PlotMouse()
>{
>int x, y, px, py, ox, oy;
>char back[16][16];
>
>ReadMouse();
>ox = MouseX;
>oy = MouseY;
>
>for (x=MouseX, px=0; x<MouseX+16; x++, px++)
> for (y=MouseY, py=0; y<MouseY+16; y++, py++)
> {
> back[px][py] = getpixel(x,y);
> if (cursor[(py*16)+px] != 0)
> putpixel(x, y, (cursor[(py*16)+px]));
> }
>
>delay(50);
>//ReadMouse();
>//if ((ox != MouseX) || (oy != MouseY))
>for (x=ox, px=0; x<ox+16; x++, px++)
> for (y=oy, py=0; y<oy+16; y++, py++)
> putpixel(x, y, back[px][py]);
>}
>
>
>
>* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
*
>The fastest and easiest way to search and participate in Usenet - Free!
>
- Raw text -