1 #ifndef __GNUC__
2 #pragma once
3 #endif
4 #ifndef __XR_SCENE_PORTALS_H__
5 #define __XR_SCENE_PORTALS_H__
6 
7 #include "xr_scene_objects.h"
8 
9 namespace xray_re {
10 
11 // CPortal
12 const uint16_t PORTAL_VERSION = 0x10;
13 
14 enum {
15 	PORTAL_CHUNK_VERSION		= 0xfa10,
16 	PORTAL_CHUNK_SECTOR_FRONT	= 0xfa30,
17 	PORTAL_CHUNK_SECTOR_BACK	= 0xfa40,
18 	PORTAL_CHUNK_VERTICES		= 0xfa50,
19 };
20 
21 class xr_portal_object: public xr_custom_object {
22 public:
23 			xr_portal_object(xr_scene& scene);
24 	virtual		~xr_portal_object();
25 	virtual void	load(xr_reader& r);
26 	virtual void	save(xr_writer& w) const;
27 
28 	virtual void		save_v12(xr_ini_writer* w) const;
29 
30 	std::string&		sector_front();
31 	std::string&		sector_back();
32 	std::vector<fvector3>&	vertices();
33 
34 private:
35 	std::string		m_sector_front;
36 	std::string		m_sector_back;
37 	std::vector<fvector3>	m_vertices;
38 };
39 
sector_front()40 inline std::string& xr_portal_object::sector_front() { return m_sector_front; }
sector_back()41 inline std::string& xr_portal_object::sector_back() { return m_sector_back; }
vertices()42 inline std::vector<fvector3>& xr_portal_object::vertices() { return m_vertices; }
43 
44 
45 // EScenePortalTools
46 enum {
47 	PORTALS_CHUNK_COMMON_FLAGS	= 0x1002,
48 };
49 
50 // common flags
51 enum {
52 	PORTALS_FLAG_DRAW_SIMPLE_MODEL	= 0x80000000,
53 };
54 
55 class xr_scene_portals: public xr_scene_objects {
56 public:
57 			xr_scene_portals(xr_scene& scene);
58 	virtual		~xr_scene_portals();
59 	virtual void	load(xr_reader& r);
60 	virtual void	save(xr_writer& w) const;
61 
62 	virtual void		save_v12(xr_ini_writer* w) const;
63 
64 	uint32_t&	flags();
65 
66 private:
67 	uint32_t	m_flags;	// PORTALS_CHUNK_COMMON_FLAGS
68 };
69 
flags()70 inline uint32_t& xr_scene_portals::flags() { return m_flags; }
71 
72 } // end of namespace xray_re
73 
74 #endif
75