本文整理汇总了C++中QuadItem函数的典型用法代码示例。如果您正苦于以下问题:C++ QuadItem函数的具体用法?C++ QuadItem怎么用?C++ QuadItem使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了QuadItem函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Graphics
void CAssetsEditor::RenderBackground()
{
Graphics()->TextureClear();
Graphics()->QuadsBegin();
Graphics()->SetColor(58.0f/255.0f, 58.0f/255.0f, 58.0f/255.0f, 1.0f);
IGraphics::CQuadItem QuadItem(m_DrawRect.w/2, m_DrawRect.h/2, m_DrawRect.w, m_DrawRect.h);
Graphics()->QuadsDraw(&QuadItem, 1);
Graphics()->QuadsEnd();
}
示例2: Graphics
int CMenus::DoButton_Icon(int ImageId, int SpriteId, const CUIRect *pRect)
{
Graphics()->TextureSet(g_pData->m_aImages[ImageId].m_Id);
Graphics()->QuadsBegin();
RenderTools()->SelectSprite(SpriteId);
IGraphics::CQuadItem QuadItem(pRect->x, pRect->y, pRect->w, pRect->h);
Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd();
return 0;
}
示例3: Graphics
int CMenus::DoButton_BrowseIcon(int What, const CUIRect *pRect)
{
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_BROWSEICONS].m_Id);
Graphics()->QuadsBegin();
RenderTools()->SelectSprite(What);
IGraphics::CQuadItem QuadItem(pRect->x, pRect->y, pRect->w, pRect->h);
Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd();
return 0;
}
示例4: RenderTools
int CMenus::DoButton_DemoPlayer_Sprite(const void *pID, int SpriteId, int Checked, const CUIRect *pRect)
{
RenderTools()->DrawUIRect(pRect, vec4(1,1,1, Checked ? 0.10f : 0.5f)*ButtonColorMul(pID), CUI::CORNER_ALL, 5.0f);
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_DEMOBUTTONS].m_Id);
Graphics()->QuadsBegin();
RenderTools()->SelectSprite(SpriteId);
IGraphics::CQuadItem QuadItem(pRect->x, pRect->y, pRect->w, pRect->h);
Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd();
return UI()->DoButtonLogic(pID, "", Checked, pRect);
}
示例5: Graphics
void CLayerTiles::BrushSelecting(CUIRect Rect)
{
Graphics()->TextureClear();
m_pEditor->Graphics()->QuadsBegin();
m_pEditor->Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.4f);
Snap(&Rect);
IGraphics::CQuadItem QuadItem(Rect.x, Rect.y, Rect.w, Rect.h);
m_pEditor->Graphics()->QuadsDrawTL(&QuadItem, 1);
m_pEditor->Graphics()->QuadsEnd();
char aBuf[16];
str_format(aBuf, sizeof(aBuf), "%d,%d", ConvertX(Rect.w), ConvertY(Rect.h));
TextRender()->Text(0, Rect.x+3.0f, Rect.y+3.0f, m_pEditor->m_ShowPicker?15.0f:15.0f*m_pEditor->m_WorldZoom, aBuf, -1);
}
示例6: time_get
void CAStar::OnRender()
{
if(!g_Config.m_ClPathFinding)
return;
// find the path one second after joining to be buffered
{
static int64 activationTime = 0;
if(m_MapReloaded)
{
activationTime = time_get();
}
if(activationTime && time_get() > activationTime+time_freq())
{
//FillGrid(true);
m_pThread = thread_init(BuildPath, this);
//thread_detach(m_pThread);
activationTime = 0;
}
else
m_MapReloaded = false;
}
const CNetObj_Character * pPlayerChar = m_pClient->m_Snap.m_pLocalCharacter;
const CNetObj_Character * pPrevChar = m_pClient->m_Snap.m_pLocalPrevCharacter;
if (pPlayerChar && pPrevChar)
m_LastPos = mix(vec2(pPrevChar->m_X, pPrevChar->m_Y), vec2(pPlayerChar->m_X, pPlayerChar->m_Y), Client()->IntraGameTick());
if(Client()->State() != IClient::STATE_ONLINE)
return;
// visualize the path
Graphics()->BlendAdditive();
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_PARTICLES].m_Id);
Graphics()->QuadsBegin();
for(int i = 0; i < m_Path.size(); i++)
{
int aSprites[] = {SPRITE_PART_SPLAT01, SPRITE_PART_SPLAT02, SPRITE_PART_SPLAT03};
RenderTools()->SelectSprite(aSprites[i%3]);
//Graphics()->QuadsSetRotation(Client()->GameTick());
Graphics()->SetColor(0.9f, 0.9f, 0.9f, 0.85f);
IGraphics::CQuadItem QuadItem(m_Path[i].x, m_Path[i].y, 16, 16);
Graphics()->QuadsDraw(&QuadItem, 1);
}
Graphics()->QuadsEnd();
}
示例7: RenderTools
int CMenus::DoButton_Sprite(const void *pID, int ImageID, int SpriteID, int Checked, const CUIRect *pRect, int Corners)
{
RenderTools()->DrawUIRect(pRect, Checked ? vec4(1.0f, 1.0f, 1.0f, 0.10f) : vec4(1.0f, 1.0f, 1.0f, 0.5f)*ButtonColorMul(pID), Corners, 5.0f);
Graphics()->TextureSet(g_pData->m_aImages[ImageID].m_Id);
Graphics()->QuadsBegin();
if(!Checked)
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.5f);
RenderTools()->SelectSprite(SpriteID);
IGraphics::CQuadItem QuadItem(pRect->x, pRect->y, pRect->w, pRect->h);
Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd();
return UI()->DoButtonLogic(pID, "", Checked, pRect);
}
示例8: HexToRgba
void CLayerTiles::BrushSelecting(CUIRect Rect)
{
vec4 FillColor = HexToRgba(g_Config.m_EdColorSelectionTile);
Graphics()->TextureClear();
m_pEditor->Graphics()->QuadsBegin();
m_pEditor->Graphics()->SetColor(FillColor.r*FillColor.a, FillColor.g*FillColor.a, FillColor.b*FillColor.a, FillColor.a);
Snap(&Rect);
IGraphics::CQuadItem QuadItem(Rect.x, Rect.y, Rect.w, Rect.h);
m_pEditor->Graphics()->QuadsDrawTL(&QuadItem, 1);
m_pEditor->Graphics()->QuadsEnd();
char aBuf[16];
str_format(aBuf, sizeof(aBuf), "%d,%d", ConvertX(Rect.w), ConvertY(Rect.h));
TextRender()->Text(0, Rect.x+3.0f, Rect.y+3.0f, m_pEditor->m_ShowTilePicker?15.0f:15.0f*m_pEditor->m_WorldZoom, aBuf, -1);
}
示例9: ButtonFade
int CMenus::DoButton_Sprite(const void *pID, int ImageID, int SpriteID, const CUIRect *pRect, int Corners)
{
float Seconds = 0.6f; // 0.6 seconds for fade
float *pFade = ButtonFade(pID, Seconds);
RenderTools()->DrawUIRect(pRect, vec4(1.0f, 1.0f, 1.0f, 0.5f+(*pFade/Seconds)*0.25f), Corners, 5.0f);
Graphics()->TextureSet(g_pData->m_aImages[ImageID].m_Id);
Graphics()->QuadsBegin();
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.5f);
RenderTools()->SelectSprite(SpriteID);
IGraphics::CQuadItem QuadItem(pRect->x, pRect->y, pRect->w, pRect->h);
Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd();
return UI()->DoButtonLogic(pID, "", false, pRect);
}
示例10: GetAngle
void CPlayers::RenderHand(CTeeRenderInfo *pInfo, vec2 CenterPos, vec2 Dir, float AngleOffset, vec2 PostRotOffset)
{
// for drawing hand
//const skin *s = skin_get(skin_id);
float BaseSize = 15.0f;
//dir = normalize(hook_pos-pos);
vec2 HandPos = CenterPos + Dir;
float Angle = GetAngle(Dir);
if (Dir.x < 0)
Angle -= AngleOffset;
else
Angle += AngleOffset;
vec2 DirX = Dir;
vec2 DirY(-Dir.y,Dir.x);
if (Dir.x < 0)
DirY = -DirY;
HandPos += DirX * PostRotOffset.x;
HandPos += DirY * PostRotOffset.y;
//Graphics()->TextureSet(data->m_aImages[IMAGE_CHAR_DEFAULT].id);
Graphics()->TextureSet(pInfo->m_aTextures[CSkins::SKINPART_HANDS]);
Graphics()->QuadsBegin();
vec4 Color = pInfo->m_aColors[CSkins::SKINPART_HANDS];
Graphics()->SetColor(Color.r, Color.g, Color.b, Color.a);
// two passes
for (int i = 0; i < 2; i++)
{
bool OutLine = i == 0;
RenderTools()->SelectSprite(OutLine?SPRITE_TEE_HAND_OUTLINE:SPRITE_TEE_HAND, 0, 0, 0);
Graphics()->QuadsSetRotation(Angle);
IGraphics::CQuadItem QuadItem(HandPos.x, HandPos.y, 2*BaseSize, 2*BaseSize);
Graphics()->QuadsDraw(&QuadItem, 1);
}
Graphics()->QuadsSetRotation(0);
Graphics()->QuadsEnd();
}
示例11: CALLSTACK_ADD
int CMenus::DoButton_Sprite(CButtonContainer *pBC, int ImageID, int SpriteID, int Checked, const CUIRect *pRect, int Corners, const char *pTooltip)
{
CALLSTACK_ADD();
RenderTools()->DrawUIRect(pRect, Checked ? vec4(1.0f, 1.0f, 1.0f, 0.10f) : vec4(1.0f, 1.0f, 1.0f, 0.5f)*ButtonColorMul(pBC), Corners, 5.0f);
Graphics()->TextureSet(g_pData->m_aImages[ImageID].m_Id);
Graphics()->QuadsBegin();
if(!Checked)
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 0.5f);
RenderTools()->SelectSprite(SpriteID);
IGraphics::CQuadItem QuadItem(pRect->x, pRect->y, pRect->w, pRect->h);
Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd();
if(UI()->MouseInside(pRect) && pTooltip)
m_pClient->m_pTooltip->SetTooltip(pTooltip);
return UI()->DoButtonLogic(pBC->GetID(), "", Checked, pRect);
}
示例12: Graphics
void CRenderTools::RenderItem(int ItemID, vec2 Pos, int TextureBlocks, float Scale, vec2 WeaponSize, float Alpha, float Rot)
{
if (ItemID >= NUM_WEAPONS)
{
Graphics()->TextureSet(TextureBlocks);
RenderTile((ItemID-NUM_WEAPONS)%CBlockManager::MAX_BLOCKS, vec2(Pos.x+7.5f, Pos.y+3.5f), Scale, Alpha, Rot);
}
else
{
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_GAME].m_Id);
Graphics()->QuadsBegin();
SelectSprite(g_pData->m_Weapons.m_aId[ItemID%NUM_WEAPONS].m_pSpriteBody);
Graphics()->SetColor(1.0f, 1.0f, 1.0f, Alpha);
IGraphics::CQuadItem QuadItem(Pos.x, Pos.y, WeaponSize.x, WeaponSize.y);
Graphics()->QuadsSetRotation(Rot);
Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd();
}
}
示例13: Graphics
void CItems::RenderFlag(const CNetObj_Flag *pPrev, const CNetObj_Flag *pCurrent)
{
float Angle = 0.0f;
float Size = 42.0f;
Graphics()->BlendNormal();
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_GAME].m_Id);
Graphics()->QuadsBegin();
if(pCurrent->m_Team == TEAM_RED)
RenderTools()->SelectSprite(SPRITE_FLAG_RED);
else
RenderTools()->SelectSprite(SPRITE_FLAG_BLUE);
Graphics()->QuadsSetRotation(Angle);
vec2 Pos = mix(vec2(pPrev->m_X, pPrev->m_Y), vec2(pCurrent->m_X, pCurrent->m_Y), Client()->IntraGameTick());
// make sure that the flag isn't interpolated between capture and return
if(pPrev->m_CarriedBy != pCurrent->m_CarriedBy)
Pos = vec2(pCurrent->m_X, pCurrent->m_Y);
// make sure to use predicted position if we are the carrier
if(m_pClient->m_Snap.m_pLocalInfo && pCurrent->m_CarriedBy == m_pClient->m_Snap.m_pLocalInfo->m_ClientID)
Pos = m_pClient->m_LocalCharacterPos;
if(pCurrent->m_Team == 0) // red team
{
//RenderTools()->SelectSprite(SPRITE_FLAG_RED);
if(g_Config.m_ClEffectsFlagtrail)
m_pClient->m_pEffects->PowerupShine(Pos, vec2(32,32),vec4(0.89f,0.16f,0.21f,1));
}
else
{
//RenderTools()->SelectSprite(SPRITE_FLAG_BLUE);
if(g_Config.m_ClEffectsFlagtrail)
m_pClient->m_pEffects->PowerupShine(Pos, vec2(32,32),vec4(0.098f,0.10f,0.89f,1));
}
IGraphics::CQuadItem QuadItem(Pos.x, Pos.y-Size*0.75f, Size, Size*2);
Graphics()->QuadsDraw(&QuadItem, 1);
Graphics()->QuadsEnd();
}
示例14: GetByCountryCode
void CCountryFlags::Render(int CountryCode, const vec4 *pColor, float x, float y, float w, float h)
{
const CCountryFlag *pFlag = GetByCountryCode(CountryCode);
if(pFlag->m_Texture != -1)
{
Graphics()->TextureSet(pFlag->m_Texture);
Graphics()->QuadsBegin();
Graphics()->SetColor(pColor->r, pColor->g, pColor->b, pColor->a);
IGraphics::CQuadItem QuadItem(x, y, w, h);
Graphics()->QuadsDrawTL(&QuadItem, 1);
Graphics()->QuadsEnd();
}
else
{
CTextCursor Cursor;
TextRender()->SetCursor(&Cursor, x, y, 10.0f, TEXTFLAG_RENDER|TEXTFLAG_STOP_AT_END);
Cursor.m_LineWidth = w;
TextRender()->TextEx(&Cursor, pFlag->m_aCountryCodeString, -1);
}
}
示例15: mix
void CBuildings::RenderStand(const CNetObj_Building *pCurrent, const CNetObj_Building *pPrev)
{
vec2 Pos = mix(vec2(pPrev->m_X, pPrev->m_Y), vec2(pCurrent->m_X, pCurrent->m_Y), Client()->IntraGameTick());
int s = pCurrent->m_Status;
bool Flip = s & (1<<BSTATUS_MIRROR);
int FlipY = Flip ? -1 : 1;
Graphics()->TextureSet(g_pData->m_aImages[IMAGE_BUILDINGS].m_Id);
Graphics()->QuadsBegin();
RenderTools()->SelectSprite(SPRITE_STAND, Flip ? SPRITE_FLAG_FLIP_Y : 0);
Graphics()->SetColor(1, 1, 1, 1);
Graphics()->QuadsSetRotation(0);
//RenderTools()->DrawSprite(pCurrent->m_X, pCurrent->m_Y-24, 96*1.3f);
float Scale = 0.8f;
IGraphics::CQuadItem QuadItem(Pos.x, Pos.y-25*FlipY, 96*Scale, 128*Scale); // -37
Graphics()->QuadsDraw(&QuadItem, 1);
Graphics()->QuadsEnd();
// skip tip if local player is undead
if (m_pClient->m_Snap.m_pGameInfoObj)
{
int Flags = m_pClient->m_Snap.m_pGameInfoObj->m_GameFlags;
if (Flags & GAMEFLAG_INFECTION && CustomStuff()->m_LocalTeam == TEAM_BLUE)
return;
}
// render drop weapon tip for local player
if (distance(CustomStuff()->m_LocalPos, vec2(Pos.x, Pos.y+15)) < 45 && ValidForTurret(CustomStuff()->m_LocalWeapon))
{
TextRender()->TextColor(0.2f, 0.7f, 0.2f, 1);
TextRender()->Text(0, Pos.x + 22, Pos.y - 30 - 60*FlipY, 32, m_pClient->m_pBinds->GetKey("+dropweapon"), -1);
TextRender()->TextColor(1, 1, 1, 1);
}
}