1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: font_CmdCache.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: 27535 $ 14 *---------------------------------------------------------------------------*/ 15 16 #ifndef NN_FONT_CTR_FONT_CMD_CACHE_H_ 17 #define NN_FONT_CTR_FONT_CMD_CACHE_H_ 18 19 #include <GLES2/gl2.h> 20 #include <nn/gx.h> 21 22 namespace nn { 23 namespace font { 24 namespace CTR { 25 26 //! :private 27 //! @brief コマンドキャッシュクラスです。 28 class CmdCache 29 { 30 public: 31 CmdCache(); 32 33 void Init( 34 void* buffer, 35 u32 size, 36 bool isCopy = true); 37 38 void Use() const; 39 40 void Add( 41 const u32* command, 42 u32 size); 43 44 void RoundUp(u8 align); 45 Clear()46 void Clear() { m_CmdBufferSize = 0; } 47 GetAddr()48 void* GetAddr() const { return m_CmdBuffer; } 49 GetSize()50 GLsizei GetSize() const { return m_CmdBufferSize; } 51 52 void Dump( 53 bool asF32 = false, 54 bool showMnemonic = false 55 ) const 56 #if !defined(NN_BUILD_NOOPT) && !defined(NN_BUILD_VERBOSE) 57 { 58 (void)asF32; 59 (void)showMnemonic; 60 } 61 #else 62 ; 63 #endif 64 65 static void Dump( 66 const void* from, 67 const void* to, 68 bool asF32 = false, 69 bool showMnemonic = false 70 ) 71 #if !defined(NN_BUILD_NOOPT) && !defined(NN_BUILD_VERBOSE) 72 { 73 (void)from; 74 (void)to; 75 (void)asF32; 76 (void)showMnemonic; 77 } 78 #else 79 ; 80 #endif 81 82 private: 83 static void DumpCommon( 84 const void* from, 85 const void* to, 86 bool asF32, 87 bool showMnemonic 88 ); 89 90 GLubyte* m_CmdBuffer; 91 GLsizei m_CmdBufferSize; 92 GLsizei m_CmdMaxBufferSize; 93 94 bool m_IsCopy; 95 NN_PADDING3; 96 }; 97 98 } // namespace CTR 99 } // namespace font 100 } // namespace nn 101 102 #endif // NN_FONT_CTR_FONT_CMD_CACHE_H_ 103