Open Source Tomb Raider Engine
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

LoaderTR2.h 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*!
  2. * \file include/loader/LoaderTR2.h
  3. * \brief TR2 level file loader
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _LOADER_LOADER_TR2_H_
  8. #define _LOADER_LOADER_TR2_H_
  9. #include <array>
  10. #include <cstdint>
  11. #include "loader/Loader.h"
  12. class LoaderTR2 : public Loader {
  13. public:
  14. LoaderTR2();
  15. virtual ~LoaderTR2();
  16. virtual int load(std::string f);
  17. private:
  18. void loadPaletteTextiles();
  19. void loadRooms();
  20. void loadFloorData();
  21. void loadMeshes();
  22. void loadMoveables();
  23. void loadStaticMeshes();
  24. void loadTextures();
  25. void loadSprites();
  26. void loadCameras();
  27. void loadSoundSources();
  28. void loadBoxesOverlapsZones();
  29. void loadAnimatedTextures();
  30. void loadItems();
  31. void loadCinematicFrames();
  32. void loadDemoData();
  33. void loadSoundMap();
  34. void loadSoundDetails();
  35. void loadSampleIndices();
  36. void loadExternalSoundFile(std::string f);
  37. std::array<uint32_t, 256> palette;
  38. };
  39. struct RoomVertexTR2 {
  40. int16_t x, y, z; // Vertex coordinates, relative to x/zOffset
  41. int16_t light1, light2; // Almost always equal
  42. // Set of flags for special rendering effects
  43. // 0x8000 - Something to do with water surface?
  44. // 0x4000 - Underwater lighting modulation/movement if seen from above
  45. // 0x2000 - Water/Quicksand surface movement
  46. // 0x0010 - Normal?
  47. uint16_t attributes;
  48. };
  49. struct RoomRectangleTR2 {
  50. uint16_t v1, v2, v3, v4; // Vertex list indices
  51. uint16_t texture; // Index into object-texture list
  52. RoomRectangleTR2(uint16_t _v1, uint16_t _v2, uint16_t _v3, uint16_t _v4, uint16_t t)
  53. : v1(_v1), v2(_v2), v3(_v3), v4(_v4), texture(t) { }
  54. };
  55. struct RoomTriangleTR2 {
  56. uint16_t v1, v2, v3; // Vertex list indices
  57. uint16_t texture; // Index into object-texture list
  58. RoomTriangleTR2(uint16_t _v1, uint16_t _v2, uint16_t _v3, uint16_t t)
  59. : v1(_v1), v2(_v2), v3(_v3), texture(t) { }
  60. };
  61. #endif