Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Loader.h 733B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*!
  2. * \file include/loader/Loader.h
  3. * \brief Level file loader
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _LOADER_LOADER_H_
  8. #define _LOADER_LOADER_H_
  9. #include <memory>
  10. #include <string>
  11. #include <cstdint>
  12. #include "utils/binary.h"
  13. struct vertex_t {
  14. int16_t x, y, z;
  15. int16_t light1, light2;
  16. int16_t attributes;
  17. };
  18. class Loader {
  19. public:
  20. typedef enum {
  21. TR_UNKNOWN = 0,
  22. TR_1 = 1,
  23. TR_2 = 2,
  24. TR_3 = 3,
  25. TR_4 = 4,
  26. TR_5 = 5
  27. } LoaderVersion;
  28. static LoaderVersion checkFile(std::string f);
  29. static std::unique_ptr<Loader> createLoader(std::string f);
  30. virtual ~Loader();
  31. virtual int load(std::string f) = 0;
  32. protected:
  33. BinaryFile file;
  34. };
  35. #endif