diff -Naur povray3/frame.h povpatch/frame.h --- povray3/frame.h Fri Jan 31 07:04:55 1997 +++ povpatch/frame.h Sat Nov 7 10:43:45 1998 @@ -22,6 +22,8 @@ * * Modified by Andreas Dilger to add PNG file format support 05/09/95 * +* Modified By Scott Manley to add repeat vector support in Bitmaps +* *****************************************************************************/ #ifndef FRAME_H @@ -918,6 +920,7 @@ VECTOR Gradient; SNGL width, height; int iwidth, iheight; + int rwidth,rheight; /* repeat vectors */ short Colour_Map_Size; IMAGE_COLOUR *Colour_Map; union diff -Naur povray3/image.c povpatch/image.c --- povray3/image.c Tue Sep 3 08:55:47 1996 +++ povpatch/image.c Sat Nov 7 10:55:35 1998 @@ -882,9 +882,11 @@ } /* Now make sure the point is on the image */ + /* and apply integer repeats using fmod */ + + *ycoor = fmod((*ycoor),(DBL)(Image->iheight)) + Small_Tolerance; + *xcoor = fmod((*xcoor),(DBL)(Image->iwidth)) + Small_Tolerance; - *ycoor += Small_Tolerance; - *xcoor += Small_Tolerance; /* Compensate for y coordinates on the images being upsidedown */ @@ -1266,7 +1268,7 @@ * * CHANGES * -* - +* Scott Manley Added repeat vector initialisation * ******************************************************************************/ @@ -1287,6 +1289,8 @@ Image->Once_Flag = FALSE; Image->Use_Colour_Flag = FALSE; + + Image->rwidth = Image->rheight = 1; Make_Vector(Image->Gradient, 1.0, -1.0, 0.0); diff -Naur povray3/parstxtr.c povpatch/parstxtr.c --- povray3/parstxtr.c Sun Feb 2 10:09:49 1997 +++ povpatch/parstxtr.c Mon Jan 11 10:18:12 1999 @@ -229,6 +229,8 @@ * * CHANGES * +* Scott Manley added us of repeat token +* ******************************************************************************/ static void Parse_Image_Map (Pigment) @@ -236,6 +238,8 @@ { int reg; IMAGE *Image; + VECTOR Local_Vector; + Parse_Begin(); @@ -263,6 +267,21 @@ Image->Use_Colour_Flag = FALSE; END_CASE + CASE (REPEAT_TOKEN) + Parse_Vector (Local_Vector); + if(Local_Vector[0]!=(int)(Local_Vector[0])) + Warning(0.0,"Image Repeate Vectors Must be Whole Numbers"); + if(Local_Vector[1]!=(int)(Local_Vector[1])) + Warning(0.0,"Image Repeate Vectors Must be Whole Numbers"); + if((Image->rheight = (int)(Local_Vector[0]))<1) + Error("Zero or Negative Image Repeat Vector."); + if((Image->rwidth = (int)(Local_Vector[1]))<1) + Error("Zero or Negative Image Repeat Vector."); + Image->width = (DBL)Image->iwidth * (DBL)Image->rwidth; + Image->height = (DBL)Image->iheight * (DBL)Image->rheight; + END_CASE + + CASE (ALPHA_TOKEN) Warn(1.55, "Keyword ALPHA discontinued. Use FILTER instead."); @@ -366,7 +385,9 @@ * * DESCRIPTION * -* CHANGES +* CHANGES +* +* Scott Manley Added use of repeat vector * ******************************************************************************/ @@ -374,7 +395,7 @@ TNORMAL *Tnormal; { IMAGE *Image; - + VECTOR Local_Vector; Parse_Begin(); Image = Parse_Image(IMAGE_FILE); @@ -397,6 +418,20 @@ Tnormal->Amount = Parse_Float (); END_CASE + CASE (REPEAT_TOKEN) + Parse_Vector (Local_Vector); + if(Local_Vector[0]!=(int)(Local_Vector[0])) + Warning(0.0,"Image Repeate Vectors Must be Whole Numbers"); + if(Local_Vector[1]!=(int)(Local_Vector[1])) + Warning(0.0,"Image Repeate Vectors Must be Whole Numbers"); + if((Image->rheight = (int)(Local_Vector[0]))<1) + Error("Zero or Negative Image Repeat Vector."); + if((Image->rwidth = (int)(Local_Vector[1]))<1) + Error("Zero or Negative Image Repeat Vector."); + Image->width = (DBL)Image->iwidth * (DBL)Image->rwidth; + Image->height = (DBL)Image->iheight * (DBL)Image->rheight; + END_CASE + CASE (USE_COLOUR_TOKEN) Image->Use_Colour_Flag = TRUE; END_CASE @@ -1851,6 +1886,7 @@ static TEXTURE *Parse_Material_Map() { TEXTURE *Texture, *Local_Texture; + VECTOR Local_Vector; Parse_Begin (); Texture = Create_Texture (); @@ -1879,6 +1915,21 @@ CASE (MAP_TYPE_TOKEN) Texture->Vals.Image->Map_Type = (int) Parse_Float (); END_CASE + + CASE (REPEAT_TOKEN) + Parse_Vector (Local_Vector); + if(Local_Vector[0]!=(int)(Local_Vector[0])) + Warning(0.0,"Image Repeate Vectors Must be Whole Numbers"); + if(Local_Vector[1]!=(int)(Local_Vector[1])) + Warning(0.0,"Image Repeate Vectors Must be Whole Numbers"); + if((Texture->Vals.Image->rheight = (int)(Local_Vector[0]))<1) + Error("Zero or Negative Image Repeat Vector."); + if((Texture->Vals.Image->rwidth = (int)(Local_Vector[1]))<1) + Error("Zero or Negative Image Repeat Vector."); + Texture->Vals.Image->width = (DBL)Texture->Vals.Image->iwidth * (DBL)Texture->Vals.Image->rwidth; + Texture->Vals.Image->height = (DBL)Texture->Vals.Image->iheight * (DBL)Texture->Vals.Image->rheight; + END_CASE + OTHERWISE UNGET diff -Naur povray3/unix/config.h povpatch/unix/config.h --- povray3/unix/config.h Thu Jan 1 00:00:00 1970 +++ povpatch/unix/config.h Mon Jan 11 10:18:15 1999 @@ -0,0 +1,150 @@ +/***************************************************************************** +* unixconf.h +* +* This header file contains all constants and types required to run on a +* UNIX system. +* +* from Persistence of Vision Raytracer +* Copyright 1995 Persistence of Vision Team +*--------------------------------------------------------------------------- +* NOTICE: This source code file is provided so that users may experiment +* with enhancements to POV-Ray and to port the software to platforms other +* than those supported by the POV-Ray Team. There are strict rules under +* which you are permitted to use this file. The rules are in the file +* named POVLEGAL.DOC which should be distributed with this file. If +* POVLEGAL.DOC is not available or for more info please contact the POV-Ray +* Team Coordinator by leaving a message in CompuServe's Graphics Developer's +* Forum. The latest version of POV-Ray may be found there as well. +* +* This program is based on the popular DKB raytracer version 2.12. +* DKBTrace was originally written by David K. Buck. +* DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins. +* +*****************************************************************************/ + +/* + * Below are several defines needed by the Unix parts of POV. You + * may redefine them as needed in this config.h file. Each has a default + * which will be defined in frame.h if you don't define it here. + */ + +/* + * This should use the standard C header files, if they exist, or just + * our own prototypes if they don't. Modify to suit your needs. + */ + +#ifdef __STDC__ +#define PARAMS(x) x +# ifndef CONST +# define CONST const +# endif +#include +#include +#else +#define PARAMS(x) () +# ifndef volatile +# define volatile +# endif +int unlink(char *); +char *getenv(char *); +void *malloc(size_t); +void free(void *); +double fmod(double, double); +double atof(char *); +#endif + +/* + * Try to use system specified values for the maximum filename length, or + * at least some Unix sized ones, rather than DOS sized ones. + */ +#if defined (PATH_MAX) +# define POV_NAME_MAX PATH_MAX +# define FILE_NAME_MAX PATH_MAX +#elif defined (_POSIX_PATH_MAX) +# define POV_NAME_MAX _POSIX_PATH_MAX +# define FILE_NAME_MAX _POSIX_PATH_MAX +#else +# define POV_NAME_MAX 200 +# define FILE_NAME_MAX 250 +#endif + +/* + * Try to read in ONE of the default POV-Ray INI files, in the order: + * 1) whatever POVINI is pointing to, + * 2) the file .povrayrc in the user's home directory + * 3) the file povray.ini in the current directory + */ +#define READ_ENV_VAR \ + if ((Option_String_Ptr = getenv("POVINI")) != NULL) \ + if (!parse_ini_file(Option_String_Ptr)) \ + { \ + Warning(0.0, "Could not find '%s' as specified in POVINI environment.\n",\ + Option_String_Ptr); \ + Option_String_Ptr = NULL; \ + } + +#define PROCESS_POVRAY_INI \ + if (Option_String_Ptr==NULL && (Option_String_Ptr = getenv("HOME"))!=NULL) { \ + char ini_name[FILE_NAME_MAX]; \ + strncpy(ini_name, Option_String_Ptr, FILE_NAME_MAX); \ + strncat(ini_name, "/.povrayrc", FILE_NAME_MAX); \ + if (parse_ini_file(ini_name) == FALSE) \ + parse_ini_file("povray.ini"); \ + } else \ + parse_ini_file("povray.ini"); + +#define TIME_ELAPSED (tstop - tstart); + +/* + * This is the image file format that POV will choose by default if none is + * specified on the command-line. Although the default value is already 't' + * for TGA format files, many Unix sites may want to change this to 'p' to + * get ppm format files, which more Unix utilities understand. + */ +#define DEFAULT_OUTPUT_FORMAT 't' + +/* + * What level of memory statistics we want. See mem.h for more info. + */ +#define MEM_STATS 1 + +/* + * The UNIX precision timer uses gettimeofday(). If this is unavailable, + * define PRECISION_TIMER_AVAILABLE to 0, which means you won't be able + * to generate histogram output files. + */ + +#define PRECISION_TIMER_AVAILABLE 1 + +#if PRECISION_TIMER_AVAILABLE + +#define PRECISION_TIMER_INIT +#define PRECISION_TIMER_START UNIX_Timer_Start(); +#define PRECISION_TIMER_STOP UNIX_Timer_Stop(); +#define PRECISION_TIMER_COUNT UNIX_Timer_Count(); + +void UNIX_Timer_Start PARAMS((void)); +void UNIX_Timer_Stop PARAMS((void)); +int UNIX_Timer_Count PARAMS((void)); + +#endif /* PRECISION_TIMER_AVAILABLE */ + +/* + * Some systems don't have setvbuf. If not, just define it away - it's + * not critical to the raytracer. It just sets up the disk buffers. + * #define setvbuf(w,x,y,z) + */ + +/* + * This sets up the signal handler during a rendering so that if CTRL-C is + * pressed, the normal user abort function is called. If your system + * doesn't support signal(), you can try to modify these functions to use + * an available signal function, or just comment these out, although + * in this case you will lose anything in the output buffer if the trace + * is interrupted with CTRL-C. + */ +#define POV_PRE_RENDER UNIX_Abort_Start(); +#define POV_PRE_SHUTDOWN UNIX_Abort_Handler(0); +void UNIX_Abort_Start PARAMS((void)); +void UNIX_Abort_Handler PARAMS((int signum)); +