From: Gabriel Dunne Date: Thu, 25 Apr 2013 22:38:21 +0000 (-0700) Subject: Updates to Performance. X-Git-Url: https://git.quilime.com/?a=commitdiff_plain;h=3b6d978776d605588d5849b13410f99b6e1d8a1a;p=stars.git Updates to Performance. --- diff --git a/SConstruct b/SConstruct index 57addc9..57e9df2 100755 --- a/SConstruct +++ b/SConstruct @@ -105,7 +105,7 @@ if not conf.CheckCXXHeader('Magick++.h'): print 'GraphicsMagick must be installed!' Exit(1) -if not conf.CheckLibWithHeader('png12','png.h','c++','',1): +if not conf.CheckLibWithHeader('png14','png.h','c++','',1): print 'libpng12 must be installed!' Exit(1) diff --git a/intern/Global.cpp b/intern/Global.cpp index 4908bf0..f0026ee 100755 --- a/intern/Global.cpp +++ b/intern/Global.cpp @@ -12,6 +12,10 @@ Global::Global() { srand(982); + //////////////////////////////////////////////// + _PERFORM_ = false; + //////////////////////////////////////////////// + instance = this; for(int i=0;i<20000;i++){ @@ -22,27 +26,24 @@ Global::Global() glEnable(GL_POINT_SMOOTH); glHint(GL_LINE_SMOOTH_HINT, GL_NICEST); - for(int i=0;i<10000;i++){ + for(int i=0; i < 10000; i++){ thingies.push_back(new Thingy()); thingies.back()->z = ((rnd[i+7] - .5) * 100000000); } - - movecount = 0; toggleFullScreen(); hideMouse(); - - ifstream infile("media/move.txt"); - while( infile.good() ) { - int p; - infile >> p; - move.push_back(p); + if (!_PERFORM_) { + ifstream infile("media/move2.txt"); + while( infile.good() ) { + int p; + infile >> p; + move.push_back(p); + } + cout << move.size() << endl; } - - cout << move.size() << endl; - } @@ -55,8 +56,6 @@ void Global::loop() { vector::iterator it; - int MPOS = move[movecount]; - if (movecount < move.size() - 10) { movecount++; } @@ -78,9 +77,13 @@ void Global::loop() } - -// int MPOS = mouseX(); -// capture.push_back(mouseX()); + int MPOS = 0; + if (_PERFORM_) { + MPOS = mouseX(); + capture.push_back(mouseX()); + } else { + MPOS = move[movecount]; + } for(int i=0; ithingies; vector rnd; + bool _PERFORM_; + int movecount; vector move; - vector capture; - + void loop(); void keyDown(int k,int special); void mouseDown();