From 63ef9ec2122cb9ecfc4276b9ec0c84c8e960a0bf Mon Sep 17 00:00:00 2001 From: Don Pellegrino Date: Fri, 14 Aug 2009 19:35:39 +0000 Subject: Modified to use dynamic memory for the number of nodes. --- 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 (); -- cgit v0.8.3.1-22-g547a