' IBasic Pro ' SkyLines 2D Computer Generated Art Challenge ' -= ZeroDog =- March 2005 ' Random count -- 264 autodefine "off" ' Pre-run Options - - - - - - - - - - - - - - - - - - - - - - - - - DIALOG OptionsDlg INT Result,sx,sy,bpp,SSMode,SSTimer,temptimer,SSText CREATEDIALOG(OptionsDlg,-1000,-1000,180,200,@CAPTION|@SYSMENU,0,"Skylines",&OptionsDlgProc) CONTROL OptionsDlg,@COMBOBOX,"Resolution",10,10,160,100,@CTCOMBODROPLIST|@TABSTOP,10 CONTROL OptionsDlg,@COMBOBOX,"BPP",10,45,160,100,@CTCOMBODROPLIST|@TABSTOP,11 CONTROL OptionsDlg,@CHECKBOX,"Slideshow mode",10,75,150,25,@TABSTOP,12 CONTROL OptionsDlg,@STATIC,"Pause Length",30,100,50,35,0,13 CONTROL OptionsDlg,@EDIT,"5",80,100,50,25,@CTEDITRO|@CTEDITCENTER|@TABSTOP,14 CONTROLEX OptionsDlg,"msctls_updown32","TimerSpinner",130,100,35,25,0x50000000|0x0062|0x0191 ,0,15 CONTROL OptionsDlg,@CHECKBOX,"No Text",10,135,150,25,@TABSTOP,16 CONTROL OptionsDlg,@button,"Ok",10,165,75,25,@TABSTOP|@CTLBTNDEFAULT,@IDOK CONTROL OptionsDlg,@button,"Cancel",95,165,75,25,@TABSTOP,@IDCANCEL Result=DOMODAL OptionsDlg if Result=@IDCANCEL then end ' Main Start - - - - - - - - - - - - - - - - - - - - - - - - - INT m,n,o,p,q,r,s,t,u,v,w,x,y,z,l INT SkylinePosition,SkylineType,SkylineColor,SkylineColor2,transparency FLOAT a ',b,c:FLOAT CREATESCREEN(sx,sy,bpp) LABEL NewPicture SETCURSOR frontbuffer, @CSCUSTOM frontpen frontbuffer,rgb(255,255,255) drawmode frontbuffer,@TRANSPARENT setfont frontbuffer,"",16,600 if SSText = 0 then writetext(20,sy-100,"Generating Image",frontbuffer) FILLSCREEN 0 SkylinePosition=rand(sy/2,sy-(sy/4)) SkylineColor=rgb(Rand(10,64)*4,Rand(10,64)*4,Rand(10,64)*4) SkylineColor2=rgb(Rand(20,55)*4,Rand(20,55)*4,Rand(20,55)*4) drawfilledrect(0,0,sx,skylinePosition,SkylineColor2) 'Shooting stars r=rand(-10,10) ' Num of stars m=rand(20,150) v=rand(1,2) : if v = 1 then m =-m n=rand(5,120) q=0 while r>q s=m t=n x=rand(0,sx) y=rand(0,skylineposition-(skylineposition/4)) w=rgb(rand(200,255),rand(200,255),rand(200,255)) for z = 0 to rand(32,256) step (128/rand(10,30)) drawAlphaline(x,y,x-(s),y-(t),w,z) s=s*.8 t=t*.8 next z q++ endwhile 'Color Skyline Fade drawline(0,SkylinePosition,sx,SkylinePosition,rgb(255,255,255)) a=255 'transparency=255 for y = SkylinePosition to 0 step -1 a=a-(255/(skylineposition/2)) transparency=a if transparency<0 then GOTO Exit1 drawAlphaline(0,y,sx,y,SkylineColor,transparency) next y LABEL Exit1 'blackfade x=rand(sy/8,sy/2) z=rand(sy/8,sy/2) a=255 w=rand(1,29) x=(x/2)*2+1 : if (Right$(STR$(x),1)="5") then x+=2 z=(z/2)*2+1 : if (Right$(STR$(z),1)="5") then z+=2 for y = 0 to sx+z if (w<20) : a=a-.6 : else : a=a-.75 : endif transparency=a : if transparency<0 then goto Exit4 if (w>=1) & (w<=9) then drawAlphaline(0,y,sx,y-x,0,transparency) if (w>=10) & (w<=19) then drawAlphaline(sx,y,0,y-z,0,transparency) if (w>=20) & (w<=29) drawAlphaline(sx,y,0,y-z,0,transparency) drawAlphaline(0,y,sx,y-x,0,transparency) endif next y LABEL Exit4 'Starfield transparency=256 for y = 0 to (SkylinePosition-(sx/8)) z=rand(100,255) transparency=transparency-1 : if transparency<0 then transparency=0 writeAlphaPixel(rand(sx),y,rgb(z,z,z),transparency) next y r=rand(1,5) s=0 while sq s=m t=n x=rand(0,sx) y=rand(0,skylineposition/2) w=rgb(rand(200,255),rand(200,255),rand(200,255)) for z = 0 to rand(32,256) step (128/rand(10,30)) drawAlphaline(x,y,x-(s),y-(t),w,z) s=s*.8 : t=t*.8 next z q+=1 endwhile SkylineType=rand(1,4) SELECT SkylineType CASE 1 ' City Skyline ============================================== x=0 do 'Baseline Buildings s=rand(10,50) y=rand(skylineposition-40,skylineposition-10) DrawfilledRect(x,y,s,skylineposition-y+1,0) x+=s until x >= sx for q = 0 to rand(20,40) Gosub DrawBuilding next q r=rand(1,3) if r = 1 then GOSUB DrawChainFence if r = 3 then GOSUB DrawBoardFence CASE 2 ' Farm Skyline ============================================== GOSUB DrawGrass GOSUB DrawWeed t=rand(1,2) : if t=2 : GOSUB DrawSilo : endif t=rand(1,2) : if t=1 : GOSUB DrawHouse : endif q=rand(1,4) if q = 1 then GOSUB DrawFarmFence if q = 2 then GOSUB DrawChainFence if q = 3 then GOSUB DrawBoardFence q=rand(0,2) : r=0 : while r"") | (MOUSEDOWN(1)) if (keydown(0x01)=0) then GOTO NewPicture endif if SSMode=1 if SSTimer < MILLISECS()-TempTimer then goto NewPicture endif UNTIL Keydown(0x01) LABEL quit CLOSESCREEN end ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SUB DrawBuilding() r=rand(1,5) select r case 1 : 'Plain Building x = rand(0,sx) y = rand((SkylinePosition/2),SkylinePosition-50) DrawFilledRect(x,y,rand(sx/50,sx/8),sy,0) case 2 : 'Empire Building x = rand(0,sx) y = rand((SkylinePosition/2),SkylinePosition-50) w = rand(sx/50,sx/8) : if w<1 then w=1 DrawFilledRect(x,y,w,sy,0) DrawFilledRect(x+(w/4),y-rand(10,30),w/2,sy,0) DrawFilledRect(x+(w/4)+(w/8),y-rand(40,60),w/4,sy,0) case 3 'Peaked Roof x = rand(1,sx) y = rand((SkylinePosition/2),SkylinePosition-50) w = rand(sx/50,sx/8) t = rand(5,w) : if t>(w-25) then t = w-25 : if t<2 then t=2 s = rand(15,20) DrawFilledRect(x,y,w,skylineposition-(skylineposition-y)+2,0) SETLINESTYLE(backbuffer,@LSSOLID,4) line(backbuffer,(x+t),y,(x+t+5),(y-s),0) line(backbuffer,(x+t+(s/2)),y,(x+t+(s/4)),(y-s),0) line(backbuffer,(x+t),y+5,(x+t+5),(y-s)+5,0) line(backbuffer,(x+t+(s/2)),y+5,(x+t+5),(y-s)+10,0) line(backbuffer,(x+t),y+10,(x+t+5),(y-s)+10,0) line(backbuffer,(x+t+(s/2)),y+10,(x+t+5),(y-s)+10,0) SETLINESTYLE(backbuffer,@LSSOLID,rand(1,2)) line(backbuffer,(x+t+(s/4)),y-rand(25,75), (x+t+(s/4)),skylineposition,0) case 4 ' Antenna x = rand(0,sx) : 'building pos y = rand((SkylinePosition/2),SkylinePosition-50) : ' top of building pos z = rand(sx/50,sx/8) : ' building width w = rand(1,z) : ' antenna pos v = rand(5,20) : ' antenna height u = rand(-5,5) : ' antenna angle s = rand(10,75) : ' antenna height 2 DrawFilledRect(x,y,z,sy,0) SETLINESTYLE(backbuffer,@LSSOLID,1) t = rand(1,3) SELECT t CASE 1 line(backbuffer, x+w, y+u, x+w, y-v, 0) line(backbuffer, x+w-v, y-v+u, x+w+v, y-v,0) line(backbuffer, x+w-v+4, y-v+2+u, x+w+v-4, y-v+2,0) line(backbuffer, x+w-v+8, y-v+4+u, x+w+v-8, y-v+4,0) DRAWFILLEDRECT(x+w-2, y-(v/3), 6, 15, 0) CASE 2 line(backbuffer, x+w, y, x+w, y-s, 0) line(backbuffer, x+w-5, y-s+5, x+w+5, y-s+5,0) CASE 3 line(backbuffer, x+w, y, x+w, y-rand(10,100), 0) line(backbuffer, x+w-(v/2)-4, y-2, x+w+(v/2)+4, y-2, 0) line(backbuffer, x+w-(v/2)-2, y-4, x+w+(v/2)+2, y-4, 0) line(backbuffer, x+w-(v/2), y-6, x+w+(v/2), y-6, 0) ENDSELECT case 5 'Dometop Building x = rand(0,sx) y = rand((SkylinePosition/1.5),SkylinePosition-50) w = rand(sx/25,sx/8) SETLINESTYLE(backbuffer,@LSSOLID,w) line(backbuffer,x,y,x,skylineposition,0) r = rand(1,2) if r = 1 SETLINESTYLE(backbuffer,@LSSOLID,1) line(backbuffer,x,y,x, y-(w),0) SETLINESTYLE(backbuffer,@LSSOLID,5) line(backbuffer,x,y,x, y-(w/1.5),0) endif endselect ENDSUB SUB DrawGrass() SETLINESTYLE(backbuffer,@LSSOLID,1) for x = 0 to sx : ' Grass drawline(x,rand(skylineposition-20,skylineposition),x,skylineposition,0) next x for t = 0 to rand(10,40) x=rand(0,sx) for u = 0 to rand(1,8) line(backbuffer,x+rand(-5,5),skylineposition,x+rand(-15,15),rand(skylineposition-40,skylineposition-22),0) next u next t ENDSUB ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SUB DrawWeed() for u = 0 to rand(1,8) x=rand(0,sx) q=rand(1,2) if q=1 for s = 0 to rand(1,5) x=x+rand(-15,15) y=skylineposition-rand(25,50) z=rand(-25,25) SETLINESTYLE(backbuffer,@LSSOLID,2) line(backbuffer,x,y,x+z,SkylinePosition,0) SETLINESTYLE(backbuffer,@LSSOLID,4) line(backbuffer,x,y,x-(z/2),y-((skylineposition-y)/4),0) next s else y=skylineposition SETLINESTYLE(backbuffer,@LSSOLID,1) for s = 0 to rand(25,50) line(backbuffer,x+s,y,x+s+rand(-15,15),y-rand(25,50),0) next s endif next u ENDSUB ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SUB DrawFarmFence() y=rand(skylineposition-150,skylineposition-100) 'Post heights z=rand(4,8) ' Number of posts SETLINESTYLE(backbuffer,@LSSOLID,rand(3,30)) 'crossmember widths w=rand(1,3) if w=1 ' Right side fence for x = rand(sx/2) to (sx) step sx/z drawFilledrect(x,y+rand(-5,5),rand(15,20),sy,0) line(backbuffer,x,y+rand(15,20),x+(sx/z),y+rand(15,20),0) line(backbuffer,x,(SkylinePosition-y)/3+y+rand(15,25),x+(sx/z),(SkylinePosition-y)/3+y+rand(15,25),0) line(backbuffer,x,(SkylinePosition-y)/1.5+y+rand(15,25),x+(sx/z),(SkylinePosition-y)/1.5+y+rand(15,25),0) next x endif if w=2 ' Left side fence for x = 0 to (sx-rand(sx/2)) step sx/z drawFilledrect(x,y+rand(-5,5),rand(15,20),sy,0) line(backbuffer,x,y+rand(15,20),x+(sx/z),y+rand(15,20),0) line(backbuffer,x,(SkylinePosition-y)/3+y+rand(15,20),x+(sx/z),(SkylinePosition-y)/3+y+rand(15,20),0) line(backbuffer,x,(SkylinePosition-y)/1.5+y+rand(15,20),x+(sx/z),(SkylinePosition-y)/1.5+y+rand(15,20),0) next x x=x-rand(15,25) drawFilledrect(x,y+rand(-5,5),rand(15,20),sy,0) endif if w=3 ' Full fence for x = 0 to (sx) step sx/z drawFilledrect(x,y+rand(-5,5),rand(15,20),sy,0) line(backbuffer,x,y+rand(15,20),x+(sx/z),y+rand(15,20),0) line(backbuffer,x,(SkylinePosition-y)/3+y+rand(15,20),x+(sx/z),(SkylinePosition-y)/3+y+rand(15,20),0) line(backbuffer,x,(SkylinePosition-y)/1.5+y+rand(15,20),x+(sx/z),(SkylinePosition-y)/1.5+y+rand(15,20),0) next x endif ENDSUB ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SUB DrawPineTree() z=x m=rand(-15,15) SETLINESTYLE(backbuffer,@LSSOLID,rand(10,15)) 'Tree Width y = SkylinePosition-rand(SkylinePosition/6,SkylinePosition/1.5) ' Tree height line(backbuffer,z-m,SkylinePosition,z,y,0) line(backbuffer,z+m,SkylinePosition,z,y+10,0) line(backbuffer,z,SkylinePosition,z,y+10,0) w=rand(10,20) for m = y to skylineposition step rand(3,6) SETLINESTYLE(backbuffer,@LSSOLID,rand(3,8)) 'Tree branch Width line(backbuffer,z,m,z-w,m+rand(10,20),0) line(backbuffer,z,m,z+w,m+rand(10,20),0) w+=1 next m ENDSUB ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SUB DrawSilo() y=SkylinePosition-(rand(100,200)) ' height SETLINESTYLE(backbuffer,@LSSOLID,skylineposition-y) ' Silo size x=rand(15,sx-55) ' silo positiom line(backbuffer,x,SkylinePosition,x,y,0) ENDSUB ' - - - - - - - - - - - - - - - - - - - - - - - - SUB DrawHouse() y=SkylinePosition-(rand(100,200)) ' height x=rand(-10,sx+10) q=rand(1,2) if q = 1 n=x+((skylineposition-y)/4)+rand(skylineposition-y)/2 m=rand(10,25) l=(SkylinePosition-y)+(rand(SkylinePosition-y)/2) drawfilledrect(n,y,l,(skylineposition-y)+1,0) SETLINESTYLE(backbuffer,@LSSOLID,m) line(backbuffer,n+(m/2),y+(m/2)+1,n,y+((skylineposition-y)/2),0) line(backbuffer,n-(m/2)+l,y+(m/2)+1,n+l,y+((skylineposition-y)/2),0) endif if q = 2 n=x-((skylineposition-y)/4)-((SkylinePosition-y)+((SkylinePosition-y)/2)) m=rand(20,(skylineposition-y)/5) l=(SkylinePosition-y)+(rand(SkylinePosition-y)/2) drawfilledrect(n,y,l,(skylineposition-y)+1,0) SETLINESTYLE(backbuffer,@LSSOLID,m) line(backbuffer,n+(m/2),y+(m/2)+1,n,y+((skylineposition-y)/2),0) line(backbuffer,n,y+((skylineposition-y)/2),n,skylineposition,0) line(backbuffer,n+l-(m/2),y+(m/2)+1,n+l,y+((skylineposition-y)/2),0) line(backbuffer,n+l,y+((skylineposition-y)/2),n+l,skylineposition,0) endif ENDSUB ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SUB DrawChainFence() y=rand(skylineposition-200,skylineposition-50) : 'Post heights z=rand(4,7) ' Number of posts s=rand(8,12) w=rand(1,3) if w=1 ' Right side fence u=rand(sx/2) for x = u to sx step sx/z SETLINESTYLE(backbuffer,@LSSOLID,s) : 'crossmember widths line(backbuffer,x+rand(-2,2),y,x,sy,0) line(backbuffer,x+(s/2),y+3+(s/2)+rand(-1,1),x+(sx/z),y+3+(s/2)+rand(-1,1),0) for t = x to x+(sx/z)-((sx/z)/10) step ((sx/z)/10) drawaaline(t+rand(-2,2), y-(rand(0,2)), t+(sx/z)+rand(-2,2), skylineposition,0) drawaaline(t+rand(-2,2), skylineposition , t+(sx/z)+rand(-2,2), y-(rand(0,2)),0) next t next x x=u-sx/z+((skylineposition-y)/10) v=skylineposition-z p=y for t = x to x+(sx/z)-((sx/z)/10)-((sx/z)/10) step ((sx/z)/10) v=v-((skylinePosition-y)/10) p=p+((skylinePosition-y)/10) drawaaline(u+rand(-2,2), v-(rand(0,2)), t+(sx/z)+rand(-2,2), skylineposition,0) drawaaline(u+rand(-2,2), p-(rand(0,2)), t+(sx/z)+rand(-2,2), y-(rand(0,2)),0) next t endif if w=2 ' Left side fence u=rand(sx/2) for x = -(sx/z) to u step sx/z SETLINESTYLE(backbuffer,@LSSOLID,s) : 'crossmember widths line(backbuffer,x+rand(-2,2),y,x,sy,0) line(backbuffer,x+(s/2),y+3+(s/2)+rand(-1,1),x+(sx/z),y+3+(s/2)+rand(-1,1),0) for t = x+(sx/z)-((sx/z)/10) to x step -((sx/z)/10) drawaaline(t+rand(-2,2), y-(rand(0,2)), t+(sx/z)+rand(-2,2), skylineposition,0) drawaaline(t+rand(-2,2), skylineposition , t+(sx/z)+rand(-2,2), y-(rand(0,2)),0) next t next x u=x SETLINESTYLE(backbuffer,@LSSOLID,s) : 'crossmember widths line(backbuffer,x+rand(-2,2),y,x,sy,0) line(backbuffer,x+(s/2),y+3+(s/2)+rand(-1,1),x+(sx/z),y+3+(s/2)+rand(-1,1),0) x=x+(sx/z) line(backbuffer,x+rand(-2,2),y,x,sy,0) x=u-sx/z v=skylineposition-z p=y for t = x to x+(sx/z)-((sx/z)/10)-((sx/z)/10) step ((sx/z)/10) drawaaline(u+(sx/z)+rand(-2,2), p-(rand(0,2)), t+(sx/z)+rand(-2,2), skylineposition,0) drawaaline(u+(sx/z)+rand(-2,2), v-(rand(0,2)), t+(sx/z)+rand(-2,2), y-(rand(0,2)),0) v=v-((skylinePosition-y)/10) p=p+((skylinePosition-y)/10) next t endif if w=3 ' Full fence for x = -sx/z to sx step sx/z SETLINESTYLE(backbuffer,@LSSOLID,s) : 'crossmember widths line(backbuffer,x+rand(-2,2),y,x,sy,0) line(backbuffer,x+(s/2),y+3+(s/2)+rand(-1,1),x+(sx/z),y+3+(s/2)+rand(-1,1),0) for t = x to x+(sx/z)-((sx/z)/10) step ((sx/z)/10) drawaaline(t+rand(-2,2), y-(rand(0,2)), t+(sx/z)+rand(-2,2), skylineposition,0) drawaaline(t+rand(-2,2), skylineposition , t+(sx/z)+rand(-2,2), y-(rand(0,2)),0) next t next x endif ENDSUB ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SUB DrawPeople() z=rand(16,72) y=Skylineposition-z ' People height SETLINESTYLE(backbuffer,@LSSOLID,z) x=rand(40,sx-40) ' People pos line(backbuffer,x,Skylineposition,x,y,0) line(backbuffer,x+(z),Skylineposition,x+(z),y,0) line(backbuffer,x+(z/2),Skylineposition,x+(z/2),y-10,0) circle(backbuffer,x+(z/2),y-z,z/16,0,0) ENDSUB ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SUB DrawBoardFence() y=rand(skylineposition/4,skylineposition-(skylineposition/4)) 'Post heights z=rand(16,64) ' Number of posts v=(skylineposition-y)/5 SETLINESTYLE(backbuffer,@LSSOLID,v) 'crossmember widths w=rand(1,3) if w=1 ' left side fence s=rand(sx/4,sx/2) for x = 0 to s step v+(v/10) l=rand(1,10) if ((l <> 1) | (p>=s-(v*2))) then line(backbuffer,x+rand(-1,1), y+rand(-2,2), x+rand(-1,1),skylineposition,0) p+=1 next x m=x-v+(v/10)+rand(0,(v/2)+(v/4)) n=rand(10,30) drawfilledrect(0,y+rand(10,20),m,v/2,0) drawfilledrect(0,skylineposition-rand((v/2)+5,(v/2)+20),m-rand(1,5),v/2,0) endif if w=2 ' Right side fence o = rand(sx/2,sx-(sx/8)) p=0 for x = o to (sx+v) step v+(v/10) l=rand(1,10) if ((l <> 1) | (p=0)) then line(backbuffer,x+rand(-1,1), y+rand(-2,2), x+rand(-1,1),skylineposition,0) p+=1 next x m=x-v+(v/10)+rand(0,(v/2)+(v/4)) n=rand(10,30) drawfilledrect(o-rand(v/4,(v/2)),y+rand(10,20),m,v/2,0) drawfilledrect(o-rand(v/4,(v/2)),skylineposition-rand((v/2)+5,(v/2)+20),m-rand(1,5),v/2,0) endif if w=3 ' Full fence y=rand(skylineposition-(skylineposition/4),skylineposition-(skylineposition/8)) v=(skylineposition-y)/5 SETLINESTYLE(backbuffer,@LSSOLID,v) : 'crossmember widths for x = 0 to (sx+v) step v+(v/10) line(backbuffer,x+rand(-1,1), y+rand(-2,2), x+rand(-1,1),skylineposition,0) next x m=x-v+(v/10)+rand(0,(v/2)+(v/4)) n=rand(10,30) drawfilledrect(0-rand(v/4,(v/2)),y+rand(10,20),m,v/2,0) drawfilledrect(0-rand(v/4,(v/2)),skylineposition-rand((v/2)+5,(v/2)+20),m-rand(1,5),v/2,0) endif ENDSUB ' --------------------------------------------------- SUB OptionsDlgProc(),INT SELECT @MESSAGE CASE @IDINITDIALOG ADDSTRING OptionsDlg,10,"640 x 480" ADDSTRING OptionsDlg,10,"800 x 600" ADDSTRING OptionsDlg,10,"1024 x 768" SETSELECTED OptionsDlg,10,0 ADDSTRING OptionsDlg,11,"16 bit color" ADDSTRING OptionsDlg,11,"32 bit color" SETSELECTED OptionsDlg,11,0 SETSTATE OptionsDlg,12,1 SENDMESSAGE OptionsDlg,0x400+101,1,60,15 SENDMESSAGE OptionsDlg,0x400+103,0,5,15 centerwindow OptionsDlg CASE @IDCONTROL IF @CONTROLID=12 IF (GETSTATE(OptionsDlg,12) = 1) ENABLECONTROL OptionsDlg,13,1 ENABLECONTROL OptionsDlg,14,1 ENABLECONTROL OptionsDlg,15,1 ELSE ENABLECONTROL OptionsDlg,13,0 ENABLECONTROL OptionsDlg,14,0 ENABLECONTROL OptionsDlg,15,0 ENDIF ENDIF IF @CONTROLID=@IDCANCEL then closedialog OptionsDlg,@IDCANCEL IF @CONTROLID=@IDOK If (GetSelected(optionsdlg,10)=0) sx=640 sy=480 endif If (GetSelected(optionsdlg,10)=1) sx=800 sy=600 endif If (GetSelected(optionsdlg,10)=2) sx=1024 sy=768 endif IF (GetSelected(optionsdlg,11=0)) then bpp = 16 IF (GetSelected(optionsdlg,11=1)) then bpp = 32 IF (GetStaTe(OptionsDlg,12)=1) SSMode=1 SSTimer=VAL(LTRIM$(RTRIM$(GetControlText(OptionsDlg,14))))*1000 ENDIF SSText=Getstate(OptionsDlg,16) closedialog OptionsDlg,@IDOK ENDIF ENDSELECT RETURN 0 ENDSUB