il_utx.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. //-----------------------------------------------------------------------------
  2. //
  3. // ImageLib Sources
  4. // Copyright (C) 2000-2009 by Denton Woods
  5. // Last modified: 03/02/2009
  6. //
  7. // Filename: src-IL/include/il_utx.h
  8. //
  9. // Description: Reads from an Unreal and Unreal Tournament Texture (.utx) file.
  10. // Specifications can be found at
  11. // http://wiki.beyondunreal.com/Legacy:Package_File_Format.
  12. //
  13. //-----------------------------------------------------------------------------
  14. #ifndef UTX_H
  15. #define UTX_H
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. #include "il_internal.h"
  20. #include "il_dds.h"
  21. #ifdef __cplusplus
  22. }
  23. #endif
  24. #include <memory>
  25. #include <vector>
  26. #include <string>
  27. using namespace std;
  28. typedef struct UTXHEADER
  29. {
  30. ILuint Signature;
  31. ILushort Version;
  32. ILushort LicenseMode;
  33. ILuint Flags;
  34. ILuint NameCount;
  35. ILuint NameOffset;
  36. ILuint ExportCount;
  37. ILuint ExportOffset;
  38. ILuint ImportCount;
  39. ILuint ImportOffset;
  40. } UTXHEADER;
  41. typedef struct UTXENTRYNAME
  42. {
  43. //char *Name;
  44. string Name;
  45. ILuint Flags;
  46. } UTXENTRYNAME;
  47. typedef struct UTXEXPORTTABLE
  48. {
  49. ILint Class;
  50. ILint Super;
  51. ILint Group;
  52. ILint ObjectName;
  53. ILuint ObjectFlags;
  54. ILint SerialSize;
  55. ILint SerialOffset;
  56. ILboolean ClassImported;
  57. ILboolean SuperImported;
  58. ILboolean GroupImported;
  59. } UTXEXPORTTABLE;
  60. typedef struct UTXIMPORTTABLE
  61. {
  62. ILint ClassPackage;
  63. ILint ClassName;
  64. ILint Package;
  65. ILint ObjectName;
  66. ILboolean PackageImported;
  67. } UTXIMPORTTABLE;
  68. class UTXPALETTE
  69. {
  70. public:
  71. UTXPALETTE() { Pal = NULL; }
  72. ~UTXPALETTE() { delete [] Pal; }
  73. ILubyte *Pal;
  74. ILuint Count;
  75. ILuint Name;
  76. };
  77. // Data formats
  78. #define UTX_P8 0x00
  79. #define UTX_DXT1 0x03
  80. ILboolean iLoadUtxInternal(void);
  81. #endif//UTX_H