author | Don Pellegrino <don@coffee.donpellegrino.com> | 2009-08-14 19:35:39 (GMT) |
---|---|---|
committer | Don Pellegrino <don@coffee.donpellegrino.com> | 2009-08-14 19:35:39 (GMT) |
commit | 63ef9ec2122cb9ecfc4276b9ec0c84c8e960a0bf (patch) (unidiff) | |
tree | bf794f60df9920ce53dda28821d9a4d6f7bab4cd | |
parent | 815edf7a8fa94b2d576bade39ccb1b1178113f2f (diff) | |
download | exp005-63ef9ec2122cb9ecfc4276b9ec0c84c8e960a0bf.zip exp005-63ef9ec2122cb9ecfc4276b9ec0c84c8e960a0bf.tar.gz exp005-63ef9ec2122cb9ecfc4276b9ec0c84c8e960a0bf.tar.bz2 |
Modified to use dynamic memory for the number of nodes.
-rw-r--r-- | src/model/geometry/map_geometry.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/model/geometry/map_geometry.c b/src/model/geometry/map_geometry.c index 63e409d..72bc747 100644 --- a/src/model/geometry/map_geometry.c +++ b/src/model/geometry/map_geometry.c | |||
@@ -10,15 +10,16 @@ map_geometry (void) | |||
10 | glNewList (S.list_offset + MAP_GEOMETRY, GL_COMPILE); | 10 | glNewList (S.list_offset + MAP_GEOMETRY, GL_COMPILE); |
11 | glPolygonMode (GL_FRONT, GL_FILL); | 11 | glPolygonMode (GL_FRONT, GL_FILL); |
12 | 12 | ||
13 | for (int i = 0; i < ROWS; i++) | 13 | for (int i = 0; i < S.rows; i++) |
14 | { | 14 | { |
15 | glLoadName (i); | 15 | glLoadName (i); |
16 | 16 | ||
17 | // Draw the protein geometry. | 17 | // Draw the protein geometry. |
18 | float* v = S.base_vertices_data + (i * 2); | ||
18 | glPushMatrix (); | 19 | glPushMatrix (); |
19 | glTranslatef (S.base_vertices_data[i][0], | 20 | glTranslatef (*v, |
20 | S.base_vertices_data[i][1], 0.0); | 21 | *(v+1), 0.0); |
21 | glColor4fv (S.base_colors_data[i]); | 22 | glColor4fv (S.base_colors_data + (i * 4)); |
22 | glCallList (S.list_offset + PROTEIN_GEOMETRY); | 23 | glCallList (S.list_offset + PROTEIN_GEOMETRY); |
23 | glPopMatrix (); | 24 | glPopMatrix (); |
24 | 25 | ||
@@ -26,8 +27,8 @@ map_geometry (void) | |||
26 | if (S.selection.set[i]) | 27 | if (S.selection.set[i]) |
27 | { | 28 | { |
28 | glPushMatrix (); | 29 | glPushMatrix (); |
29 | glTranslatef (S.base_vertices_data[i][0], | 30 | glTranslatef (*v, |
30 | S.base_vertices_data[i][1], 0.0); | 31 | *(v+1), 0.0); |
31 | glColor4f (0.5, 0.5, 0.5, 1.0); | 32 | glColor4f (0.5, 0.5, 0.5, 1.0); |
32 | glCallList (S.list_offset + PROTEIN_SELECTED_GEOMETRY); | 33 | glCallList (S.list_offset + PROTEIN_SELECTED_GEOMETRY); |
33 | glPopMatrix (); | 34 | glPopMatrix (); |