# HG changeset patch # User Sam Lantinga # Date 1229882102 0 # Node ID 83c3a4b0e42186b0d869324fb6c0441e9f4387b7 # Parent 133601e3b2552d1f23ca5da2d0b8ac3bdb4c6576 Fixed crash in testdraw2, added more points diff -r 133601e3b255 -r 83c3a4b0e421 test/testdraw2.c --- a/test/testdraw2.c Sun Dec 21 17:39:41 2008 +0000 +++ b/test/testdraw2.c Sun Dec 21 17:55:02 2008 +0000 @@ -29,7 +29,7 @@ SDL_GetWindowSize(window, &window_w, &window_h); SDL_SetRenderDrawBlendMode(blendMode); - for (i = 0; i < num_objects; ++i) { + for (i = 0; i < num_objects * 4; ++i) { /* Cycle the color and alpha, if desired */ if (cycle_color) { current_color += cycle_direction; @@ -102,10 +102,10 @@ (Uint8) current_color, (Uint8) current_alpha); if (i == 0) { - SDL_RenderLine(0, 0, window_w, window_h); - SDL_RenderLine(0, window_h, window_w, 0); - SDL_RenderLine(0, window_h / 2, window_w, window_h / 2); - SDL_RenderLine(window_w / 2, 0, window_w / 2, window_h); + SDL_RenderLine(0, 0, window_w - 1, window_h - 1); + SDL_RenderLine(0, window_h - 1, window_w - 1, 0); + SDL_RenderLine(0, window_h / 2, window_w - 1, window_h / 2); + SDL_RenderLine(window_w / 2, 0, window_w / 2, window_h - 1); } else { x1 = rand() % window_w; x2 = rand() % window_w; @@ -128,7 +128,7 @@ SDL_GetWindowSize(window, &window_w, &window_h); SDL_SetRenderDrawBlendMode(blendMode); - for (i = 0; i < num_objects/4; ++i) { + for (i = 0; i < num_objects / 4; ++i) { /* Cycle the color and alpha, if desired */ if (cycle_color) { current_color += cycle_direction;