1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     LytCtrl.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: 1 $
14  *---------------------------------------------------------------------------*/
15 #ifndef LYT_CTRL_H_
16 #define LYT_CTRL_H_
17 
18 #include <nw/lyt.h>
19 #include "../include/SmBase.h"
20 #include "../include/SmFile.h"
21 #include "../include/SmLayout.h"
22 
23 
24 
25 //------------------------------------------------------------------------------
26 //! ���C�A�E�g�̃t�@�C���\�����L�q����ׂ̍\���̂ł��B
27 typedef nw::ut::FixedSizeArray<std::string, 8> StringArray;
28 struct LytResourceFile
29 {
30     std::string         clyt;       // ���C�A�E�g�t�@�C��
31     StringArray         clan;       // �A�j���[�V�����t�@�C��(8�‚܂�)
32 };
33 
34 typedef nw::ut::FixedSizeArray<std::string, 1> StringArray2;
35 
36 struct testtest
37 {
38     std::string         clyt;
39     StringArray         clan;
40 };
41 
42 //------------------------------------------------------------------------------
43 //! ���C�A�E�g�Ɋւ���N���X�������E�j������N���X�ł��B
44 class LytCtrl : public SmBase
45 {
46 public:
47     struct LytResourceSet
48     {
49         nw::lyt::ArcResourceAccessor*   resAccessor;
50         SmFile                          lytFile;
51     };
52     #define LYT_RESOURCES_COUNT (32)
53     typedef nw::ut::FixedSizeArray<LytResourceSet, LYT_RESOURCES_COUNT>     LytResourceArray;
54     typedef nw::ut::FixedSizeArray<SmLayoutResource*, LYT_RESOURCES_COUNT>  SmLytResourceArray;
55     typedef nw::ut::FixedSizeArray<SmLayout*, LYT_RESOURCES_COUNT>          SmLytInstanceArray;
56 
57 public:
58     LytCtrl();
59     ~LytCtrl();
60 
61     //! ���C�A�E�g���\�[�X���Z�b�g�A�b�v���܂��B
62     SmLayoutResource* CreateSmLayoutResource( const wchar_t* archivePath, LytResourceFile& lytResFile );
63 
64     //! ���C�A�E�g���\�[�X�N���X�̃C���X�^���X�������ɁASmLayout�N���X�̃C���X�^���X�������܂��B
65     SmLayout* CreateSmLayout( SmLayoutResource* layoutResource );
66 
67     //! �ێ�����SmLayout�N���X�̕`����s���܂��B
68     void Render();
69 
70 private:
71     // m_DrawInfo�̏��������s���܂��B
72     void setupCamera( nw::ut::Rect rect );
73 
74 private:
75     nw::lyt::Drawer                 m_Drawer;
76     nw::lyt::GraphicsResource       m_GraphicsResource;
77     nw::lyt::DrawInfo               m_DrawInfo;
78 
79     LytResourceArray                m_ResourcesArray;
80     SmLytResourceArray              m_SmLytResourceArray;
81     SmLytInstanceArray              m_SmLytInstanceArray;
82 };
83 
84 
85 #endif  // LYT_CTRL_H_
86