home *** CD-ROM | disk | FTP | other *** search
- /* Animated fire script for ImageMaster and PAR. Don Cox, June 95
- */
- options results
-
- call open("STDERR","ram:tracePFire","W")
- trace r
-
- if show('P','IM_Port') = 0 then do
- say "Can't find image processor's ARexx port!!!"; /* not running? */
- say "This script requires ImageMaster to run!";
- exit(20);
- end;
-
- call pragma('stack',20000);
-
- address DDR
- mode ANIM
-
- address 'IM_Port'
- 'imtofront'; /* show user the IM screen */
-
- 'filerequest "DDR:" "" "" "Final Video file"'
- PARoutputfile = result
- if PARoutputfile = 'FR_CANCELLED' then do
- address 'IM_Port'
- 'imtofront'
- exit 0
- end
- PARoutputfile = expandfilename(PARoutputfile)
- PARoutputpath = gimmepath(PARoutputfile)
- parse var PARoutputpath PARoutputpath PARoutputname
- PARoutputname = strip(PARoutputname)
-
- 'asknumber "How many frames?" 50'
- nframes = result
-
- 'rectarea'
-
- bred = 0
- bgrn = 40
- bblu = 230
-
- mred = 255
- mgrn = 250
- mblu = 190
-
- ered = 255
- egrn = 235
- eblu = 0
-
- tred = 115
- tgrn = 57
- tblu = 0
-
- length = 450
- direction = 0
- seed = 8
- hstruct = 12
- hturb = 50
- vstruct = 5
- vturb = 100
- wobble = 10
- wobamt = 50
- distort = 100
-
- address 'IM_Port'
- 'current'
- buffdata = result
- parse var buffdata bname ',' bnum ',' bx ',' by ',' btot ',' bmem ',' bparname ',' bparnum
-
- do i = 1 to nframes
- time = (i-1) * (360/nframes)
- 'fire 'bred bgrn bblu mred mgrn mblu ered egrn eblu tred tgrn tblu length direction time seed hstruct hturb vstruct vturb wobble wobamt distort;
- 'save 'bnum '"'||PARoutputfile||'"'
- 'undo'
- end
-
- wayout("Done - now name new PAR anim")
-
-
- wayout:
- address 'IM_Port'
- 'autoredraw 1' /* ON */
-
- parse arg infomessage
- if infomessage ~= "" then do
- address 'IM_Port'
- 'message 'infomessage
- end
- address DDR
- TOFRONT
- Mode r_Mode
- EMode r_EMode
- Filter r_filter
- Translate r_Translate
- Exporter r_Exporter
- Done
- exit 0
- end
-
- /* +++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++ */
-
- /* gimmepath
- This takes the provided argument and sucks the path out of it, then returns that path to the caller, sans file name. */
-
- gimmepath:
- parse arg fullnamegx;
- tempgx = reverse(fullnamegx);
- lengx = length(fullnamegx); /* get length of string */
- slashdex = index(tempgx,'/'); /* first occurance of '/' from right */
- colondex = index(tempgx,':'); /* first occurance of ':' from right */
- seploc = 0; /* assumes current dir, no path supplied */
- if slashdex ~= 0 then do /* we assume we are in a DIR */
- seploc = (lengx - slashdex)+1;
- end;
- else do
- if colondex ~= 0 then do /* we assume we are on a device */
- seploc = (lengx - colondex)+1;
- end;
- end;
- gxname = substr(fullnamegx,seploc+1); /* if you ever need it */
- gxpath = left(fullnamegx,seploc)
- gxpath = gxpath" "gxname
- return(gxpath);
-
-
- /* +++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++ */
-
- /*
- * Since this script can't be expected to know where the CD of the user
- * is when this cmd is invoked, we have to check the path the user
- * provides - if it's not specified right from a root, then we have
- * to make it a complete specification from the root.
- */
- expandfilename:
- parse arg jfile;
- if index(jfile,':') = 0 then do
- curdir = pragma(D);
- if right(curdir,1) ~= ':' then do
- if right(curdir,1) ~= '/' then do
- if curdir ~= '' then do
- curdir = curdir || '/';
- end;
- end;
- end;
- jfile = curdir||jfile;
- end;
- return(jfile);
-
-