HILITE.C

Go to the documentation of this file.
00001 /* --
00002 OpenFX version 2.0 - Modelling, Animation and Rendering Package
00003 Copyright (C) 2000 - OpenFX Development Team
00004 
00005 This program is free software; you can redistribute it and/or
00006 modify it under the terms of the GNU General Public License
00007 as published by the Free Software Foundation; either version 2
00008 of the License, or (at your option) any later version.
00009 
00010 This program is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 GNU General Public License for more details.
00014 
00015 You should have received a copy of the GNU General Public License
00016 along with this program; if not, write to the Free Software
00017 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00018 
00019 You may contact the OpenFX development team via elecronic mail
00020 at core@openfx.org, or visit our website at http://openfx.org for
00021 further information and support details.
00022 -- */
00023 
00024 /* hilite.c  image post-processor                                         */
00025 
00026 #include <stdlib.h>
00027 #include <stdio.h>
00028 #include <float.h>
00029 #include <math.h>
00030 #include <windows.h>
00031 #include "struct.h"           /* general structures    */
00032 #include "..\common\postprocess\ximage.h"
00033 #include "local.h"
00034 
00035 #include "hilite.h"
00036 
00037 #if __X__MIPS__
00038 BOOL WINAPI _CRT_INIT(HINSTANCE ,DWORD , LPVOID );
00039 #endif
00040 
00041 static HINSTANCE hDLLinstance=NULL; /* use to pick up resources from DLL   */
00042 static long version=1;
00043 
00044 #include "utils.h"
00045 
00046 #include "paint.c"
00047 
00048 #if __WATCOMC__
00049 int APIENTRY LibMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00050 #elif __BC__
00051 BOOL WINAPI DllEntryPoint(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00052 #else
00053 BOOL WINAPI DllMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00054 #endif
00055   switch (dwReason) {
00056     case DLL_PROCESS_ATTACH:
00057 #if __X__MIPS__
00058       if(!_CRT_INIT(hDLL,dwReason,lpReserved))return(int)FALSE;
00059 #endif
00060       hDLLinstance = hDLL;  /* handle to DLL file */
00061       break;
00062     case DLL_PROCESS_DETACH:
00063 #if __X__MIPS__
00064       if(!_CRT_INIT(hDLL,dwReason,lpReserved))return(int)FALSE;
00065 #endif
00066       break;
00067   }
00068 return (int)TRUE;
00069 }
00070 
00071 #if __SC__
00072 #pragma startaddress(DllMain)
00073 #endif
00074 
00075 static void SetColour(unsigned char *colour, HWND parent){
00076  CHOOSECOLOR cc;
00077  static COLORREF CustColours[16]={
00078    RGB(255,255,255), RGB(239,239,239), RGB(223,223,223), RGB(207,207,207),
00079    RGB(191,191,191), RGB(175,175,175), RGB(159,159,159), RGB(143,143,143),
00080    RGB(127,127,127), RGB(111,111,111), RGB( 95, 95, 95), RGB( 79, 79, 79),
00081    RGB( 63, 63, 63), RGB( 47, 47, 47), RGB( 31, 31, 31), RGB( 15, 15, 15) };
00082  cc.lStructSize=sizeof(CHOOSECOLOR);
00083  cc.hwndOwner=parent;
00084  cc.rgbResult=RGB((BYTE)colour[0],(BYTE)colour[1],(BYTE)colour[2]);
00085  cc.lpCustColors=(LPDWORD)CustColours;
00086  cc.Flags= CC_RGBINIT;
00087  cc.lCustData=(DWORD)0;
00088  if(ChooseColor(&cc)){
00089    colour[0]=(unsigned char)GetRValue(cc.rgbResult);
00090    colour[1]=(unsigned char)GetGValue(cc.rgbResult);
00091    colour[2]=(unsigned char)GetBValue(cc.rgbResult);
00092  }
00093 }
00094 
00095 static void DrawInBuffer1(long x, long y, fullscreenbuffer *Screen,
00096                           long X, long Y, long radius,
00097                           double r, double g, double b){
00098  /* mix in a white halo at the screen buffer location of the light source */
00099  long i,j;
00100  double d;
00101  fullscreenbuffer *S;
00102  for(i=x-radius;i<=x+radius;i++)for(j=y-radius;j<=y+radius;j++){
00103    if(i < 0 || i >= X || j < 0 || j >= Y)continue;
00104    S=(Screen + j*X + i);
00105    if(radius < 1)d=1.0;
00106    else{
00107      d=sqrt((double)(i-x)*(double)(i-x) + (double)(j-y)*(double)(j-y));
00108      d=255.0*((double)radius-d)/(double)radius;
00109      d=max(0.0,d);
00110    }
00111    /* mix to colour */
00112    S->R = (unsigned char)min(255.0,(double)S->R+d*r);
00113    S->G = (unsigned char)min(255.0,(double)S->G+d*g);
00114    S->B = (unsigned char)min(255.0,(double)S->B+d*b);
00115  }
00116  return;
00117 }
00118 
00119 void DrawInBuffer(fullscreenbuffer *Screen, int Xmax, int Ymax,
00120                   int x, int y, double v,
00121                   double rr, double gg, double bb){
00122  int r,g,b;
00123  fullscreenbuffer *S;
00124  if(x < 0 || y < 0 || x >= Xmax || y >= Ymax)return;
00125  S=(Screen+y*Xmax+x);
00126  r=(int)S->R+(int)((double)v*rr);
00127  g=(int)S->G+(int)((double)v*gg);
00128  b=(int)S->B+(int)((double)v*bb);
00129  S->R=(r>255) ? 255:r;
00130  S->G=(g>255) ? 255:g;
00131  S->B=(b>255) ? 255:b;
00132 }
00133 
00134 #define frac(z) fmod(z,1.0)
00135 
00136 void DrawAApixel(double x, double y, double w, double h, double C,
00137                  fullscreenbuffer *S, int X, int Y,
00138                  double r, double g, double b){
00139   int xa,xb,ya,yb,i,j,brite;
00140   double x2,y2,lfrac,rfrac,tfrac,bfrac,xfrac,yfrac;
00141 //  if(w > 4 || h > 4){
00142 //    DrawInBuffer1((long)x,(long)y,S,X,Y,(long)w,
00143 //                   r*C/255.0,g*C/255.0,b*C/255.0);
00144 //    return;
00145 //  }
00146   brite=(int)C;
00147   if(x < 0 || y < 0)return;
00148   x -= w*0.5; y -= h*0.5;
00149   x2 = x + w;
00150   y2 = y + w;
00151   xa = (int)x;
00152   xb = (int)x2;
00153   ya = (int)y;
00154   yb = (int)y2;
00155   lfrac = 1.0-frac(x);
00156   rfrac = frac(x2);
00157   tfrac = 1.0-frac(y);
00158   bfrac = frac(y2);
00159   if (xa==xb) {
00160     xfrac = lfrac+rfrac-1.0;
00161     if (ya==yb) {
00162       DrawInBuffer(S,X,Y,xa,ya,xfrac*(tfrac+bfrac-1.0)*brite,r,g,b);
00163     }
00164     else {
00165       DrawInBuffer(S,X,Y,xa,ya,xfrac*tfrac*brite,r,g,b);
00166       for (j=ya+1; j<yb; j++) DrawInBuffer(S,X,Y,xa,j,xfrac*brite,r,g,b);
00167       DrawInBuffer(S,X,Y,xa,yb,xfrac*bfrac*brite,r,g,b);
00168     }
00169   }
00170   else {
00171     if (ya==yb) {
00172       yfrac = tfrac+bfrac-1.0;
00173       DrawInBuffer(S,X,Y,xa,ya,yfrac*lfrac*brite,r,g,b);
00174       for (i=xa+1; i<xb; i++) DrawInBuffer(S,X,Y,i,ya,yfrac*brite,r,g,b);
00175       DrawInBuffer(S,X,Y,xb,ya,yfrac*rfrac*brite,r,g,b);
00176     }
00177     else {
00178       DrawInBuffer(S,X,Y,xa,ya,tfrac*lfrac*brite,r,g,b);
00179       for (i=xa+1; i<xb; i++) DrawInBuffer(S,X,Y,i,ya,tfrac*brite,r,g,b);
00180       DrawInBuffer(S,X,Y,xb,ya,tfrac*rfrac*brite,r,g,b);
00181       for (j=ya+1; j<yb; j++) {
00182         DrawInBuffer(S,X,Y,xa,j,lfrac*brite,r,g,b);
00183         for (i=xa+1; i<xb; i++)DrawInBuffer(S,X,Y,i,j,brite,r,g,b);
00184         DrawInBuffer(S,X,Y,xb,j,rfrac*brite,r,g,b);
00185       }
00186       DrawInBuffer(S,X,Y,xa,yb,bfrac*lfrac*brite,r,g,b);
00187       for (i=xa+1; i<xb; i++) DrawInBuffer(S,X,Y,i,yb,bfrac*brite,r,g,b);
00188       DrawInBuffer(S,X,Y,xb,yb,bfrac*rfrac*brite,r,g,b);
00189     }
00190   }
00191 }
00192 
00193 #define DIST(i,j)  sqrt((double)i * (double)i + (double)j * (double)j)
00194 
00195 static double GetW(double l, double dx, double dy,
00196                    double Wmin, double Wmax,
00197                    BOOL linear){
00198  double d,f;
00199  d=DIST(dx,dy);
00200  f=d/l;
00201  return (Wmax-(Wmax-Wmin)*f);
00202 }
00203 
00204 static double GetC(double l, double dx, double dy,
00205                    double Wmin, double Wmax,
00206                    BOOL linear){
00207  double d,f;
00208  d=DIST(dx,dy);
00209  f=d/l;
00210  if(f < 0.5)return Wmax;
00211  return (Wmin+(Wmax-Wmin)*2.0*(1.0-f));
00212 }
00213 
00214 static void DrawFlareInBuffer(long x, long y, long idx, long idy,
00215                               fullscreenbuffer *Screen,
00216                               long X, long Y,
00217                               double Cin,
00218                               double r, double g, double b,
00219                               double Wmin, double Wmax,
00220                               double z, float *Zb,
00221                               BOOL bDraw, long hide, BOOL linear){
00222  long i,j;
00223  double grad,error,W,l,C;
00224  C=Cin;
00225  l=DIST(idx,idy);
00226  if(abs(idx) >= abs(idy)){
00227    grad=(double)idy/(double)idx; j=y;
00228    if(idy >= 0)error = -0.5; else error = 0.5;
00229    if(idx >= 0){
00230      for(i=x;i<x+idx;i++){
00231        error += grad;
00232        if(idy >= 0){
00233          if(error > 0.0){j++; error -= 1.0;}
00234        }
00235        else{
00236          if(error < 0.0){j--; error += 1.0;}
00237        }
00238        W=GetW(l,(double)(i-x),(double)(j-y),Wmin,Wmax,linear);
00239        if(!linear)C=GetC(l,(double)(i-x),(double)(j-y),Cin*0.25,Cin,TRUE);
00240        DrawAApixel((double)i,(double)j,W,W,C,Screen,X,Y,r,g,b);
00241      }
00242    }
00243    else{
00244      for(i=x;i>x+idx;i--){
00245        error -= grad;
00246        if(idy >= 0){
00247          if(error > 0.0){j++; error -= 1.0;}
00248        }
00249        else{
00250          if(error < 0.0){j--; error += 1.0;}
00251        }
00252        W=GetW(l,(double)(i-x),(double)(j-y),Wmin,Wmax,linear);
00253        if(!linear)C=GetC(l,(double)(i-x),(double)(j-y),Cin*0.25,Cin,TRUE);
00254        DrawAApixel((double)i,(double)j,W,W,C,Screen,X,Y,r,g,b);
00255      }
00256    }
00257  }
00258  else{
00259    grad=(double)idx/(double)idy; j=x;
00260    if(idx >= 0)error = -0.5; else error = 0.5;
00261    if(idy >= 0){
00262      for(i=y;i<y+idy;i++){
00263        error += grad;
00264        if(idx >= 0){
00265          if(error > 0.0){j++; error -= 1.0;}
00266        }
00267        else{
00268          if(error < 0.0){j--; error += 1.0;}
00269        }
00270        W=GetW(l,(double)(j-x),(double)(i-y),Wmin,Wmax,linear);
00271        if(!linear)C=GetC(l,(double)(j-x),(double)(i-y),Cin*0.25,Cin,TRUE);
00272        DrawAApixel((double)j,(double)i,W,W,C,Screen,X,Y,r,g,b);
00273      }
00274    }
00275    else{
00276      for(i=y;i>y+idy;i--){
00277        error -= grad;
00278        if(idx >= 0){
00279          if(error > 0.0){j++; error -= 1.0;}
00280        }
00281        else{
00282          if(error < 0.0){j--; error += 1.0;}
00283        }
00284        W=GetW(l,(double)(j-x),(double)(i-y),Wmin,Wmax,linear);
00285        if(!linear)C=GetC(l,(double)(j-x),(double)(i-y),Cin*0.25,Cin,TRUE);
00286        DrawAApixel((double)j,(double)i,W,W,C,Screen,X,Y,r,g,b);
00287      }
00288    }
00289  }
00290  return;
00291 }
00292 
00293 long _RenderImageProcess(char *PrmList, XIMAGE *lpXimage){
00294  int i,j;
00295  char dummy[255];
00296  double x,y,z,mr=0.0,r,g,b,d2r,a0;
00297  long xx,yy,radius,iradius,hide,miradius,type,id,param,c1,c2,c3,rotate,
00298       mparam,mc1,mc2,mc3,mhide,mtype,mid;
00299  float *Zb;
00300  BOOL  bDraw,bMorph=FALSE;
00301 #include "pro_key.c"
00302  if(lpXimage->Nlights == 0 || lpXimage->Lights == NULL)return 1;
00303  sscanf(PrmList,"%s %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld",dummy,&version,
00304         &iradius,&hide,&type,&id,&param,&c1,&c2,&c3,&rotate);
00305  if(lpXimage->Morph && lpXimage->mParameters != NULL){
00306    bMorph=TRUE; mr=lpXimage->MorphRatio;
00307    sscanf(lpXimage->mParameters,"%s %ld %ld %ld %ld %ld %ld %ld %ld %ld",
00308           dummy,&version,&miradius,
00309           &mhide,&mtype,&mid,&mparam,&mc1,&mc2,&mc3);
00310    iradius=(long)((double)miradius + mr*((double)iradius-(double)miradius));
00311    c1=(long)((double)mc1+mr*((double)c1-(double)mc1));
00312    c2=(long)((double)mc2+mr*((double)c2-(double)mc2));
00313    c3=(long)((double)mc3+mr*((double)c3-(double)mc3));
00314  }
00315  if(!bMorph){
00316    mr=(double)(lpXimage->last_frame - lpXimage->first_frame);
00317    if(mr < 1.0)return 1;
00318    mr=(double)(lpXimage->this_frame - lpXimage->first_frame)/mr;
00319  }
00320  d2r=3.1415626/180.0;
00321  a0= -95.0;
00322  if(rotate == 1)a0 += 360.0*mr;
00323  Zb=lpXimage->Zbuffer;
00324  for(i=0;i<lpXimage->Nlights;i++){
00325    if(type == 2 && lpXimage->Lights[i].type != DUMMYL)continue;
00326    if(type == 3 && lpXimage->Lights[i].AnimatorID != id)continue;
00327    x=lpXimage->Lights[i].p[0];
00328    y=lpXimage->Lights[i].p[1];
00329    z=lpXimage->Lights[i].p[2];
00330    if(y >= 1.000){
00331      xx=lpXimage->Xmax/2 +
00332        (long)(lpXimage->Xscale*x/y);
00333      yy=lpXimage->Ymax/2 -
00334        (long)(lpXimage->Yscale*z/y);
00335      if(xx >= 0 && xx < lpXimage->Xmax &&
00336         yy >= 0 && yy < lpXimage->Ymax){
00337        if(Zb != NULL){
00338          if(y < *(Zb + (yy * lpXimage->Xmax) + xx))bDraw=TRUE;
00339          else bDraw=FALSE;
00340          if(hide == 1 && !bDraw)continue;
00341        }
00342        else bDraw=TRUE;
00343        radius = (long)(lpXimage->Xscale*(double)iradius/y);
00344        r=(double)c1/255.0;
00345        g=(double)c2/255.0;
00346        b=(double)c3/255.0;
00347 //       DrawInBuffer1(xx,yy,lpXimage->Screen,
00348 //                     lpXimage->Xmax,lpXimage->Ymax,radius/5,
00349 //                     r,g,b);
00350        for(j=0;j<param;j++){  /* spines */
00351          double a,l,ddx,ddy;
00352          long   xs,ys,idx,idy;
00353          a= a0+360.0/(double)param*(double)j;
00354          a *= d2r;
00355          l=radius;
00356          ddx=l*cos(a); ddy=l*sin(a);
00357          idx=(long)ddx; idy=(long)ddy;
00358          DrawFlareInBuffer(xx,yy,idx,idy,
00359                            lpXimage->Screen,
00360                            lpXimage->Xmax,
00361                            lpXimage->Ymax,
00362                            255.0,
00363                            r,g,b,
00364                            0.0,(double)radius*0.02,
00365                            y,Zb,bDraw,hide,TRUE);
00366          DrawFlareInBuffer(xx,yy,idx,idy,
00367                            lpXimage->Screen,
00368                            lpXimage->Xmax,
00369                            lpXimage->Ymax,
00370                            4.0,
00371                            r,g,b,
00372                            (double)radius*0.1,(double)radius*0.08,
00373                            y,Zb,bDraw,hide,TRUE);
00374          l=(double)radius*2.0/3.0;
00375          ddx=l*cos(a); ddy=l*sin(a);
00376          idx=(long)ddx; idy=(long)ddy;
00377          DrawFlareInBuffer(xx,yy,idx,idy,
00378                            lpXimage->Screen,
00379                            lpXimage->Xmax,
00380                            lpXimage->Ymax,
00381                            5.0,
00382                            r,g,b,
00383                            0.0,(double)radius*0.1,
00384                            y,Zb,bDraw,hide,TRUE);
00385          l=(double)radius/2.0;
00386          ddx=l*cos(a); ddy=l*sin(a);
00387          idx=(long)ddx; idy=(long)ddy;
00388          DrawFlareInBuffer(xx,yy,idx,idy,
00389                            lpXimage->Screen,
00390                            lpXimage->Xmax,
00391                            lpXimage->Ymax,
00392                            8.0,
00393                            r,g,b,
00394                            0.0,(double)radius*0.15,
00395                            y,Zb,bDraw,hide,TRUE);
00396          l=(double)radius/3.0;
00397          ddx=l*cos(a); ddy=l*sin(a);
00398          idx=(long)ddx; idy=(long)ddy;
00399          DrawFlareInBuffer(xx,yy,idx,idy,
00400                            lpXimage->Screen,
00401                            lpXimage->Xmax,
00402                            lpXimage->Ymax,
00403                            8.0,
00404                            r,g,b,
00405                            0.0,(double)radius*0.2,
00406                            y,Zb,bDraw,hide,TRUE);
00407        }
00408      }
00409    }
00410  }
00411  return 1;
00412 }
00413 
00414 /*************** Function that renders any of the OpenGL Functionality ************/
00415 
00416 long _RenderGLexternal(char *PrmList, XIMAGE *lpXimage){
00417 MessageBox(NULL,"OpenGL function called","OK",MB_OK);
00418  return 1;
00419 }
00420 
00421 BOOL CALLBACK DlgProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam);
00422 
00423 static double rad=1.0;
00424 static long   hide=1,type=1,id = -1,c1=255,c2=255,c3=0,param=5,rotate=0;
00425 static X__MEMORY_MANAGER *lpLocalEVI;
00426 
00427 char * _SetExternalParameters(
00428   char *Op,                 /* string for the parameters                  */
00429   HWND hWnd,                /* parent window                              */
00430   long ruler,               /* ruler scale value to facilitate scaling    */
00431   char *name,               /* name of DLL file with the effect           */
00432   X__MEMORY_MANAGER *lpEVI /* pointer to structure with memory functions */
00433                                     ){
00434  char buffer[256];
00435  long irad;       /* integer scaled radius value                */
00436  if(Op != NULL){  /* parameters exist so read them off the list */
00437    sscanf(Op,"%s %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld",buffer,&version,
00438           &irad,&hide,&type,&id,&param,&c1,&c2,&c3,&rotate);
00439    /* transform from World units to User units                  */
00440    rad=(double)irad/(double)ruler;
00441  }
00442  lpLocalEVI=lpEVI;
00443  if(DialogBox(hDLLinstance,MAKEINTRESOURCE(DLG_HILITE),hWnd,
00444               (DLGPROC)DlgProc) == FALSE)return Op;
00445  if(Op != NULL)CALL_FREE(Op);  /* free the old string */
00446  irad=(long)(rad*(double)ruler);
00447  sprintf(buffer,"%s %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld",name,version,
00448          irad,hide,type,id,param,c1,c2,c3,rotate);
00449  if((Op=(char *)CALL_MALLOC(strlen(buffer)+1)) == NULL){
00450   MessageBox (GetFocus(),"External effect: Out of memory","Error",
00451                 MB_OK|MB_TASKMODAL|MB_ICONSTOP);
00452    return NULL;
00453  }
00454  strcpy(Op,buffer);
00455  return Op;
00456 }
00457 
00458 BOOL CALLBACK DlgProc(HWND hwnd,UINT msg,WPARAM wparam,LPARAM lparam){
00459  BOOL err;
00460  char str[32];
00461  switch( msg ) {
00462    case WM_INITDIALOG:
00463      sprintf(str,"%.3f",rad);
00464      SetDlgItemText(hwnd,DLG_HILITE_RADIUS,str);
00465      SetDlgItemInt(hwnd,DLG_HILITE_PARAM,param,FALSE);
00466      if(rotate == 1)SendDlgItemMessage(hwnd,DLG_HILITE_ROTATE,BM_SETCHECK,TRUE,0);
00467      if(hide == 1)SendDlgItemMessage(hwnd,DLG_HILITE_HIDE,BM_SETCHECK,TRUE,0);
00468      if(type == 1)SendDlgItemMessage(hwnd,DLG_HILITE_TYPE1,BM_SETCHECK,TRUE,0);
00469      if(type == 2)SendDlgItemMessage(hwnd,DLG_HILITE_TYPE2,BM_SETCHECK,TRUE,0);
00470      if(type == 3)SendDlgItemMessage(hwnd,DLG_HILITE_TYPE3,BM_SETCHECK,TRUE,0);
00471      if(id >= 0)SendDlgItemMessage(hwnd,DLG_HILITE_NAME,WM_SETTEXT,
00472                 0,(LPARAM)GetActorsName(lpLocalEVI->lpAni,id));
00473      CentreDialogOnScreen(hwnd);
00474      return TRUE;
00475    case WM_PAINT:
00476      PaintBackground(hwnd);
00477      break;
00478    case WM_DRAWITEM:{
00479        LPDRAWITEMSTRUCT lpdis;
00480        HBRUSH   hbr,hbrold;
00481        BYTE r,g,b;
00482        lpdis=(LPDRAWITEMSTRUCT)lparam;
00483        if(lpdis->CtlID == DLG_HILITE_COLOUR){
00484          r=(BYTE)c1; g=(BYTE)c2; b=(BYTE)c3;
00485          if(lpdis->itemState & ODS_SELECTED)
00486             InvertRect(lpdis->hDC,&(lpdis->rcItem));
00487          else{
00488            hbr=CreateSolidBrush(RGB(r,g,b));
00489            hbrold=SelectObject(lpdis->hDC,hbr);
00490            Rectangle(lpdis->hDC,lpdis->rcItem.left,lpdis->rcItem.top,
00491                          lpdis->rcItem.right,lpdis->rcItem.bottom);
00492            SelectObject(lpdis->hDC,hbrold);
00493            DeleteObject(hbr);
00494          }
00495        }
00496      }
00497      break;
00498    case WM_COMMAND:
00499      switch(LOWORD(wparam)){
00500         case DLG_HILITE_COLOUR:{
00501             unsigned char colour[3];
00502             colour[0]=(unsigned char)c1;
00503             colour[1]=(unsigned char)c2;
00504             colour[2]=(unsigned char)c3;
00505             SetColour(colour,hwnd);
00506             c1=(long)colour[0]; c2=(long)colour[1]; c3=(long)colour[2];
00507             InvalidateRect(GetDlgItem(hwnd,DLG_HILITE_COLOUR),NULL,FALSE);
00508           }
00509           break;
00510         case DLG_HILITE_SETID:
00511           id=GetActorsID(lpLocalEVI->lpAni,hwnd);
00512           if(id >= 0)SendDlgItemMessage(hwnd,DLG_HILITE_NAME,WM_SETTEXT,
00513                      0,(LPARAM)GetActorsName(lpLocalEVI->lpAni,id));
00514           break;
00515         case IDCANCEL:
00516           EndDialog(hwnd,FALSE);
00517           return(TRUE);
00518         case IDOK:
00519           param=GetDlgItemInt(hwnd,DLG_HILITE_PARAM,&err,FALSE);
00520           if(GetDlgItemText(hwnd,DLG_HILITE_RADIUS,str,12) != 0)
00521             sscanf(str,"%f",&rad);
00522           if(SendDlgItemMessage(hwnd,DLG_HILITE_HIDE,BM_GETCHECK,0,0))
00523                hide=1;
00524           else hide=0;
00525           if(SendDlgItemMessage(hwnd,DLG_HILITE_ROTATE,BM_GETCHECK,0,0))
00526                rotate=1;
00527           else rotate=0;
00528           if(SendDlgItemMessage(hwnd,DLG_HILITE_TYPE1,BM_GETCHECK,0,0))type=1;
00529           if(SendDlgItemMessage(hwnd,DLG_HILITE_TYPE2,BM_GETCHECK,0,0))type=2;
00530           if(SendDlgItemMessage(hwnd,DLG_HILITE_TYPE3,BM_GETCHECK,0,0))type=3;
00531           EndDialog(hwnd,TRUE);
00532           return(TRUE);
00533         default:
00534           break;
00535       }
00536       break;
00537     default: break;
00538  }
00539  return FALSE;
00540 }
00541 

Generated on Sun Apr 27 14:20:12 2014 for OpenFX by  doxygen 1.5.6