/* 3d Window - aout.97 - par Sylvain Huet */ struct H6Win= [chH6Win:Chn,winH6Win:ObjWin,endH6Win:fun [] I, destH6Win:ObjBitmap,srcH6Win:ObjBitmap, fileH6Win:File,togoH6Win:I ]mkH6Win;; var H6WIN_DDRAW=1;; fun _paintevent(a,b)= _BLTbitmap b.winH6Win b.destH6Win 0 0 ;; fun _keydownE (t,b,code,val)= if val==27 then (_DSwindow b.winH6Win; _DSbitmap b.destH6Win; _DSbitmap b.srcH6Win; exec b.endH6Win with []) else nil;; fun _ClockE(t,b)= if b.togoH6Win then let b.destH6Win -> dest in let b.srcH6Win -> src in (HNM6readIX b.fileH6Win dest src; _BLTbitmap b.winH6Win dest 0 0; set b.togoH6Win=b.togoH6Win-1; set b.destH6Win=src; set b.srcH6Win=dest; 0) else (_deltimer t; _FILEClose b.fileH6Win; set b.fileH6Win=nil; 0);; fun _DestroyE(x,b)= _DSbitmap b.destH6Win; _DSbitmap b.srcH6Win; exec b.endH6Win with [];; fun iniH6Win(ch,father,title,end,flag)= let _CRwindow ch father nil nil 640 480 if flag&H6WIN_DDRAW then WN_NOBORDER+WN_NOCAPTION else WN_MENU+WN_MINBOX title -> win in let _CRbitmap ch 640 480 ->dest in let _CRbitmap ch 640 480 ->src in let mkH6Win [ch win end dest src nil nil] -> b in (_CBwinDestroy win @_DestroyE b; _CBwinPaint win @_paintevent b; _CBwinKeydown win @_keydownE b; if flag&H6WIN_DDRAW then DDRAWdefine b.winH6Win 640 480 else nil; _paintevent nil b; b );; fun loadH6Win(b,p)= if b.fileH6Win != nil then -1 else let _FILEOpen b.chH6Win p -> f in let HNM6header f -> [_ [x y] nb] in if x!=640 || y!=480 then (_fooS strcatn (itoa x)::"x"::(itoa y)::nil; -2) else (set b.fileH6Win=f; set b.togoH6Win=nb; _rfltimer _starttimer b.chH6Win 10 @_ClockE b; 0);;