Add post-calibration delay, and fix cross-line bug that Anthony Towns and Val Henson...
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 4 Feb 2008 06:38:30 +0000 (17:38 +1100)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 4 Feb 2008 06:38:30 +0000 (17:38 +1100)
prpong.c

index da584f99ef92560d229ec2d462da50dbcdc89f9e..660fc8ae8a60402800f2664301aedb9a2df23cca 100644 (file)
--- a/prpong.c
+++ b/prpong.c
@@ -716,6 +716,8 @@ static void calibrate(SDL_Surface *screen,
        SDL_UpdateRect(screen, 0, 0, 0, 0);
        SDL_FreeSurface(img);
 
+       SDL_Delay(500);
+
        /* Must see it for a full half second. */
        while (count < 20) {
                SDL_Event event;
@@ -1283,7 +1285,7 @@ int main(int argc, char *argv[])
                        if (!same_side(&ball, state.ir_src[i].pos[0]))
                                continue;
                        if (!ir->valid || state.ir_src[i].size > ir->size)
-                               ir = &state.ir_src[0];
+                               ir = &state.ir_src[i];
                }
 
                if (ir->valid) {