Fixed crash in testdraw2, added more points
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403364
This commit is contained in:
parent
f055f6a189
commit
5a7c477ecc
1 changed files with 6 additions and 6 deletions
|
@ -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)
|
||||||
(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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue