PluginEntities.cpp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. ===========================================================================
  3. Copyright (C) 1999-2005 Id Software, Inc.
  4. This file is part of Quake III Arena source code.
  5. Quake III Arena source code is free software; you can redistribute it
  6. and/or modify it under the terms of the GNU General Public License as
  7. published by the Free Software Foundation; either version 2 of the License,
  8. or (at your option) any later version.
  9. Quake III Arena source code is distributed in the hope that it will be
  10. useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with Foobar; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. ===========================================================================
  17. */
  18. //-----------------------------------------------------------------------------
  19. //
  20. // $LogFile$
  21. // $Revision: 1.1.1.4 $
  22. // $Author: ttimo $
  23. // $Date: 2000/01/18 00:17:34 $
  24. // $Log: PluginEntities.cpp,v $
  25. // Revision 1.1.1.4 2000/01/18 00:17:34 ttimo
  26. // merging in for RC
  27. //
  28. // Revision 1.3 2000/01/17 23:53:42 TBesset
  29. // ready for merge in sourceforge (RC candidate)
  30. //
  31. // Revision 1.2 2000/01/07 16:40:11 TBesset
  32. // merged from BSP frontend
  33. //
  34. // Revision 1.1.1.3 1999/12/29 18:31:34 TBesset
  35. // Q3Radiant public version
  36. //
  37. // Revision 1.1.1.1.2.1 1999/12/29 21:39:38 TBesset
  38. // updated to update3 from Robert
  39. //
  40. // Revision 1.1.1.3 1999/12/29 18:31:34 TBesset
  41. // Q3Radiant public version
  42. // Revision 1.1.1.3 1999/12/29 18:31:34 TBesset
  43. // Q3Radiant public version
  44. //
  45. // Revision 1.2 1999/11/22 17:46:46 Timo & Christine
  46. // merged EARadiant into the main tree
  47. // bug fixes for Q3Plugin / EAPlugin
  48. // export for Robert
  49. //
  50. // Revision 1.1.2.1 1999/11/03 20:38:01 Timo & Christine
  51. // MEAN plugin for Q3Radiant, alpha version
  52. //
  53. //
  54. // DESCRIPTION:
  55. // implementation of IPluginEntities specific interface
  56. //
  57. #include "stdafx.h"
  58. #include "io.h"
  59. // is Eclass_InitForModelDirectory
  60. int WINAPI QERApp_EClassScanDir( char *path, HMODULE hPlug )
  61. {
  62. struct _finddata_t fileinfo;
  63. int handle;
  64. char temp[ _MAX_PATH ];
  65. char filebase[ _MAX_PATH ];
  66. char filename[ _MAX_PATH ];
  67. char *s;
  68. eclass_t *e;
  69. QE_ConvertDOSToUnixName( temp, path );
  70. strcpy (filebase, path);
  71. s = filebase + strlen(filebase)-1;
  72. while (*s != '\\' && *s != '/' && s!=filebase)
  73. s--;
  74. *s = 0;
  75. handle = _findfirst (path, &fileinfo);
  76. if (handle != -1)
  77. {
  78. do
  79. {
  80. sprintf (filename, "%s\\%s", filebase, fileinfo.name);
  81. Eclass_ScanFile (filename);
  82. if (eclass_found)
  83. {
  84. e = eclass_e;
  85. e->modelpath = strdup( fileinfo.name );
  86. e->nShowFlags |= ECLASS_PLUGINENTITY;
  87. e->hPlug = hPlug;
  88. }
  89. } while (_findnext( handle, &fileinfo ) != -1);
  90. _findclose (handle);
  91. }
  92. return 0;
  93. }