home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 58 / pcpp58a.iso / extras / quake 3 source / Q3A_ToolSource.exe / Main / PluginEntities.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-02  |  2.1 KB  |  81 lines

  1. //-----------------------------------------------------------------------------
  2. //
  3. // $LogFile$
  4. // $Revision: 1.1.1.4 $
  5. // $Author: ttimo $
  6. // $Date: 2000/01/18 00:17:34 $
  7. // $Log: PluginEntities.cpp,v $
  8. // Revision 1.1.1.4  2000/01/18 00:17:34  ttimo
  9. // merging in for RC
  10. //
  11. // Revision 1.3  2000/01/17 23:53:42  TBesset
  12. // ready for merge in sourceforge (RC candidate)
  13. //
  14. // Revision 1.2  2000/01/07 16:40:11  TBesset
  15. // merged from BSP frontend
  16. //
  17. // Revision 1.1.1.3  1999/12/29 18:31:34  TBesset
  18. // Q3Radiant public version
  19. //
  20. // Revision 1.1.1.1.2.1  1999/12/29 21:39:38  TBesset
  21. // updated to update3 from Robert
  22. //
  23. // Revision 1.1.1.3  1999/12/29 18:31:34  TBesset
  24. // Q3Radiant public version
  25. // Revision 1.1.1.3  1999/12/29 18:31:34  TBesset
  26. // Q3Radiant public version
  27. //
  28. // Revision 1.2  1999/11/22 17:46:46  Timo & Christine
  29. // merged EARadiant into the main tree
  30. // bug fixes for Q3Plugin / EAPlugin
  31. // export for Robert
  32. //
  33. // Revision 1.1.2.1  1999/11/03 20:38:01  Timo & Christine
  34. // MEAN plugin for Q3Radiant, alpha version
  35. //
  36. //
  37. // DESCRIPTION:
  38. // implementation of IPluginEntities specific interface
  39. // 
  40.  
  41. #include "stdafx.h"
  42. #include "io.h"
  43.  
  44. // is Eclass_InitForModelDirectory
  45. int WINAPI QERApp_EClassScanDir( char *path, HMODULE hPlug )
  46. {
  47.     struct _finddata_t    fileinfo;
  48.     int                    handle;
  49.     char                temp[ _MAX_PATH ];
  50.     char                filebase[ _MAX_PATH ];
  51.     char                filename[ _MAX_PATH ];
  52.     char                *s;
  53.     eclass_t            *e;
  54.     QE_ConvertDOSToUnixName( temp, path );
  55.     strcpy (filebase, path);
  56.     s = filebase + strlen(filebase)-1;
  57.     while (*s != '\\' && *s != '/' && s!=filebase)
  58.         s--;
  59.     *s = 0;
  60.     handle = _findfirst (path, &fileinfo);
  61.     if (handle != -1)
  62.        {
  63.         do
  64.         {            
  65.             sprintf (filename, "%s\\%s", filebase, fileinfo.name);
  66.             Eclass_ScanFile (filename);
  67.             
  68.             if (eclass_found)
  69.             {
  70.                 e = eclass_e;
  71.                 e->modelpath = strdup( fileinfo.name );
  72.                 e->nShowFlags |= ECLASS_PLUGINENTITY;
  73.                 e->hPlug = hPlug;
  74.             }
  75.         } while (_findnext( handle, &fileinfo ) != -1);
  76.         
  77.         _findclose (handle);
  78.        }
  79.     return 0;
  80. }
  81.