Subversion Repositories Games.Descent

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #pragma once
  2.  
  3. #include <unordered_map>
  4. #include <vector>
  5. #include "dxxsconf.h"
  6. #include "fwd-segment.h"
  7. #include "objnum.h"
  8. #include <array>
  9.  
  10. constexpr std::integral_constant<unsigned, 500> MAX_RENDER_SEGS{};
  11.  
  12. struct rect
  13. {
  14.         short left,top,right,bot;
  15. };
  16.  
  17. namespace dcx {
  18.  
  19. struct render_state_t
  20. {
  21.         struct per_segment_state_t
  22.         {
  23.                 struct distant_object
  24.                 {
  25.                         objnum_t objnum;
  26.                 };
  27.                 std::vector<distant_object> objects;
  28.                 uint16_t Seg_depth = 0;         //depth for this seg in Render_list
  29.                 bool processed = false;         //whether this entry has been processed
  30.                 rect render_window;
  31.         };
  32.         unsigned N_render_segs = 0;
  33.         std::array<segnum_t, MAX_RENDER_SEGS> Render_list;
  34.         std::array<short, MAX_SEGMENTS> render_pos;     //where in render_list does this segment appear?
  35.         std::unordered_map<segnum_t, per_segment_state_t> render_seg_map;
  36. };
  37.  
  38. }
  39.  
  40. #ifdef dsx
  41. namespace dsx {
  42. void set_dynamic_light(render_state_t &);
  43. }
  44. #endif
  45.