1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     tpl_Internal.h
4 
5   Copyright (C)2010 Nintendo Co., Ltd.  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   $Rev: 27885 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_TPL_INTERNAL_H_
17 #define NN_TPL_INTERNAL_H_
18 
19 
20 namespace nn { namespace tpl { namespace CTR {
21 
22 enum CtrTexType
23 {
24     TEXTYPE_CUBE = 0,           ///< Cubemap
25     TEXTYPE_1D,                 ///< 1D
26     TEXTYPE_2D,                 ///< 2D
27 
28     TEXTYPE_UNSUPPORT = 0xff,   ///< ��T�|�[�g��\�����ʎq�B
29 
30     TEXTYPE_ForceInt32 = 0x7fffffff
31 };
32 
33 enum CtrTexCubeDir
34 {
35     TEXCUBEDIR_PLUS_X = 0,          ///< x����
36     TEXCUBEDIR_MINUS_X,             ///< -x����
37     TEXCUBEDIR_PLUS_Y,              ///< y����
38     TEXCUBEDIR_MINUS_Y,             ///< -y����
39     TEXCUBEDIR_PLUS_Z,              ///< z����
40     TEXCUBEDIR_MINUS_Z,             ///< -z����
41 
42     TEXCUBEDIR_UNSUPPORT = 0xff,    ///< ��T�|�[�g��\�����ʎq�B
43 
44     TEXCUBEDIR_ForceInt32 = 0x7fffffff
45 };
46 
47 /**
48 �t�@�C���̌��������������邽�߂̃n�b�V���v�f
49 */
50 struct CtrTextureHash
51 {
52     /// �e�N�X�`�������琶�����ꂽ�n�b�V���l(CRC-32)
53     unsigned int    crc;
54 
55     /// �e�N�X�`���̃C���f�b�N�X
56     int             index;
57 };
58 
59 /**
60 �R���o�[�g���̃e�N�X�`�����̃I�v�V�����w����L�^����\����
61 \par ����F
62 �@ctr_TexturePackager.exe�ɂ��e�N�X�`���̃R���o�[�g���ɁA
63 �ύX�̖����e�N�X�`���̏������X�L�b�v���邽�߂ɎQ�Ƃ����B
64 �����^�C���ł͈�؎Q�Ƃ��Ȃ��B
65 �����^�C���ŏd�v�łȂ��f�[�^�Ȃ̂ŁA�\���̃T�C�Y��4byte�ɐ؂�l�߂Ă���B
66 */
67 struct CtrTextureConvertOpt
68 {
69     /// �o�̓t�H�[�}�b�g�̎w��B(CtrTexFormat���L���X�g)
70     unsigned char   specFormat;
71 
72     /// �~�b�v�}�b�v���x���̏���w��(0�Ŗ�����)
73     unsigned char   mipmapLimit;
74 
75     /// ���k�̋���(0�ŋ֎~)
76     unsigned char   permitCompression;
77 
78     /// ETC1���k�̃��\�b�h
79     unsigned char   etc1Method;
80 };
81 
82 /**
83 �t�@�C���w�b�_�B
84 \par ����F
85 �@���̃f�[�^�\���̂̓e�N�X�`���p�b�P�[�W���Ɋ܂܂�Ă���f�[�^�̍\���������Ă���B
86 ���̍\���̂̃T�C�Y�͈Ӑ}����32byte�ɂ��Ă���B
87 �t�@�C���̍\���͎��̂悤�ɂȂ�B
88 \code
89  CtrTexturePackageHeader header;
90  CtrTextureInfo           textureInfo[header.numTexture]
91  char                       *filePathBuffer (�t�@�C���p�X������̃o�b�t�@/�•ϒ�)
92  CtrTextureHash         *textureHash[header.numTexture]
93  (�f�[�^�̈�)
94 \endcode
95 */
96 struct CtrTexturePackageHeader
97 {
98     /// �}�W�b�N�R�[�h("CTPK"�Œ�)
99     char            magic[4];
100     /// �t�@�C���`���̃o�[�W�����ԍ�(CTR_TEXTURE_PACKAGE_VERSION����������)
101     unsigned short  version;
102     /// �e�N�X�`���̖���
103     unsigned short  numTexture;
104     /// �摜�f�[�^�̐擪�܂ł̃I�t�Z�b�g
105     unsigned int    texDataOffset;
106     /// �摜�f�[�^�̃T�C�Y
107     unsigned int    texDataSize;
108     /// �t�@�C�����n�b�V���܂ł̃I�t�Z�b�g
109     unsigned int    texHashOffset;
110     /// �R���o�[�g�I�v�V�����e�[�u���܂ł̃I�t�Z�b�g
111     unsigned int    convertOptOffset;
112     /// 32byte���E�ւ̃p�f�B���O
113     char            pad[8];
114 };
115 
116 
117 }}}
118 
119 
120 #endif  // ifndef NN_TPL_INTERNAL_H_
121