/*---------------------------------------------------------------------------* Project: Horizon File: tpl_Internal.h Copyright (C)2010 Nintendo Co., Ltd. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev: 27885 $ *---------------------------------------------------------------------------*/ #ifndef NN_TPL_INTERNAL_H_ #define NN_TPL_INTERNAL_H_ namespace nn { namespace tpl { namespace CTR { enum CtrTexType { TEXTYPE_CUBE = 0, ///< Cubemap TEXTYPE_1D, ///< 1D TEXTYPE_2D, ///< 2D TEXTYPE_UNSUPPORT = 0xff, ///< 非サポートを表す識別子。 TEXTYPE_ForceInt32 = 0x7fffffff }; enum CtrTexCubeDir { TEXCUBEDIR_PLUS_X = 0, ///< x方向 TEXCUBEDIR_MINUS_X, ///< -x方向 TEXCUBEDIR_PLUS_Y, ///< y方向 TEXCUBEDIR_MINUS_Y, ///< -y方向 TEXCUBEDIR_PLUS_Z, ///< z方向 TEXCUBEDIR_MINUS_Z, ///< -z方向 TEXCUBEDIR_UNSUPPORT = 0xff, ///< 非サポートを表す識別子。 TEXCUBEDIR_ForceInt32 = 0x7fffffff }; /** ファイルの検索を高速化するためのハッシュ要素 */ struct CtrTextureHash { /// テクスチャ名から生成されたハッシュ値(CRC-32) unsigned int crc; /// テクスチャのインデックス int index; }; /** コンバート時のテクスチャ毎のオプション指定を記録する構造体 \par 解説:  ctr_TexturePackager.exeによるテクスチャのコンバート時に、 変更の無いテクスチャの処理をスキップするために参照される。 ランタイムでは一切参照しない。 ランタイムで重要でないデータなので、構造体サイズを4byteに切り詰めている。 */ struct CtrTextureConvertOpt { /// 出力フォーマットの指定。(CtrTexFormatをキャスト) unsigned char specFormat; /// ミップマップレベルの上限指定(0で無制限) unsigned char mipmapLimit; /// 圧縮の許可(0で禁止) unsigned char permitCompression; /// ETC1圧縮のメソッド unsigned char etc1Method; }; /** ファイルヘッダ。 \par 解説:  このデータ構造体はテクスチャパッケージ内に含まれているデータの構造を示している。 この構造体のサイズは意図して32byteにしてある。 ファイルの構造は次のようになる。 \code CtrTexturePackageHeader header; CtrTextureInfo textureInfo[header.numTexture] char *filePathBuffer (ファイルパス文字列のバッファ/可変長) CtrTextureHash *textureHash[header.numTexture] (データ領域) \endcode */ struct CtrTexturePackageHeader { /// マジックコード("CTPK"固定) char magic[4]; /// ファイル形式のバージョン番号(CTR_TEXTURE_PACKAGE_VERSIONが代入される) unsigned short version; /// テクスチャの枚数 unsigned short numTexture; /// 画像データの先頭までのオフセット unsigned int texDataOffset; /// 画像データのサイズ unsigned int texDataSize; /// ファイル名ハッシュまでのオフセット unsigned int texHashOffset; /// コンバートオプションテーブルまでのオフセット unsigned int convertOptOffset; /// 32byte境界へのパディング char pad[8]; }; }}} #endif // ifndef NN_TPL_INTERNAL_H_