⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 box.cpp

📁 俄罗斯方块源码
💻 CPP
字号:
/***************************************************************************/
/*                                                                         */
/*  Box.cpp                                                                */
/*                                                                         */
/*    The rect object which indicates a ...                                */
/*                                       .                                 */
/*                                                                         */
/*  Copyright 2007 by                                                      */
/*                  Kan(EMail: k32459871@126.com.)                         */
/*  Data: 2007-5-1                                                         */
/*                                                                         */
/***************************************************************************/

#include "Box.h"

Box::Box(RGBVAL fillColor):_isFilled(FALSE),_fillColor(fillColor)
{
    
}

Box::Box(RGBVAL fillColor,AEESize& Size):_isFilled(FALSE),_fillColor(fillColor)
{
    MEMCPY(&_Size,&Size,sizeof(Size));
}


void Box::SetSize(AEESize& Size)
{
    MEMCPY(&_Size,&Size,sizeof(AEESize));
}

void Box::Draw(AEEPoint& Point,IGraphics* pIGraphics) const
{
    if( NULL == pIGraphics)    
    {        
        return;
    }
    
    AEERect rect;
    rect.x = Point.x + 1;
    rect.y = Point.y + 1;
    rect.dx = static_cast<int16>(_Size.cx) - 1;
    rect.dy = static_cast<int16>(_Size.cy) - 1;

    unsigned char R = ColorMgr::Get_R(_fillColor);
    unsigned char G = ColorMgr::Get_G(_fillColor);
    unsigned char B = ColorMgr::Get_B(_fillColor);

    IGRAPHICS_SetFillColor (pIGraphics, R, G, B, 0);  
    IGRAPHICS_SetColor (pIGraphics, R, G, B, 0); 
    IGRAPHICS_SetFillMode (pIGraphics, TRUE);

    //int oldSize = IGRAPHICS_GetPointSize(pIGraphics);
    //IGRAPHICS_SetPointSize(pIGraphics,10);
    IGRAPHICS_DrawRect(pIGraphics,&rect);
    //IGRAPHICS_SetPointSize(pIGraphics,oldSize);
}

void Box::Set_Filled(boolean isFilled)
{
    _isFilled = isFilled;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -