author | Don Pellegrino <don@coffee.donpellegrino.com> | 2009-08-14 19:19:14 (GMT) |
---|---|---|
committer | Don Pellegrino <don@coffee.donpellegrino.com> | 2009-08-14 19:19:14 (GMT) |
commit | edf954cf12cca64868182a0f5a21679b8bf93906 (patch) (unidiff) | |
tree | f42b89f9ad4665587fb37bba055e1a1986d1ff03 | |
parent | 1c5fd5b11e90f6d635345f39b303339a09663d1d (diff) | |
download | exp005-edf954cf12cca64868182a0f5a21679b8bf93906.zip exp005-edf954cf12cca64868182a0f5a21679b8bf93906.tar.gz exp005-edf954cf12cca64868182a0f5a21679b8bf93906.tar.bz2 |
Modified to use dynamic memory allocation for the number of nodes.
-rw-r--r-- | src/controller/clear_selection.sqc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/controller/clear_selection.sqc b/src/controller/clear_selection.sqc index b4ff0a3..f43534c 100644 --- a/src/controller/clear_selection.sqc +++ b/src/controller/clear_selection.sqc | |||
@@ -23,13 +23,17 @@ clear_selection (void) | |||
23 | 23 | ||
24 | EXEC SQL COMMIT; | 24 | EXEC SQL COMMIT; |
25 | 25 | ||
26 | for (unsigned int i = 0; i < ROWS; i++) | 26 | for (unsigned int i = 0; i < S.rows; i++) |
27 | { | 27 | { |
28 | S.selection.set[i] = false; | 28 | S.selection.set[i] = false; |
29 | S.base_colors_data[i][0] = DEFAULT_COLOR_R; | 29 | float* c = S.base_colors_data + (i * 4); |
30 | S.base_colors_data[i][1] = DEFAULT_COLOR_G; | 30 | *c = DEFAULT_COLOR_R; |
31 | S.base_colors_data[i][2] = DEFAULT_COLOR_B; | 31 | c++; |
32 | S.base_colors_data[i][3] = DEFAULT_COLOR_A; | 32 | *c = DEFAULT_COLOR_G; |
33 | c++; | ||
34 | *c = DEFAULT_COLOR_B; | ||
35 | c++; | ||
36 | *c = DEFAULT_COLOR_A; | ||
33 | } | 37 | } |
34 | 38 | ||
35 | glBindBuffer (GL_ARRAY_BUFFER, S.buffers[BASE_COLORS]); | 39 | glBindBuffer (GL_ARRAY_BUFFER, S.buffers[BASE_COLORS]); |