[Pkg-wmaker-commits] [wmbubble] 72/207: Figured out what they were doing to bubblemon_update to deallocate bubbles and updated the comment to explain.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Mon Aug 24 04:18:05 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmbubble.
commit 60a28fe025a6f8bd3b0b53958c88b5551f23f6d8
Author: Robert Jacobs <rnjacobs at mit.edu>
Date: Tue Aug 16 00:40:07 2011 -0700
Figured out what they were doing to bubblemon_update to deallocate
bubbles and updated the comment to explain.
---
bubblemon.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/bubblemon.c b/bubblemon.c
index f11b4d8..02c84a2 100644
--- a/bubblemon.c
+++ b/bubblemon.c
@@ -746,15 +746,16 @@ void bubblemon_update(int loadPercentage) {
i, bubbles[i].x, i, bubbles[i].y);
#endif
- /* Yes; nuke it */
+ /* Yes; nuke it by replacing its properties with those
+ of the last one and deallocate the last one. */
bubbles[i].x = bubbles[bm.n_bubbles - 1].x;
bubbles[i].y = bubbles[bm.n_bubbles - 1].y;
bubbles[i].dy = bubbles[bm.n_bubbles - 1].dy;
- bm.n_bubbles--; /* XXX this can't be right */
+ bm.n_bubbles--;
/*
- We must check the previously last bubble, which is
- now the current bubble, also.
+ We must still check what was the next bubble which is
+ now the current bubble.
*/
i--;
continue;
@@ -770,16 +771,11 @@ void bubblemon_update(int loadPercentage) {
bm.waterlevels[bubbles[i].x + 1] += bm.ripples_int;
}
- /* Yes; nuke it */
bubbles[i].x = bubbles[bm.n_bubbles - 1].x;
bubbles[i].y = bubbles[bm.n_bubbles - 1].y;
bubbles[i].dy = bubbles[bm.n_bubbles - 1].dy;
bm.n_bubbles--;
- /*
- We must check the previously last bubble, which is
- now the current bubble, also.
- */
i--;
continue;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbubble.git
More information about the Pkg-wmaker-commits
mailing list