diff --git a/drop_billiard.c b/drop_billiard.c index f0180f5..ae9f302 100644 --- a/drop_billiard.c +++ b/drop_billiard.c @@ -8,8 +8,8 @@ /* line to nils.berglund@univ-orleans.fr - Thanks! */ /* */ /* compile with */ -/* gcc -o drop_billiard drop_billiard.c -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lXmu -lglut */ -/* gcc -o drop_billiard drop_billiard.c -O3 -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lXmu -lglut */ +/* gcc -o drop_billiard drop_billiard.c */ +/* -O3 -L/usr/X11R6/lib -ltiff -lm -lGL -lGLU -lX11 -lXmu -lglut */ /* */ /* */ /* To make a video, set MOVIE to 1 and create subfolder tif_drop */ @@ -110,8 +110,7 @@ #define NCOLORS 14 /* number of colors */ #define COLORSHIFT 3 /* hue of initial color */ #define RAINBOW_COLOR 0 /* set to 1 to use different colors for all particles */ -// #define NSEG 100 /* number of segments of boundary */ -#define NSEG 150 /* _eux */ +#define NSEG 150 /* number of segments of boundary */ #define BILLIARD_WIDTH 4 /* width of billiard */ #define FRONT_WIDTH 4 /* width of wave front */ @@ -122,7 +121,7 @@ #define PAINT_EXT 1 /* set to 1 to paint exterior of billiard */ #define PAUSE 1000 /* number of frames after which to pause */ -#define PSLEEP 10 /* sleep time during pause */ +#define PSLEEP 1 /* sleep time during pause */ #define SLEEP1 1 /* initial sleeping time */ #define SLEEP2 100 /* final sleeping time */ #define END_FRAMES 0 /* number of frames at end of movie */ diff --git a/sub_part_billiard.c b/sub_part_billiard.c index 076878b..832dae0 100644 --- a/sub_part_billiard.c +++ b/sub_part_billiard.c @@ -109,8 +109,8 @@ int writetiff(char *filename, char *description, int x, int y, int width, int he TIFFSetField(file, TIFFTAG_ROWSPERSTRIP, 1); TIFFSetField(file, TIFFTAG_IMAGEDESCRIPTION, description); p = image; -// for (i = height - 1; i >= 0; i--) - for (i = height - 1; i >= 0; i--) // _eux + + for (i = height - 1; i >= 0; i--) { // if (TIFFWriteScanline(file, p, height - i - 1, 0) < 0) if (TIFFWriteScanline(file, p, i, 0) < 0) @@ -121,7 +121,7 @@ int writetiff(char *filename, char *description, int x, int y, int width, int he } p += width * sizeof(GLubyte) * 3; } - free(image); /* _Michale_eux*/ + free(image); /* prenvents RAM consumption*/ TIFFClose(file); return 0; } @@ -192,14 +192,13 @@ void save_frame() strcat(n2, ".tif"); printf(" saving frame %s \n",n2); - // mod by _eux - chose one of the following according to the comment beside. - // writetiff(n2, "Billiard in an ellipse", 0, 0, WINWIDTH, WINHEIGHT-40, COMPRESSION_LZW); /* to use with 1080p in drop_billiard.c- probably the best because it's + // choose one of the following according to the comment beside. + writetiff(n2, "Billiard in an ellipse", 0, 0, WINWIDTH, WINHEIGHT-40, COMPRESSION_LZW); /* to use with 1080p in drop_billiard.c- probably the best because it's // generating 1080p image, lighter, and then cropping those 40 pixels to // avoid the strange band*/ // writetiff(n2, "Billiard in an ellipse", 0, 0, WINWIDTH, WINHEIGHT-50, COMPRESSION_LZW); // works for 1080p -> "-50px" band!!! // writetiff(n2, "Billiard in an ellipse", 0, 0, 1920, 1080-40, COMPRESSION_LZW); //another perfect 1080p from 1440p in setup // writetiff(n2, "Billiard in an ellipse", -WINWIDTH/8+320, -WINHEIGHT/8+180, WINWIDTH-640, WINHEIGHT-400, COMPRESSION_LZW); // perfect 1040p from 1440p in setup - writetiff(n2, "Billiard in an ellipse", 0, 0, WINWIDTH, WINHEIGHT-40, COMPRESSION_LZW); // _Michael_eux } void write_text_fixedwidth( double x, double y, char *st)