Esempio n. 1
0
void TextElement::Draw(const Color &draw_color) const
{
    // Don't draw anything if this image is completely transparent (invisible)
    if(IsFloatEqual(draw_color[3], 0.0f))
        return;

    VideoManager->PushMatrix();
    _DrawOrientation();

    if(draw_color == Color::white) {
        _DrawTexture(_color);
    } else {
        Color modulated_colors[4];
        modulated_colors[0] = _color[0] * draw_color;
        modulated_colors[1] = _color[1] * draw_color;
        modulated_colors[2] = _color[2] * draw_color;
        modulated_colors[3] = _color[3] * draw_color;

        _DrawTexture(modulated_colors);
    }

    VideoManager->PopMatrix();
} // void TextElement::Draw(const Color& draw_color) const
Esempio n. 2
0
/*!
@brief テクスチャの描画
@par   関数説明
テクスチャを描画する。始点は左上。
@param txnum テクスチャ番号。
@param dx 描画x座標。
@param dy 描画y座標。
@param rx 読み込みx座標。
@param ry 読み込みy座標。
@param w 読み込み幅。
@param h 読み込み高さ。
@return 1=テクスチャ番号が不正。
@return 2=テクスチャがない。
@return 3=テクスチャセットに失敗。
@return 4=テクスチャ設定に失敗。
@return 5=頂点ストリームの設定に失敗。
@return 6=レンダリングに失敗。
*/
int DirectXDraw9::DrawTexture( unsigned int txnum, int dx, int dy, int rx, int ry, int w, int h, int flag )
{
	if ( txnum >= texmax )//if( txnum >= texmax )
	{
		//テクスチャ番号が不正
		return 1;
	}

	_SetUV( (float)dxtex[ txnum ].width, (float)dxtex[ txnum ].height, rx, ry, w, h, flag );
	_SetColor( dxtex[ txnum ].vcolor );
	_DrawTexture( (float)dx, (float)dy, (float)w, (float)h );

	return EndDrawTexture( dxtex[ txnum ].tex );
}