Guest User

Untitled

a guest
Jul 18th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. diff --git a/contrib/extractor/System.cpp b/contrib/extractor/System.cpp
  2. index a851412..031c6b0 100644
  3. --- a/contrib/extractor/System.cpp
  4. +++ b/contrib/extractor/System.cpp
  5. @@ -872,7 +872,12 @@ void ExtractMapsFromMpq()
  6. }
  7. // draw progress bar
  8. printf("Processing........................%d%%\r", (100 * (y+1)) / WDT_MAP_SIZE);
  9. +#if defined( __APPLE__ ) && defined( __MACH__ )
  10. + // OS X: Using \r does not automatically redraw the line
  11. + fflush(stdout);
  12. +#endif
  13. }
  14. + printf("\n");
  15. }
  16. delete [] areas;
  17. delete [] map_ids;
  18. @@ -966,6 +971,19 @@ inline void CloseMPQFiles()
  19.  
  20. int main(int argc, char * arg[])
  21. {
  22. +
  23. +#if defined( __APPLE__ ) && defined( __MACH__ )
  24. +// OS X: Set the working directory to the executable path
  25. +// Allows double-click in Finder, similar to Windows port
  26. +if (strrchr(arg[0],'/'))
  27. +{
  28. + char execPath[128];
  29. + strcpy(execPath,arg[0]);
  30. + *(strrchr(execPath,'/'))=0;
  31. + chdir(execPath);
  32. +}
  33. +#endif
  34. +
  35. printf("Map & DBC Extractor\n");
  36. printf("===================\n\n");
  37.  
  38. diff --git a/contrib/extractor/libmpq/common.h b/contrib/extractor/libmpq/common.h
  39. index 5794c16..a00b2c8 100644
  40. --- a/contrib/extractor/libmpq/common.h
  41. +++ b/contrib/extractor/libmpq/common.h
  42. @@ -31,6 +31,11 @@
  43. #define LIBMPQ_CONF_EOPEN_DIR -1 /* error on open directory */
  44. #define LIBMPQ_CONF_EVALUE_NOT_FOUND -2 /* value for the option was not found */
  45.  
  46. +// OSX
  47. +#ifndef lseek64
  48. +#define lseek64 lseek
  49. +#endif
  50. +
  51. #if defined( __GNUC__ )
  52. #include <sys/types.h>
  53. #include <unistd.h>
Add Comment
Please, Sign In to add comment