From 8de1ddca2733630a20b2663928084d209632d88f Mon Sep 17 00:00:00 2001 From: Don Pellegrino Date: Fri, 14 Aug 2009 19:37:15 +0000 Subject: Moved loading the data into the initialization routine. This allows for smoother sequence of initializing memory, loading data and then creating the geometry. --- diff --git a/src/view/exp004init.c b/src/view/exp004init.c index 30d8d96..5a6ddd0 100644 --- a/src/view/exp004init.c +++ b/src/view/exp004init.c @@ -6,6 +6,7 @@ #include "../model/geometry/protein_selected_geometry.h" #include "../model/selection_info_init.h" #include "../model/zoom_info_init.h" +#include "../model/exp004base.h" #include #define S exp004state0 @@ -13,10 +14,24 @@ void exp004init (void) { + /* + * Initialize default values, zero memory and NULL pointers. + */ + S.rows = 0; + S.base_vertices_data = NULL; + S.base_colors_data = NULL; selection_info_init (&S.selection); zoom_info_init (&S.zoom); S.legend = true; + /* + * Load the data. + */ + exp004base (); + + /* + * Create the geometry based on the data. + */ S.list_offset = glGenLists (NUM_LISTS); protein_geometry (); protein_selected_geometry (); diff --git a/src/view/exp004view.c b/src/view/exp004view.c index 33198ad..92cb56e 100644 --- a/src/view/exp004view.c +++ b/src/view/exp004view.c @@ -3,7 +3,6 @@ #include "../controller/exp004reshape.h" #include "../controller/keyboard.h" #include "../db/dbconnect.h" -#include "../model/exp004base.h" #include "exp004init.h" #include "exp004state0.h" #include "exp004view.h" @@ -40,7 +39,6 @@ exp004view (void) glHint (GL_LINE_SMOOTH_HINT, GL_NICEST); // Initialize the model. - exp004base (); exp004init (); // Callbacks (Controllers) -- cgit v0.8.3.1-22-g547a