Mail Archives: djgpp/1996/06/21/13:55:49
In article <31C97079 DOT 5CD3 AT tower DOT york DOT ac DOT uk>
jrm101 AT tower DOT york DOT ac DOT uk "Jonathan Markland" writes:
> [stuff snipped]
>
> Observing the butchered version of the code reveals something a bit
> suspicious. I guess that Shawn offered the solution in a moment of haste.
> I know, it happens to me too! ;)
>
> Try this instead:
>
> > > while (!mouse_b) {
> > > x = mouse_x; <----- I've changed this
> > > if (x + bmp->w > graphic->w)
> > > x = (graphic->w - bmp->w) & 0xFFF0; <--- [See below]
> > > if (x < 0)
> > > x = 0;
> > > y = mouse_y; <----- I've changed this too
>
> Also, I think the line that I have indicated may also need the "& 0xFFF0"
> removing?
Well, it was in fact just changing the last '0' to F. That worked.
>
> This would explain why the grabbing box never moves, as the variables X and Y
> are
> never updated (they probably get fixed at zero)!
I can't believe I missed that. 'x' never gets set!! Hehehe... sounds like the
sort of bug that comes up in my programs... Y'know, really silly things :)
--
Cheers,
Ben -=Look for "Moo-Juice" on the IRC=-
---------------------====### legal notice ###====--------------------------
Microsoft Network is prohibited from redistributing this work in any
form,in whole or in part. License to distribute this post is available to
Microsoft for $499. Posting without permission constitutes an agreement to
these terms.
- Raw text -