# HG changeset patch # User John Tsiombikas # Date 1443750895 -10800 # Node ID 2b85d05df3f2202d0c19e1fc73a05095060f46f1 # Parent dc99ceee9294c55774991ef8c733e620ea2f703c animation controls for easier screenshot grabbing diff -r dc99ceee9294 -r 2b85d05df3f2 ios/shots/SIZES --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ios/shots/SIZES Fri Oct 02 04:54:55 2015 +0300 @@ -0,0 +1,5 @@ +3.5 inch: 960x640 +4.0 inch: 1136x640 +4.7 inch: 1334x750 +5.5 inch: 2208x1242 + ipad: 2048x1496 diff -r dc99ceee9294 -r 2b85d05df3f2 src/glut/main.c --- a/src/glut/main.c Fri Oct 02 04:20:21 2015 +0300 +++ b/src/glut/main.c Fri Oct 02 04:54:55 2015 +0300 @@ -93,6 +93,18 @@ } break; + case ' ': + playpause(); + break; + + case '.': + seektime(250); + break; + + case ',': + seektime(-250); + break; + default: break; } diff -r dc99ceee9294 -r 2b85d05df3f2 src/istereo.c --- a/src/istereo.c Fri Oct 02 04:20:21 2015 +0300 +++ b/src/istereo.c Fri Oct 02 04:54:55 2015 +0300 @@ -51,6 +51,9 @@ int view_xsz, view_ysz; float view_aspect; +static int paused; +static long sys_msec, time_offset, time_msec, last_pause; + int stereo = 0; int use_bump = 0; int show_opt = 1; @@ -138,7 +141,9 @@ void redraw(void) { float pan_x, pan_y, z; - float tsec = get_time_sec(); + sys_msec = get_time_msec(); + time_msec = (paused ? last_pause : sys_msec) + time_offset; + double tsec = time_msec / 1000.0; z = ring_height * segm; worm(tsec, z, &pan_x, &pan_y); @@ -433,6 +438,21 @@ } } +void playpause(void) +{ + paused = !paused; + if(paused) { + last_pause = sys_msec; + } else { + time_offset -= sys_msec - last_pause; + } +} + +void seektime(long msec) +{ + time_offset -= msec; +} + static unsigned int get_shader_program(const char *vfile, const char *pfile) { unsigned int prog, vs, ps; diff -r dc99ceee9294 -r 2b85d05df3f2 src/istereo.h --- a/src/istereo.h Fri Oct 02 04:20:21 2015 +0300 +++ b/src/istereo.h Fri Oct 02 04:54:55 2015 +0300 @@ -27,4 +27,7 @@ void mouse_button(int bn, int press, int x, int y); void mouse_motion(int x, int y); +void playpause(void); +void seektime(long msec); + #endif /* ISTEREO_H_ */ diff -r dc99ceee9294 -r 2b85d05df3f2 src/ui.cc --- a/src/ui.cc Fri Oct 02 04:20:21 2015 +0300 +++ b/src/ui.cc Fri Oct 02 04:54:55 2015 +0300 @@ -43,21 +43,21 @@ CheckBox *cbox; -#ifdef IPHONE - if(have_retina()) { +//#ifdef IPHONE +// if(have_retina()) { cbox = new CheckBox; cbox->set_position(300, ypos + vsep); cbox->set_size(300, vsz); cbox->set_text("Retina quality rendering"); - if(using_retina_res()) { + //if(using_retina_res()) { cbox->check(); - } else { - cbox->uncheck(); - } - cbox->set_callback(EV_CHANGE, retina_cbox_handler); + //} else { + // cbox->uncheck(); + //} +// cbox->set_callback(EV_CHANGE, retina_cbox_handler); scr.add_widget(cbox); - } -#endif +// } +//#endif cbox = new CheckBox; cbox->set_position(300, ypos);