Browse Source

Cleaned up sleep, some of the logging.

Steve Thielemann 4 năm trước cách đây
mục cha
commit
4caa3e4051
1 tập tin đã thay đổi với 0 bổ sung40 xóa
  1. 0 40
      mystic.c

+ 0 - 40
mystic.c

@@ -75,23 +75,12 @@ int ms_sleep(unsigned int ms) {
     return result;
 }
 
-void nsleep(long ns) {
-    struct timespec ts;
-    ts.tv_sec = 0;
-    ts.tv_nsec = ns;
-    nanosleep(&ts, &ts);
-}
-
 void render_sleep(void) {
     if (render_overlimit)
         return;
 
     if (current_render.speed) {
-        // usleep(current_render.speed * 2500);
-        // nsleep( current_render.speed * 250000l);
         ms_sleep(current_render.speed * 100);
-
-        // nanosleep(current_render.speed * 2500);
     }
 }
 
@@ -206,13 +195,6 @@ const char * process_trigger(int fd, const char * cp) {
 
                 if (!render_overlimit) {
                     sleep(i);
-
-                    // nsleep(i * 10000l);
-                    /*
-                    struct timespec ts;
-                    ts.tv_sec = 0;
-                    ts.tv_nsec = i * 10000;
-                    nanosleep(&ts, &ts);*/
                 };
             }
             break;
@@ -226,10 +208,6 @@ void render_effect(int fd, char ch) {
     
     render_sleep();
     int x = write(fd, &ch, 1);
-#ifdef LOGGING
-    fprintf(fp, "write %c to %d result: %d\n", ch, fd, x);
-    fflush(fp);
-#endif
 
     return;
 
@@ -333,24 +311,6 @@ void harry_event(int fd) {
 #endif
 
     render(fd, buffer);
-    // render(fd, cp);
-
-    // This also works just fine!
-    //write(fd, buffer, strlen(buffer));
-
-    /*
-    char clear[] = "\b \b";
-    int x;
-    char haha[] = "Hahaha hahaha!!!";
-    char beep = '\a';
-
-    slow_write(fd, 11500, haha, strlen(haha) );
-    write(fd, &beep, 1);
-    sleep(3);
-    for( x = 0; x < strlen(haha); x++ ) {
-        write(fd, clear, strlen(clear) );
-    };
-    */
 }
 
 /*