Commit 5a7c477e authored by Sam Lantinga's avatar Sam Lantinga

Fixed crash in testdraw2, added more points

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403364
parent f055f6a1
...@@ -29,7 +29,7 @@ DrawPoints(SDL_WindowID window) ...@@ -29,7 +29,7 @@ DrawPoints(SDL_WindowID window)
SDL_GetWindowSize(window, &window_w, &window_h); SDL_GetWindowSize(window, &window_w, &window_h);
SDL_SetRenderDrawBlendMode(blendMode); 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 */ /* Cycle the color and alpha, if desired */
if (cycle_color) { if (cycle_color) {
current_color += cycle_direction; current_color += cycle_direction;
...@@ -102,10 +102,10 @@ DrawLines(SDL_WindowID window) ...@@ -102,10 +102,10 @@ DrawLines(SDL_WindowID window)
(Uint8) current_color, (Uint8) current_alpha); (Uint8) current_color, (Uint8) current_alpha);
if (i == 0) { if (i == 0) {
SDL_RenderLine(0, 0, window_w, window_h); SDL_RenderLine(0, 0, window_w - 1, window_h - 1);
SDL_RenderLine(0, window_h, window_w, 0); SDL_RenderLine(0, window_h - 1, window_w - 1, 0);
SDL_RenderLine(0, window_h / 2, window_w, window_h / 2); SDL_RenderLine(0, window_h / 2, window_w - 1, window_h / 2);
SDL_RenderLine(window_w / 2, 0, window_w / 2, window_h); SDL_RenderLine(window_w / 2, 0, window_w / 2, window_h - 1);
} else { } else {
x1 = rand() % window_w; x1 = rand() % window_w;
x2 = rand() % window_w; x2 = rand() % window_w;
...@@ -128,7 +128,7 @@ DrawRects(SDL_WindowID window) ...@@ -128,7 +128,7 @@ DrawRects(SDL_WindowID window)
SDL_GetWindowSize(window, &window_w, &window_h); SDL_GetWindowSize(window, &window_w, &window_h);
SDL_SetRenderDrawBlendMode(blendMode); 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 */ /* Cycle the color and alpha, if desired */
if (cycle_color) { if (cycle_color) {
current_color += cycle_direction; current_color += cycle_direction;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment