本文整理汇总了C++中AInventory::GetBlend方法的典型用法代码示例。如果您正苦于以下问题:C++ AInventory::GetBlend方法的具体用法?C++ AInventory::GetBlend怎么用?C++ AInventory::GetBlend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AInventory
的用法示例。
在下文中一共展示了AInventory::GetBlend方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: V_AddPlayerBlend
void V_AddPlayerBlend (player_t *CPlayer, float blend[4], float maxinvalpha, int maxpainblend)
{
int cnt;
// [RH] All powerups can affect the screen blending now
for (AInventory *item = CPlayer->mo->Inventory; item != NULL; item = item->Inventory)
{
PalEntry color = item->GetBlend ();
if (color.a != 0)
{
V_AddBlend (color.r/255.f, color.g/255.f, color.b/255.f, color.a/255.f, blend);
if (color.a/255.f > maxinvalpha) maxinvalpha = color.a/255.f;
}
}
if (CPlayer->bonuscount)
{
cnt = CPlayer->bonuscount << 3;
V_AddBlend (RPART(gameinfo.pickupcolor)/255.f, GPART(gameinfo.pickupcolor)/255.f,
BPART(gameinfo.pickupcolor)/255.f, cnt > 128 ? 0.5f : cnt / 255.f, blend);
}
PalEntry painFlash = CPlayer->mo->DamageFade;
CPlayer->mo->GetClass()->GetPainFlash(CPlayer->mo->DamageTypeReceived, &painFlash);
if (painFlash.a != 0)
{
cnt = DamageToAlpha[MIN (113, CPlayer->damagecount * painFlash.a / 255)];
if (cnt)
{
if (cnt > maxpainblend)
cnt = maxpainblend;
V_AddBlend (painFlash.r / 255.f, painFlash.g / 255.f, painFlash.b / 255.f, cnt / 255.f, blend);
}
}
// Unlike Doom, I did not have any utility source to look at to find the
// exact numbers to use here, so I've had to guess by looking at how they
// affect the white color in Hexen's palette and picking an alpha value
// that seems reasonable.
// [Gez] The exact values could be obtained by looking how they affect
// each color channel in Hexen's palette.
if (CPlayer->poisoncount)
{
cnt = MIN (CPlayer->poisoncount, 64);
if (paletteflash & PF_POISON)
{
V_AddBlend(44/255.f, 92/255.f, 36/255.f, ((cnt + 7) >> 3) * 0.1f, blend);
}
示例2: SetFixedColormap
void FGLRenderer::SetFixedColormap (player_t *player)
{
gl_fixedcolormap=CM_DEFAULT;
// check for special colormaps
player_t * cplayer = player->camera->player;
if (cplayer)
{
if (cplayer->extralight == INT_MIN)
{
gl_fixedcolormap=CM_FIRSTSPECIALCOLORMAP + INVERSECOLORMAP;
extralight=0;
}
else if (cplayer->fixedcolormap != NOFIXEDCOLORMAP)
{
gl_fixedcolormap = CM_FIRSTSPECIALCOLORMAP + cplayer->fixedcolormap;
}
else if (cplayer->fixedlightlevel != -1)
{
for(AInventory * in = cplayer->mo->Inventory; in; in = in->Inventory)
{
PalEntry color = in->GetBlend ();
// Need special handling for light amplifiers
if (in->IsKindOf(RUNTIME_CLASS(APowerTorch)))
{
gl_fixedcolormap = cplayer->fixedlightlevel + CM_TORCH;
}
else if (in->IsKindOf(RUNTIME_CLASS(APowerLightAmp)))
{
gl_fixedcolormap = CM_LITE;
}
}
}
}
gl_RenderState.SetFixedColormap(gl_fixedcolormap);
}