1 /*---------------------------------------------------------------------------*
2   Project: NintendoWare
3   File   : gfx_ResSceneEnvironmentSetting.h
4 
5   Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Revision: 18422 $
14  *---------------------------------------------------------------------------*/
15 #ifndef NW_GFX_RESSCENEENVIRONMENTSETTING_H_
16 #define NW_GFX_RESSCENEENVIRONMENTSETTING_H_
17 
18 #include <nw/ut/ut_ResUtil.h>
19 #include <nw/ut/ut_ResDictionary.h>
20 
21 #include <nw/gfx/res/gfx_ResSceneObject.h>
22 #include <nw/gfx/res/gfx_ResFog.h>
23 
24 namespace nw
25 {
26 namespace gfx
27 {
28 namespace res
29 {
30 
31 class ResCamera;
32 class ResLight;
33 
34 
35 //! @details :private
36 struct ResReferenceSceneObjectData
37 {
38     nw::ut::ResS32 m_Index;
39     nw::ut::BinString toPath;
40     nw::ut::Offset toTarget;
41 };
42 
43 
44 //! @details :private
45 struct ResLightSetData
46 {
47     nw::ut::ResS32 m_Index;
48     nw::ut::ResS32 m_LightsTableCount;
49     nw::ut::Offset toLightsTable;
50 };
51 
52 //! @details :private
53 struct ResSceneEnvironmentSettingData : public ResSceneObjectData
54 {
55     nw::ut::ResS32 m_CamerasTableCount;
56     nw::ut::Offset toCamerasTable;
57     nw::ut::ResS32 m_LightSetsTableCount;
58     nw::ut::Offset toLightSetsTable;
59     nw::ut::ResS32 m_FogsTableCount;
60     nw::ut::Offset toFogsTable;
61 };
62 
63 
64 //! @details :private
65 class ResReferenceSceneObject : public nw::ut::ResCommon<ResReferenceSceneObjectData>
66 {
67 public:
68     NW_RES_CTOR( ResReferenceSceneObject )
69 
70     NW_RES_FIELD_PRIMITIVE_DECL( s32, Index ) // GetIndex()
71     NW_RES_FIELD_STRING_DECL( Path ) // GetPath()
72     NW_RES_FIELD_CLASS_DECL( ResSceneObject, Target ) // GetTarget()
73 };
74 
75 //---------------------------------------------------------------------------
76 //! @brief        複数ライトの参照をまとめるバイナリリソースクラスです。
77 //---------------------------------------------------------------------------
78 //! @details :private
79 class ResLightSet : public nw::ut::ResCommon<ResLightSetData>
80 {
81 public:
82     NW_RES_CTOR(ResLightSet);
83 
84     NW_RES_FIELD_PRIMITIVE_DECL( s32, Index ) // GetIndex()
85 
86     NW_RES_FIELD_CLASS_LIST_DECL(ResReferenceSceneObject, Lights) // GetLights(), GetLights(int idx), GetLightsCount()
87 };
88 
89 //---------------------------------------------------------------------------
90 //! @brief        シーンの環境設定を表すバイナリリソースクラスです。
91 //---------------------------------------------------------------------------
92 //! @details :private
93 class ResSceneEnvironmentSetting : public ResSceneObject
94 {
95 public:
96     enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResSceneEnvironmentSetting) };
97     enum { SIGNATURE = NW_RES_SIGNATURE32('CENV') };
98     enum { BINARY_REVISION = REVISION_RES_RENDER_ENV_SETTING };
99 
NW_RES_CTOR_INHERIT(ResSceneEnvironmentSetting,ResSceneObject)100     NW_RES_CTOR_INHERIT( ResSceneEnvironmentSetting, ResSceneObject )
101 
102     //---------------------------------------------------------------------------
103     //! @brief        リビジョンを取得します。
104     //!
105     //! @return       リソースのリビジョン情報です。
106     //---------------------------------------------------------------------------
107     u32 GetRevision() const { return this->GetHeader().revision; }
108 
109     NW_RES_FIELD_CLASS_LIST_DECL( ResReferenceSceneObject, Cameras ) // GetCameras(int idx), GetCamerasCount()
110     NW_RES_FIELD_CLASS_LIST_DECL( ResLightSet, LightSets ) // GetLightSets(int idx), GetLightSetsCount()
111     NW_RES_FIELD_CLASS_LIST_DECL( ResReferenceSceneObject, Fogs ) // GetFogs(int idx), GetFogsCount()
112 };
113 
114 typedef nw::ut::ResArrayPatricia<ResSceneEnvironmentSetting>::type  ResSceneEnvironmentSettingArray;
115 typedef nw::ut::ResArrayClass<ResReferenceSceneObject>::type ResReferenceSceneObjectArray;
116 typedef nw::ut::ResArrayClass<ResLightSet>::type ResLightSetArray;
117 
118 } // namespace res
119 } // namespace gfx
120 } // namespace nw
121 
122 #endif // NW_GFX_RESSCENEENVIRONMENTSETTING_H_
123 
124