home *** CD-ROM | disk | FTP | other *** search
- {$X+}
- program quack;
- uses crt,graph;
-
- type cube = record
- x,y,z,xl,yl,zl:integer;
- texture:string[9];
- end;
-
- type ent = record
- class:string;
- ox,oy,oz:integer;
- angle:integer;
- end;
-
-
- var brush:array[0..255] of cube;
- entity:array[0..63] of ent;
- gDriver,gMode:integer;
- xmax,ymax:string;
- xdiv,ydiv:integer;
- ch:char;
- zoommode:byte;
- defaulttex:string;
- numbrushes:byte; numentities:byte;
- curbrush:byte; curentity:byte;
- curview:byte;
- moverate:byte;
- movemode:boolean;
-
- {$I procs.pas}
-
-
- begin
- numbrushes:=0;
- curview:=0;
- numentities:=0;
- curentity:=0;
- curbrush:=0;
- moverate:=10;
- zoommode:=1;
- movemode:=false;
- gDriver:=detect;
- defaulttex:='TECH07_2';
- initgraph(gDriver,gMode,'');
- if graphresult=grok then begin
- outtextxy(0,0,'QUACK beta .93 (c) 1996 FearTheFastFoodPickle! software.');
- str(getmaxx+1,xmax); str(getmaxy+1,ymax);
- outtextxy(0,10,xmax+','+ymax);
- outtextxy(0,30,'a key, press one.');
- xdiv:=getmaxx div 2; ydiv:=getmaxy div 2;
- readkey; cleardevice;
- end else begin
- write('graphics prob'); halt;
- end;
-
- repeat
- if numbrushes>0 then drawbrushes;
- if numentities>0 then drawentities;
- repeat until keypressed;
- ch:=readkey;
-
- if ch='L' then oldload;
- if ch='I' then insertnewentity;
- if ch='a' then curentityangle;
- if ch=chr(13) then curentityclass;
- if ch='[' then begin
- inc(curentity);
- if curentity=numentities then curentity:=0;
- end;
- if ch=']' then if curentity>0 then dec(curentity) else curentity:=numentities-1;
- with entity[curentity] do begin;
- if ch='u' then begin
- if curview=0 then oy:=oy-moverate;
- if curview>0 then oz:=oz+moverate;
- end;
- if ch='j' then begin
- if curview=0 then oy:=oy+moverate;
- if curview>0 then oz:=oz-moverate;
- end;
- if ch='k' then begin
- if curview=0 then ox:=ox+moverate;
- if curview=1 then oy:=oy+moverate;
- if curview=2 then ox:=ox+moverate;
- end;
- if ch='h' then begin
- if curview=0 then ox:=ox-moverate;
- if curview=1 then oy:=oy-moverate;
- if curview=2 then ox:=ox-moverate;
- end;
- end;
-
- if ch=chr(9) then if movemode=true then movemode:=false else movemode:=true;
- if ch='!' then deletecurbrush;
- if ch='z' then zoommode:=1;
- if ch='x' then zoommode:=2;
- if ch='c' then zoommode:=4;
- if ch='v' then zoommode:=6;
- if ch='b' then zoommode:=8;
- if ch='T' then getnewdefaulttexture;
- if ch='m' then getnewmoverate;
- if ch='i' then insertnewbrush;
- if ch='q' then curview:=0;
- if ch='w' then curview:=1;
- if ch='e' then curview:=2;
- if ch='8' then begin
- with brush[curbrush] do begin
- if curview=0 then yl:=yl-moverate;
- if curview>0 then zl:=zl+moverate;
- end;
- end;
- if ch='2' then begin
- with brush[curbrush] do begin
- if curview=0 then yl:=yl+moverate;
- if curview>0 then zl:=zl-moverate;
- end;
- end;
- if ch='6' then begin
- with brush[curbrush] do begin
- if curview=0 then xl:=xl+moverate;
- if curview=1 then yl:=yl+moverate;
- if curview=2 then xl:=xl+moverate;
- end;
- end;
- if ch='4' then begin
- with brush[curbrush] do begin
- if curview=0 then xl:=xl-moverate;
- if curview=1 then yl:=yl-moverate;
- if curview=2 then xl:=xl-moverate;
- end;
- end;
-
- if ch=' ' then begin
- inc(curbrush);
- if curbrush>=numbrushes then curbrush:=0; { i have bad feeling bout this}
- end;
- if ( ch=chr(8) ) and ( curbrush>0 ) then dec(curbrush);
- if ( ch=chr(8) ) and ( curbrush=0 ) and (numbrushes>0) then curbrush:=numbrushes-1;
- if ch='s' then save;
- if ch='l' then load;
- if ch='t' then texture;
- if ch=chr(0) then begin
- ch:=readkey;
- with brush[curbrush] do begin
- if ch=chr(72) then begin
- if curview=0 then y:=y-moverate;
- if curview>0 then z:=z+moverate;
- if movemode=true then begin
- with brush[curbrush] do begin
- if curview=0 then yl:=yl-moverate;
- if curview>0 then zl:=zl+moverate;
- end;
- end;
- end;
- if ch=chr(80) then begin
- if curview=0 then y:=y+moverate;
- if curview>0 then z:=z-moverate;
- if movemode=true then begin
- with brush[curbrush] do begin
- if curview=0 then yl:=yl+moverate;
- if curview>0 then zl:=zl-moverate;
- end;
- end;
- end;
- if ch=chr(77) then begin
- if curview=0 then x:=x+moverate;
- if curview=1 then y:=y+moverate;
- if curview=2 then x:=x+moverate;
- if movemode=true then begin
- with brush[curbrush] do begin
- if curview=0 then xl:=xl+moverate;
- if curview=1 then yl:=yl+moverate;
- if curview=2 then xl:=xl+moverate;
- end;
- end;
- end;
- if ch=chr(75) then begin
- if curview=0 then x:=x-moverate;
- if curview=1 then y:=y-moverate;
- if curview=2 then x:=x-moverate;
- if movemode=true then begin
- with brush[curbrush] do begin
- if curview=0 then xl:=xl-moverate;
- if curview=1 then yl:=yl-moverate;
- if curview=2 then xl:=xl-moverate;
- end;
- end;
- end;
- end;
- end;
- until ch='Q';
- closegraph;
- end.
-
-
-
-