📄 radarmap.cpp.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 + -