]> git.quilime.com - stars.git/commitdiff
Updates to Performance.
authorGabriel Dunne <gdunne@quilime.com>
Thu, 25 Apr 2013 22:38:21 +0000 (15:38 -0700)
committerGabriel Dunne <gdunne@quilime.com>
Thu, 25 Apr 2013 22:38:21 +0000 (15:38 -0700)
SConstruct
intern/Global.cpp
intern/Global.h

index 57addc90f3a9a589ab5505cf79e70543938cb4c3..57e9df2885ae0af00e8e836c81e2a8e98ef97a84 100755 (executable)
@@ -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)
 
index 4908bf0f4e73e7bf1a9cc90ff20cada606c5a7ce..f0026eec8faa382cfacf96573874eafff9d5f7b8 100755 (executable)
@@ -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<Thingy*>::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; i<thingies.size(); i++)
@@ -119,15 +122,16 @@ void Global::keyDown(int k, int special)
 
 void Global::mouseDown()
 {
-    int c = 0;
-    cout << "++++++++" << endl;
-    for(int i = 0; i < capture.size(); i++)
-    {
-        cout << capture[i] << endl;
+    if (_PERFORM_) {
+        int c = 0;
+        cout << "++++++++" << endl;
+        for(int i = 0; i < capture.size(); i++)
+        {
+            cout << capture[i] << endl;
+        }
     }
-//        cout << capture.size() << endl;
-
 
+//        cout << capture.size() << endl;
 /*
     rnd.clear();
     for(int i=0;i<1000;i++){
index 5d572de2bb366786ee704ab74a2973f4a31713b7..e2a31a403a505ceafb8b265b7ee6afc132b2fb85 100755 (executable)
@@ -15,22 +15,23 @@ using namespace Magick;
 
 class Global{
  public:
-  
+
   /**
      the one and only static global instance of the Global object.
      refer to me as `Global::instance`
   */
-  
-  
+
+
   static Global*instance;
   vector<Thingy*>thingies;
   vector<float> rnd;
 
+  bool _PERFORM_;
+
   int movecount;
   vector<int> move;
-  
   vector<int> capture;
-  
+
   void loop();
   void keyDown(int k,int special);
   void mouseDown();