00001 //------------------------------------------------------------------------------ 00002 // Lamp : Open source game middleware 00003 // Copyright (C) 2004 Junpei Ohtani ( Email : junpee@users.sourceforge.jp ) 00004 // 00005 // This library is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU Lesser General Public 00007 // License as published by the Free Software Foundation; either 00008 // version 2.1 of the License, or (at your option) any later version. 00009 // 00010 // This library is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 // Lesser General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public 00016 // License along with this library; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 //------------------------------------------------------------------------------ 00019 00020 /** @file 00021 * 色スプライトステートヘッダ 00022 * @author Junpee 00023 */ 00024 00025 #ifndef COLOR_SPRITE_STATE_H_ 00026 #define COLOR_SPRITE_STATE_H_ 00027 00028 #include "Graphics2D/SpriteState/SpriteState.h" 00029 00030 namespace Lamp{ 00031 00032 //------------------------------------------------------------------------------ 00033 /** 00034 * 色スプライトステート 00035 */ 00036 class ColorSpriteState : public SpriteState{ 00037 public: 00038 //-------------------------------------------------------------------------- 00039 // テンプレートステート 00040 //-------------------------------------------------------------------------- 00041 /// 白 00042 static const ColorSpriteState whiteState; 00043 00044 /// 灰色 00045 static const ColorSpriteState grayState; 00046 00047 /// 黒 00048 static const ColorSpriteState blackState; 00049 00050 /// 赤 00051 static const ColorSpriteState redState; 00052 00053 /// 緑 00054 static const ColorSpriteState greenState; 00055 00056 /// 青 00057 static const ColorSpriteState blueState; 00058 00059 /// 黄 00060 static const ColorSpriteState yellowState; 00061 00062 /// 青緑 00063 static const ColorSpriteState cyanState; 00064 00065 /// 赤紫 00066 static const ColorSpriteState magentaState; 00067 00068 /// デフォルト 00069 static const ColorSpriteState defaultState; 00070 00071 //-------------------------------------------------------------------------- 00072 // 生成、破棄 00073 //-------------------------------------------------------------------------- 00074 /** 00075 * コンストラクタ 00076 */ 00077 ColorSpriteState(); 00078 00079 /** 00080 * コンストラクタ 00081 * @param color 色 00082 */ 00083 ColorSpriteState(const Color4f& color); 00084 00085 /** 00086 * デストラクタ 00087 */ 00088 virtual ~ColorSpriteState(); 00089 00090 //-------------------------------------------------------------------------- 00091 // デフォルトステート 00092 //-------------------------------------------------------------------------- 00093 /** 00094 * デフォルトステートの取得 00095 * @return デフォルトステート 00096 */ 00097 virtual const SpriteRequest* getDefaultState() const{ 00098 return &defaultState; 00099 } 00100 00101 //-------------------------------------------------------------------------- 00102 // 描画 00103 //-------------------------------------------------------------------------- 00104 /** 00105 * 適用 00106 * @param renderState レンダーステート 00107 */ 00108 virtual void apply(SpriteRenderState* renderState); 00109 00110 //-------------------------------------------------------------------------- 00111 // 色 00112 //-------------------------------------------------------------------------- 00113 /** 00114 * 色の設定 00115 * @param color 色 00116 */ 00117 virtual void setColor(const Color4f& color){ color_ = color; } 00118 00119 /** 00120 * 色の取得 00121 * @return 色 00122 */ 00123 virtual const Color4f& getColor() const{ return color_; } 00124 00125 private: 00126 //-------------------------------------------------------------------------- 00127 // 色 00128 Color4f color_; 00129 00130 }; 00131 00132 //------------------------------------------------------------------------------ 00133 } // End of namespace Lamp 00134 #endif // End of COLOR_SPRITE_STATE_H_ 00135 //------------------------------------------------------------------------------