-rw-r--r-- | src/model/exp004base.sqc | 11 | ||||
-rw-r--r-- | src/model/exp004state.h | 35 | ||||
-rw-r--r-- | src/view/exp004init.c | 5 | ||||
-rw-r--r-- | src/view/exp004view.c | 4 |
4 files changed, 18 insertions, 37 deletions
diff --git a/src/model/exp004base.sqc b/src/model/exp004base.sqc index cbf2291..2742138 100644 --- a/src/model/exp004base.sqc +++ b/src/model/exp004base.sqc | |||
@@ -4,11 +4,12 @@ | |||
4 | 4 | ||
5 | #include "exp004base.h" | 5 | #include "exp004base.h" |
6 | #include "../view/exp004state0.h" | 6 | #include "../view/exp004state0.h" |
7 | #include "../util/check_error.h" | ||
7 | #include <GL/glut.h> | 8 | #include <GL/glut.h> |
8 | #include <stdio.h> | 9 | #include <stdio.h> |
9 | #include <string.h> | 10 | #include <string.h> |
10 | 11 | #include "sqlca.h" | |
11 | EXEC SQL INCLUDE sqlca; | 12 | extern struct sqlca sqlca; |
12 | 13 | ||
13 | /* | 14 | /* |
14 | * A simple alias to make the code more readable. | 15 | * A simple alias to make the code more readable. |
@@ -18,8 +19,6 @@ EXEC SQL INCLUDE sqlca; | |||
18 | void | 19 | void |
19 | exp004base (void) | 20 | exp004base (void) |
20 | { | 21 | { |
21 | EXEC SQL CONNECT TO exp004; | ||
22 | |||
23 | /* | 22 | /* |
24 | * This implementation can be improved by mapping the video memory | 23 | * This implementation can be improved by mapping the video memory |
25 | * directly rather than loading into system memory and then copying | 24 | * directly rather than loading into system memory and then copying |
@@ -49,7 +48,7 @@ exp004base (void) | |||
49 | EXEC SQL FETCH c2 INTO :coordinates; | 48 | EXEC SQL FETCH c2 INTO :coordinates; |
50 | while (sqlca.sqlcode != 100) | 49 | while (sqlca.sqlcode != 100) |
51 | { | 50 | { |
52 | int i = coordinates.coord_id; | 51 | int i = coordinates.coord_id - 1; |
53 | 52 | ||
54 | strncpy(S.gi_data[i], | 53 | strncpy(S.gi_data[i], |
55 | coordinates.gi.data, | 54 | coordinates.gi.data, |
@@ -70,7 +69,7 @@ exp004base (void) | |||
70 | /* | 69 | /* |
71 | * Deselected by default. | 70 | * Deselected by default. |
72 | */ | 71 | */ |
73 | S.selection[i] = false; | 72 | S.selection.set[i] = false; |
74 | 73 | ||
75 | S.base_colors_data[i][0] = DEFAULT_COLOR_R; | 74 | S.base_colors_data[i][0] = DEFAULT_COLOR_R; |
76 | S.base_colors_data[i][1] = DEFAULT_COLOR_G; | 75 | S.base_colors_data[i][1] = DEFAULT_COLOR_G; |