summaryrefslogtreecommitdiffstats
authorDon 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)
commit63ef9ec2122cb9ecfc4276b9ec0c84c8e960a0bf (patch) (side-by-side diff)
treebf794f60df9920ce53dda28821d9a4d6f7bab4cd
parent815edf7a8fa94b2d576bade39ccb1b1178113f2f (diff)
downloadexp005-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.c13
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)
glNewList (S.list_offset + MAP_GEOMETRY, GL_COMPILE);
glPolygonMode (GL_FRONT, GL_FILL);
- for (int i = 0; i < ROWS; i++)
+ for (int i = 0; i < S.rows; i++)
{
glLoadName (i);
// Draw the protein geometry.
+ float* v = S.base_vertices_data + (i * 2);
glPushMatrix ();
- glTranslatef (S.base_vertices_data[i][0],
- S.base_vertices_data[i][1], 0.0);
- glColor4fv (S.base_colors_data[i]);
+ glTranslatef (*v,
+ *(v+1), 0.0);
+ glColor4fv (S.base_colors_data + (i * 4));
glCallList (S.list_offset + PROTEIN_GEOMETRY);
glPopMatrix ();
@@ -26,8 +27,8 @@ map_geometry (void)
if (S.selection.set[i])
{
glPushMatrix ();
- glTranslatef (S.base_vertices_data[i][0],
- S.base_vertices_data[i][1], 0.0);
+ glTranslatef (*v,
+ *(v+1), 0.0);
glColor4f (0.5, 0.5, 0.5, 1.0);
glCallList (S.list_offset + PROTEIN_SELECTED_GEOMETRY);
glPopMatrix ();

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.