REVERSE.C

Go to the documentation of this file.
00001 /* --
00002 OpenFX - Modelling, Animation and Rendering Package
00003 -- */
00004 
00005 /*  REVERSE.C  */
00006 #include <stdlib.h>
00007 #include <stdio.h>
00008 #include <math.h>
00009 #include <windows.h>
00010 
00011 #include "struct.h"
00012 #include "dstruct.h"
00013 
00014 #include "reverse.h"
00015 
00016 #define DESELECTED 0
00017 #define SELECTED   1
00018 
00019 
00020 static HWND      hParent;
00021 static HINSTANCE hThisInstance;
00022 
00023 
00024 #if __WATCOMC__
00025 int APIENTRY LibMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00026 #else
00027 BOOL WINAPI DllMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00028 #endif
00029   switch (dwReason) {
00030     case DLL_PROCESS_ATTACH: {
00031       hThisInstance=hDLL;
00032       if(hDLL == NULL)MessageBox ( GetFocus()," NULL instance",NULL, MB_OK);
00033       break;
00034     }
00035     case DLL_PROCESS_DETACH:
00036       break;
00037   }
00038   return TRUE;
00039 }
00040 
00041 #if __SC__
00042 #pragma startaddress(DllMain)
00043 #endif
00044 
00045 BOOL _Xmodeler
00046  (HWND parent_window,HWND info_window,X__STRUCTURE *lpevi){
00047  char text_string[255],name_string[255];
00048  lpEVI=lpevi;
00049  hParent=parent_window;
00050  LoadString(hThisInstance,IDX_STRING2,text_string,256);
00051  LoadString(hThisInstance,IDX_STRING1,name_string,256);
00052  if(MessageBox(hParent,text_string,name_string,MB_OKCANCEL)
00053                == IDCANCEL)return FALSE;
00054  else{
00055    HCURSOR hSave;
00056    vertex *V0,*V1,*V2;
00057    face   *fp;
00058    long   i,id;
00059    if(NvertSelect == 0 || Nface == 0)return FALSE;
00060    hSave=SetCursor(LoadCursor(NULL,IDC_WAIT));
00061    for(fp=MainFp,i=0;i<Nface;i++){
00062      V0=(MainVp+fp->V[0]); V1=(MainVp+fp->V[1]); V2=(MainVp+fp->V[2]);
00063      if(V0->status == SELECTED &&
00064         V1->status == SELECTED &&
00065         V2->status == SELECTED){
00066         id=fp->V[2];
00067         fp->V[2]=fp->V[0];
00068         fp->V[0]=id;
00069      }
00070      fp++;
00071    }
00072    SetCursor(hSave);
00073  }
00074  return TRUE;
00075 }

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