tgainfo.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //---------------------------------------------------------------------------
  2. //
  3. // MechCommander 2 -- Copyright (c) 1998 FASA Interactive
  4. //
  5. // TGA file Specifics
  6. //
  7. //---------------------------------------------------------------------------//
  8. // Copyright (C) Microsoft Corporation. All rights reserved. //
  9. //===========================================================================//
  10. #ifndef TGAINFO_H
  11. #define TGAINFO_H
  12. #ifndef DSTD_H
  13. #include "dstd.h"
  14. #endif
  15. #ifndef FILE_H
  16. #include "file.h"
  17. #endif
  18. //---------------------------------------------------------------------------
  19. enum TGAImageType
  20. {
  21. NO_IMAGE = 0,
  22. UNC_PAL,
  23. UNC_TRUE,
  24. UNC_GRAY,
  25. RLE_PAL = 9,
  26. RLE_TRUE,
  27. RLE_GRAY
  28. };
  29. //---------------------------------------------------------------------------
  30. #pragma pack(1)
  31. struct TGAFileHeader
  32. {
  33. byte image_id_len;
  34. byte color_map;
  35. byte image_type;
  36. short cm_first_entry;
  37. short cm_length;
  38. byte cm_entry_size;
  39. short x_origin;
  40. short y_origin;
  41. short width;
  42. short height;
  43. byte pixel_depth;
  44. byte image_descriptor;
  45. };
  46. #pragma pack()
  47. void tgaDecomp (MemoryPtr dest, MemoryPtr source, TGAFileHeader *tga_header);
  48. void loadTGATexture (FilePtr tgaFile, MemoryPtr ourRAM, long width, long height);
  49. void loadTGAMask (FilePtr tgaFile, MemoryPtr ourRAM, long width, long height);
  50. void flipTopToBottom (MemoryPtr buffer, BYTE depth, long width, long height);
  51. //---------------------------------------------------------------------------
  52. #endif