1 #ifndef __GNUC__
2 #pragma once
3 #endif
4 #ifndef __XR_SCENE_SECTORS_H__
5 #define __XR_SCENE_SECTORS_H__
6 
7 #include "xr_scene_objects.h"
8 #include "xr_color.h"
9 
10 namespace xray_re {
11 
12 // CSector
13 const uint16_t SECTOR_VERSION = 0x11;
14 const uint16_t SECTOR_VERSION_V12 = 0x12;
15 
16 enum {
17 	SECTOR_CHUNK_VERSION	= 0xf010,
18 	SECTOR_CHUNK_COLOR	= 0xf020,
19 	SECTOR_CHUNK_PRIVATE	= 0xf025,
20 	SECTOR_CHUNK_ITEMS	= 0xf030,
21 	SECTOR_CHUNK_ONE_ITEM	= 0xf031,
22 };
23 
24 struct sector_item {
25 	std::string	object;
26 	std::string	mesh;
27 };
TYPEDEF_STD_VECTOR(sector_item)28 TYPEDEF_STD_VECTOR(sector_item)
29 
30 class xr_sector_object: public xr_custom_object {
31 public:
32 				xr_sector_object(xr_scene& scene);
33 	virtual			~xr_sector_object();
34 	virtual void		load(xr_reader& r);
35 	virtual void		save(xr_writer& w) const;
36 
37 	virtual void		save_v12(xr_ini_writer* w) const;
38 
39 	fcolor&			color();
40 	uint8_t&		priv();
41 	sector_item_vec&	items();
42 
43 private:
44 	fcolor			m_color;
45 	uint8_t			m_private;
46 	sector_item_vec		m_items;
47 };
48 
color()49 inline fcolor& xr_sector_object::color() { return m_color; }
priv()50 inline uint8_t& xr_sector_object::priv() { return m_private; }
items()51 inline sector_item_vec& xr_sector_object::items() { return m_items; }
52 
53 // ESceneSectorTools
54 enum {
55 	SECTORS_FLAG_DRAW_SOLID	= 0x80000000,
56 };
57 
58 enum {
59 	SECTORS_CHUNK_COMMON_FLAGS	= 0x1002,
60 };
61 
62 class xr_scene_sectors: public xr_scene_objects {
63 public:
64 			xr_scene_sectors(xr_scene& scene);
65 	virtual		~xr_scene_sectors();
66 	virtual void	load(xr_reader& r);
67 	virtual void	save(xr_writer& w) const;
68 
69 	virtual void		save_v12(xr_ini_writer* w) const;
70 
71 	uint32_t&	flags();
72 
73 private:
74 	uint32_t	m_flags;	// SECTORS_CHUNK_COMMON_FLAGS
75 };
76 
flags()77 inline uint32_t& xr_scene_sectors::flags() { return m_flags; }
78 
79 } // end of namespace xray_re
80 
81 #endif
82