/* Fog Plugin - DMS2 - November 99 - by Sébastien DENEUX */ typeof class=S;; typeof zmiddleEd=I;; /*-------------*/ fun enableFog()= let M3getCamera session cam -> [a b [zclip zmiddle zmax]] in M3setCamera session cam [a b [zclip zmiddleEd zmax]]; 0;; /*-------------*/ fun disableFog()= let M3getCamera session cam -> [a b [zclip _ zmax]] in M3setCamera session cam [a b [zclip zmax zmax]]; 0;; /*-------------*/ fun activate(o,from,action,param,reply)= if !strcmp action (strcatn (ObName o)::".enableFog"::nil) then enableFog else if !strcmp action (strcatn (ObName o)::".disableFog"::nil) then disableFog else nil;; /*-------------*/ fun cbcomm(ui,action,param,o)= if !strcmp action "setFog" then if !strcmp param "1" then enableFog else if !strcmp param "0" then disableFog else nil else nil;; /*-------------*/ fun newOb(o)= let M3getCamera session cam -> [a b [zclip zmiddle zmax]] in if (!strcmp hd UgetParam ObUi o "softfog" "0") && !MX3hardware then (M3setCamera session cam [a b [zclip zmax zmax]];0) else ( set zmiddleEd=zmiddle; UcbComm this ObUi o mkfun4 @cbcomm o; UsendSrv this ObUi o "fog?" nil; ObRegisterAction o (strcatn (ObName o)::".enableFog"::nil) @activate; ObRegisterAction o (strcatn (ObName o)::".disableFog"::nil) @activate; 0 );; /*-------------*/ fun IniPlug(file)= set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @newOb nil; 0;;