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

📄 radarmap.cpp.svn-base

📁 坦克大战游戏完整全套源代码
💻 SVN-BASE
字号:
#include "gameDef.h"
#include "radarMap.h"

Entity::iEntity *RadarMap::getEntityInterface(EntityInterfaceId id)
{
    switch(id)
    {
    case EII_GraphicEntity:
        return &graphicEntity;
    }
    return Entity::getEntityInterface(id);
}

void RadarMap::GraphicEntity::render(float gameTime, float deltaTime)
{
    Point2f pos;

    deltaTime;

    RenderQueue::getSingleton().render(getEntity().pos, 0, int(gameTime * 60), anim, GLI_UI, true);

    for (vector<iAttacheeEntity*>::const_iterator ie = getEntity().entities.begin(); ie != getEntity().entities.end(); ++ie)
    {
        if (((iRadarEntity*)*ie)->getEntity().getStatus(ESI_Position, &pos))
        {
            pos *= 200.0f / 4000.0f;
            pos += getEntity().pos;
            RenderQueue::getSingleton().render(pos + Point2f(-2, -2), pos + Point2f(2, 2), ARGB(255, 0, 0, 255), GLI_UI, true);
            RenderQueue::getSingleton().render(pos + Point2f(2, -2), pos + Point2f(-2, 2), ARGB(255, 0, 0, 255), GLI_UI, true);
        }
    }
    Point2f viewerPos = RenderQueue::getSingleton().getViewerPos() * 200.0f / 4000.0f + getEntity().pos;
    const Point2f &windowSize = RenderQueue::getSingleton().getWindowSize();
    Point2f windowRange(windowSize.x / 4000.0f, windowSize.y / 4000.0f);
    windowRange *= 200.0f;

    RenderQueue::getSingleton().render(viewerPos + Point2f(0, 0), viewerPos + Point2f(windowRange.x, 0), ARGB(255, 255, 255, 255), GLI_UI, true);
    RenderQueue::getSingleton().render(viewerPos + Point2f(windowRange.x, windowRange.y), viewerPos + Point2f(windowRange.x, 0), ARGB(255, 255, 255, 255), GLI_UI, true);
    RenderQueue::getSingleton().render(viewerPos + Point2f(windowRange.x, windowRange.y), viewerPos + Point2f(0, windowRange.y), ARGB(255, 255, 255, 255), GLI_UI, true);
    RenderQueue::getSingleton().render(viewerPos + Point2f(0, 0), viewerPos + Point2f(0, windowRange.y), ARGB(255, 255, 255, 255), GLI_UI, true);
}

⌨️ 快捷键说明

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