From df40de3b564062c1bba93332d08e86f3691e6b00 Mon Sep 17 00:00:00 2001 From: Ian C Date: Mon, 23 Aug 2010 17:56:37 +0000 Subject: Added output of XML file with universe states per tick. --- glgrav.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'glgrav.cpp') diff --git a/glgrav.cpp b/glgrav.cpp index 95b00b4..5c08b90 100644 --- a/glgrav.cpp +++ b/glgrav.cpp @@ -83,6 +83,9 @@ static bool fog=false; static bool fog_light=false; static GLfloat fog_col[4]={0.0f,0.0f,0.0f,1.0f}; +static ofstream output; +unsigned long tick; + static struct { GLfloat x,y,z; @@ -180,6 +183,17 @@ int main(int argc, char *argv[]) render_sparks=false; } + if (!config.output().empty()) + { + output.open(config.output().c_str()); + + if (output) + { + output << "" << endl; + output << "" << endl; + } + } + config.windowSize(width,height); width=max(width,100); @@ -414,6 +428,12 @@ static void Menu(int item) break; case MENU_QUIT: + if (output) + { + output << "" << endl; + output.close(); + } + exit(EXIT_SUCCESS); break; } @@ -875,11 +895,44 @@ static void Update(void) new_mass=mass; + if (output) + { + output << "" << endl; + } + for(f=0;f" << endl; + } + del_mass.push_back(false); } + if (output) + { + output << "" << endl; + } + for(f=0;f