ilu_internal.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #ifndef INTERNAL_H
  2. #define INTERNAL_H
  3. #include <string.h>
  4. #ifdef _MSC_VER
  5. #if _MSC_VER > 1000
  6. #pragma once
  7. #pragma intrinsic(memcpy)
  8. #pragma intrinsic(memset)
  9. //pragma comment(linker, "/NODEFAULTLIB:libc")
  10. #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
  11. #ifdef _DEBUG
  12. #define _CRTDBG_MAP_ALLOC
  13. #include <stdlib.h>
  14. #ifndef _WIN32_WCE
  15. #include <crtdbg.h>
  16. #endif
  17. #endif
  18. #endif // _MSC_VER > 1000
  19. #endif
  20. #define _IL_BUILD_LIBRARY
  21. #define _ILU_BUILD_LIBRARY
  22. // Standard headers
  23. #include <stdlib.h>
  24. #include <stdio.h>
  25. #include <math.h>
  26. #include <string.h>
  27. // Local headers
  28. #define _IL_BUILD_LIBRARY
  29. #define _ILU_BUILD_LIBRARY
  30. #ifdef HAVE_CONFIG_H //if we use autotools, we have HAVE_CONFIG_H defined and we have to look for it like that
  31. #include <config.h>
  32. #else // if we don't use autotools, we have to point to (possibly different) config.h than in the opposite case
  33. #include <IL/config.h>
  34. #endif
  35. #include <IL/ilu.h>
  36. #include <IL/devil_internal_exports.h>
  37. // From DevIL's internal.h:
  38. #ifdef _WIN32_WCE
  39. #include <windows.h>
  40. #define IL_TEXT(s) ((char*)TEXT(s))
  41. #elif _WIN32
  42. #include <windows.h>
  43. #define IL_TEXT(s) TEXT(s)
  44. #else
  45. #define IL_TEXT(s) s
  46. #define TEXT(s) s
  47. #endif
  48. extern ILimage *iluCurImage;
  49. // Useful global variables
  50. extern const ILdouble IL_PI;
  51. extern const ILdouble IL_DEGCONV;
  52. #ifdef ILU_INTERNAL_C
  53. #undef NOINLINE
  54. #undef INLINE
  55. #define INLINE
  56. #endif
  57. // Internal functions
  58. ILfloat ilCos(ILfloat Angle);
  59. ILfloat ilSin(ILfloat Angle);
  60. ILint ilRound(ILfloat Num);
  61. #ifndef NOINLINE
  62. INLINE ILfloat ilCos(ILfloat Angle) {
  63. return (ILfloat)(cos(Angle * IL_DEGCONV));
  64. }
  65. INLINE ILfloat ilSin(ILfloat Angle) {
  66. return (ILfloat)(sin(Angle * IL_DEGCONV));
  67. }
  68. INLINE ILint ilRound(ILfloat Num) {
  69. return (ILint)(Num + 0.5); // this is truncating in away-from-0, not rounding
  70. }
  71. #endif
  72. ILuint iluScaleAdvanced(ILuint Width, ILuint Height, ILenum Filter);
  73. ILubyte *iScanFill(void);
  74. #endif//INTERNAL_H