本文整理汇总了C++中AInventory::PrevInv方法的典型用法代码示例。如果您正苦于以下问题:C++ AInventory::PrevInv方法的具体用法?C++ AInventory::PrevInv怎么用?C++ AInventory::PrevInv使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AInventory
的用法示例。
在下文中一共展示了AInventory::PrevInv方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawInventory
static void DrawInventory(player_t * CPlayer, int x,int y)
{
AInventory * rover;
int numitems = (hudwidth - 2*x) / 32;
int i;
CPlayer->mo->InvFirst = rover = StatusBar->ValidateInvFirst(numitems);
if (rover!=NULL)
{
if(rover->PrevInv())
{
screen->DrawTexture(invgems[!!(level.time&4)], x-10, y,
DTA_KeepRatio, true,
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0x6666, TAG_DONE);
}
for(i=0;i<numitems && rover;rover=rover->NextInv())
{
if (rover->Amount>0)
{
FTextureID AltIcon = GetHUDIcon(rover->GetClass());
if (AltIcon.Exists() && (rover->Icon.isValid() || AltIcon.isValid()) )
{
int trans = rover==CPlayer->mo->InvSel ? FRACUNIT : 0x6666;
DrawImageToBox(TexMan[AltIcon.isValid()? AltIcon : rover->Icon], x, y, 19, 25, trans);
if (rover->Amount>1)
{
char buffer[10];
int xx;
mysnprintf(buffer, countof(buffer), "%d", rover->Amount);
if (rover->Amount>=1000) xx = 32 - IndexFont->StringWidth(buffer);
else xx = 22;
screen->DrawText(IndexFont, CR_GOLD, x+xx, y+20, buffer,
DTA_KeepRatio, true,
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, trans, TAG_DONE);
}
x+=32;
i++;
}
}
}
if(rover)
{
screen->DrawTexture(invgems[2 + !!(level.time&4)], x-10, y,
DTA_KeepRatio, true,
DTA_VirtualWidth, hudwidth, DTA_VirtualHeight, hudheight, DTA_Alpha, 0x6666, TAG_DONE);
}
}
}