[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Merge: rect optimisation
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Merge: rect optimisation
- From: Sam Bull <sam.hacking@xxxxxxxx>
- Date: Wed, 17 Oct 2012 15:06:57 +0100
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Wed, 17 Oct 2012 10:07:09 -0400
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sent.com; h= message-id:subject:from:to:date:content-type:mime-version; s= mesmtp; bh=PKH8mVmGogXEabH09naku3dboL8=; b=AQujT7kZG2fqyVMfx4MMO NhLFKsbwD/21yzsfpjQ2sZhsP3KYPuwZeu8zd5X4iK5RLJqfDy6UXjj1aORZxmNd Rl54jiNGXNWoPHevJpjxVL/oL4TXDJy/oqQ0/nQidA0O/qX56FkFxv+UgALDvnGz +tmlQUxw9bEsPNjShevNjM=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:subject:from:to:date :content-type:mime-version; s=smtpout; bh=PKH8mVmGogXEabH09naku3 dboL8=; b=DlqI1wUIAk5DcvDNOwEKI8UDYQIt/43hW97T4puzKFmpFr8WqOE7GZ m1voH59OatgLSg5e42KTdO/tmksCpvplBEHztcPcQEtMLyLllSx81hXINNTJKcGA AsFjiLdDkf+H4pnOZJkre+J6eL8oclx34vKVLanAjQ0p0CwFdPds4=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Can somebody check the code I've proposed for a merge, I believe it is a
more efficient method for checking rect intersection:
https://bitbucket.org/pygame/pygame/pull-request/11/optimise-rect-intersection/diff
The theory is that if (A.topleft < B.bottomright and A.bottomright >
B.topleft) then they must be overlapping. This needs about half the
tests from the current version.
I also wasn't sure where to put "<=" instead of "<" to ensure perfect
backwards compatibility, so it would be great if anybody could point
that out too.
Thanks,
Sam Bull
Attachment:
signature.asc
Description: This is a digitally signed message part