/*---------------------------------------------------------------------------* Project: NintendoWare File: lyt_DrawInfo.h Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo and/or its licensed developers and are protected by national and international copyright laws. 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. The content herein is highly confidential and should be handled accordingly. $Revision: 31311 $ *---------------------------------------------------------------------------*/ #ifndef NW_LYT_DRAWINFO_H_ #define NW_LYT_DRAWINFO_H_ #include #include #include namespace nw { namespace lyt { class GraphicsResource; class Layout; //--------------------------------------------------------------------------- //! :category 描画 //! //! @brief 描画情報クラスです。 //! //! @details //! 全体的な描画方法の制御や、描画中の情報の受け渡しに使用されます。 //! //! 描画の前に SetGraphicsResource() により GraphicsResource を //! 設定しておく必要があります。 //! //! @sa Layout //! //! @since 2009/09/18 初版。 //--------------------------------------------------------------------------- class DrawInfo { public: //---------------------------------------- //! @name コンストラクタ/デストラクタ //@{ //! @brief コンストラクタです。 //! //! @since 2009/09/18 初版。 //! DrawInfo(); //! @brief デストラクタです。 //! //! @since 2009/09/18 初版。 //! virtual ~DrawInfo(); //@} //---------------------------------------- //! @name 取得/設定 //@{ //! @brief 現在のビュー行列を取得します。 //! //! @return ビュー行列を返します。 //! //! @sa SetViewMtx //! //! @since 2009/09/18 初版。 //! const math::MTX34& GetViewMtx() const { return m_ViewMtx; } //! @brief ビュー行列を設定します。 //! //! @param value ビュー行列です。 //! //! @sa GetViewMtx //! //! @since 2009/09/18 初版。 //! void SetViewMtx(const math::MTX34& value) { m_ViewMtx = value; } //! @brief 親のアルファ値の変化が子に影響するかどうかを判定します。 //! //! @return 親のアルファ値の変化が子に影響する場合は true を返します。 //! //! @sa SetInfluencedAlpha //! //! @since 2009/09/18 初版。 //! bool IsInfluencedAlpha() const { return m_Flag.influencedAlpha; } //! @brief 親のアルファ値の変化が子に影響するかどうかを設定します。 //! //! @param bEnable 親のアルファ値の変化を子に影響させる場合には true を指定します。 //! //! @sa IsInfluencedAlpha //! //! @since 2009/09/18 初版。 //! void SetInfluencedAlpha(bool bEnable) { m_Flag.influencedAlpha = bEnable; } //! @brief 位置調整処理を行うかどうかの設定を取得します。 //! //! @return 位置調整処理を行う場合は true を返します。 //! //! @sa SetLocationAdjust //! //! @since 2009/09/18 初版。 //! bool IsLocationAdjust() const { return m_Flag.locationAdjust; } //! @brief 位置調整処理を行うかどうかを設定します。 //! //! @param bEnable 位置調整処理を行う場合には true を指定します。 //! //! @details //! 位置調整処理を有効にした場合、Pane::IsLocationAdjust() が true を //! を返すペインに位置調整処理のスケールが適用されます。 //! //! 該当ペインの子孫ペインも位置調整処理のスケールの影響を受けます。 //! //! @sa IsLocationAdjust //! @sa SetLocationAdjustScale //! @sa Pane::IsLocationAdjust //! //! @since 2009/09/18 初版。 //! void SetLocationAdjust(bool bEnable) { m_Flag.locationAdjust = bEnable; } //! @brief 位置調整処理のスケールを取得します。 //! //! @return 位置調整処理のスケールを返します。 //! //! @sa SetLocationAdjustScale //! //! @since 2009/09/18 初版。 //! const math::VEC2& GetLocationAdjustScale() const { return m_LocationAdjustScale; } //! @brief 位置調整処理のスケールを設定します。 //! //! @param scale スケールです。 //! //! @sa GetLocationAdjustScale //! //! @since 2009/09/18 初版。 //! void SetLocationAdjustScale(const math::VEC2& scale) { m_LocationAdjustScale = scale; } //! @brief アルファ値を取得します。 //! //! @return アルファ値を返します。 //! //! @sa SetGlobalApha //! //! @since 2009/09/18 初版。 //! f32 GetGlobalAlpha() const { return m_GlobalAlpha; } //! @brief アルファ値を設定します。 //! //! @param alpha アルファ値です。 //! //! @sa GetGlobalAlpha //! //! @since 2009/09/18 初版。 //! void SetGlobalAlpha(f32 alpha) { m_GlobalAlpha = alpha; } //! @brief 非表示のペインに対して行列計算を行うかどうかを判定します。 //! //! @return 非表示のペインに対して行列計算を行う場合は true を返します。 //! //! @sa SetInvisiblePaneCalculateMtx //! //! @since 2009/09/18 初版。 //! bool IsInvisiblePaneCalculateMtx() const { return m_Flag.invisiblePaneCalculateMtx; } //! @brief 非表示のペインに対して行列計算を行うかどうかを設定します。 //! //! @param bEnable 非表示のペインに対して行列計算を行う場合には true を指定します。 //! //! @details //! bEnable に true を指定した場合、非表示のペインに対しても Pane::CalculateMtx() を //! 呼び出して行列計算を行います。 //! //! @sa IsInvisiblePaneCalculateMtx //! @sa Pane::CalculateMtx //! @sa Pane::IsVisible //! //! @since 2009/09/18 初版。 //! void SetInvisiblePaneCalculateMtx(bool bEnable) { m_Flag.invisiblePaneCalculateMtx = bEnable; } #if ! defined(NW_RELEASE) //! @brief デバッグモードか判定します。 //! //! @details //! この関数は %Final ビルドでは提供されません。 //! //! @return デバッグモードなら true を返します。 //! //! @sa SetDebugDrawMode //! //! @since 2009/09/18 初版。 //! bool IsDebugDrawMode() const { return m_Flag.debugDrawMode; } //! @brief デバッグモードを設定します。 //! //! @details //! この関数は %Final ビルドでは提供されません。 //! //! デバッグモードにすると Null, Bounding ペインの位置が表示されます。 //! //! @param bEnable デバッグモードにする場合には true を指定します。 //! //! @sa IsDebugDrawMode //! //! @since 2009/09/18 初版。 //! void SetDebugDrawMode(bool bEnable) { m_Flag.debugDrawMode = bEnable; } #endif //! @brief %GraphicsResource オブジェクトを取得します。 //! //! @return GraphicsResource オブジェクトへのポインタを返します。 //! //! @sa SetGraphicsResource //! //! @since 2009/09/18 初版。 //! GraphicsResource* GetGraphicsResource() const { return m_pGraphicsResource; } //! @brief %GraphicsResource オブジェクトを設定します。 //! //! @param pGraphicsResource GraphicsResource オブジェクトへのポインタです。 //! //! @sa GetGraphicsResource //! //! @since 2009/09/18 初版。 //! void SetGraphicsResource(GraphicsResource* pGraphicsResource) { m_pGraphicsResource = pGraphicsResource; } //! @brief 射影行列を設定します。 //! //! @param mtx 射影行列です。 //! //! @since 2009/09/18 初版。 //! void SetProjectionMtx(const nw::math::MTX44& mtx); //@} //! :private //! @brief 描画中のレイアウトを取得します。 //! //! @details //! Layout::Draw() の実行中に現在描画しているレイアウトを取得します。 //! //! @return レイアウトへのポインタを返します。 //! Layout* GetLayout() const { return m_pLayout; } //! :private //! @brief これから描画するレイアウトを設定します。 void SetLayout(Layout* pLayout) const { m_pLayout = pLayout; } //! :private //! @brief 射影行列を取得します。 const nw::math::MTX44& GetProjectionMtx() const { return m_ProjMtx; } protected: //! @details :private math::MTX44 m_ProjMtx; //! @details :private math::MTX34 m_ViewMtx; //! @details :private math::VEC2 m_LocationAdjustScale; //! @details :private f32 m_GlobalAlpha; //! @details :private GraphicsResource* m_pGraphicsResource; //! @details :private mutable Layout* m_pLayout; //! :private //! @brief フラグです。 struct Flag { u8 influencedAlpha : 1; u8 locationAdjust : 1; u8 invisiblePaneCalculateMtx : 1; #if ! defined(NW_RELEASE) u8 debugDrawMode : 1; #endif }; //! @details :private Flag m_Flag; }; } // namespace nw::lyt } // namespace nw #endif // NW_LYT_DRAWINFO_H_