本文整理汇总了C++中UpdateVisuals函数的典型用法代码示例。如果您正苦于以下问题:C++ UpdateVisuals函数的具体用法?C++ UpdateVisuals怎么用?C++ UpdateVisuals使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UpdateVisuals函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateVisuals
// Handles the WM_KEYDOWN message
LRESULT CApplication::OnKeyDown(WPARAM wParam)
{
LRESULT lr = 0;
if (_state == CApplication::VIEW_STATE::ZOOMEDOUT)
{
if (wParam == '1' && _currentVisual != 0)
{
lr = UpdateVisuals(_currentVisual, 0);
_currentVisual = 0;
}
else if (wParam == '2' && _currentVisual != 1)
{
lr = UpdateVisuals(_currentVisual, 1);
_currentVisual = 1;
}
else if (wParam == '3' && _currentVisual != 2)
{
lr = UpdateVisuals(_currentVisual, 2);
_currentVisual = 2;
}
else if (wParam == '4' && _currentVisual != 3)
{
lr = UpdateVisuals(_currentVisual, 3);
_currentVisual = 3;
}
}
return lr;
}
示例2: idVec4
/*
================
rvEffect::UpdateChangeableSpawnArgs
================
*/
void rvEffect::UpdateChangeableSpawnArgs( const idDict *source ) {
const char* fx;
const idDecl *newEffect;
bool newLoop;
idEntity::UpdateChangeableSpawnArgs(source);
if ( !source ) {
return;
}
if ( source->GetString ( "fx", "", &fx ) && *fx ) {
newEffect = ( const idDecl * )declManager->FindEffect( fx );
} else {
newEffect = NULL;
}
idVec3 color;
source->GetVector( "_color", "1 1 1", color );
renderEntity.shaderParms[ SHADERPARM_RED ] = color[0];
renderEntity.shaderParms[ SHADERPARM_GREEN ] = color[1];
renderEntity.shaderParms[ SHADERPARM_BLUE ] = color[2];
renderEntity.shaderParms[ SHADERPARM_ALPHA ] = source->GetFloat ( "_alpha", "1" );
renderEntity.shaderParms[ SHADERPARM_BRIGHTNESS ] = source->GetFloat ( "_brightness", "1" );
if ( clientEffect ) {
clientEffect->SetColor ( idVec4(color[0],color[1],color[2],renderEntity.shaderParms[ SHADERPARM_ALPHA ]) );
clientEffect->SetBrightness ( renderEntity.shaderParms[ SHADERPARM_BRIGHTNESS ] );
}
source->GetBool ( "loop", "0", newLoop );
spawnArgs.Copy( *source );
// IF the effect handle has changed or the loop status has changed then restart the effect
if ( newEffect != effect || loop != newLoop ) {
Stop ( false );
loop = newLoop;
effect = newEffect;
if ( effect ) {
Play ( );
BecomeActive( TH_THINK );
UpdateVisuals();
} else {
BecomeInactive ( TH_THINK );
UpdateVisuals();
}
}
}
示例3: UpdateVisuals
void idTrembler::Arm( void )
{
if ( !itemEnt.IsValid() )
{
idStr itemName = spawnArgs.GetString( "itemname", "" );
if ( itemName.Length() )
{
itemEnt = gameLocal.FindEntity( itemName );
if (!itemEnt.IsValid())
{
common->Warning("idTrembler %s couldn't find item '%s'.", name.c_str(), itemName.c_str());
}
}
else
{
common->Warning("idTrembler %s has no 'itemname' value.", name.c_str());
}
}
if (itemEnt.IsValid())
{
itemOriginalPosition = itemEnt.GetEntity()->GetPhysics()->GetOrigin();
}
state = 0;
renderEntity.shaderParms[ SHADERPARM_RED ] = 1;
renderEntity.shaderParms[ SHADERPARM_GREEN ] = 1;
renderEntity.shaderParms[ SHADERPARM_BLUE ] = 0;
UpdateVisuals();
}
示例4: UpdateVisuals
void hhFuncEmitter::ReadFromSnapshot( const idBitMsgDelta &msg ) {
renderEntity.shaderParms[ SHADERPARM_PARTICLE_STOPTIME ] = msg.ReadFloat();
renderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = msg.ReadFloat();
if ( msg.HasChanged() ) {
UpdateVisuals();
}
}
示例5: GetPhysics
void hhShuttleForceField::ReadFromSnapshot( const idBitMsgDelta &msg ) {
int contents = msg.ReadBits(32);
if (contents != GetPhysics()->GetContents()) {
GetPhysics()->SetContents(contents);
}
nextCollideFxTime = msg.ReadBits(32);
fieldState = (States)msg.ReadBits(8);
fade.SetStartTime(msg.ReadFloat());
fade.SetDuration(msg.ReadFloat());
fade.SetStartValue(msg.ReadFloat());
fade.SetEndValue(msg.ReadFloat());
float f;
bool changed = false;
f = msg.ReadFloat();
changed = (changed || (renderEntity.shaderParms[SHADERPARM_TIMEOFFSET] != f));
renderEntity.shaderParms[SHADERPARM_TIMEOFFSET] = f;
f = msg.ReadFloat();
changed = (changed || (renderEntity.shaderParms[SHADERPARM_MODE] != f));
renderEntity.shaderParms[SHADERPARM_MODE] = f;
if (changed) {
UpdateVisuals();
}
}
示例6: UpdateVisuals
/*
================
idSecurityCamera::SetAlertMode
================
*/
void idSecurityCamera::SetAlertMode( int alert ) {
if( alert >= SCANNING && alert <= ACTIVATED ) {
alertMode = alert;
}
renderEntity.shaderParms[ SHADERPARM_MODE ] = alertMode;
UpdateVisuals();
}
示例7: GetPhysics
/*
================
idExplodingBarrel::Event_Respawn
================
*/
void idExplodingBarrel::Event_Respawn() {
int i;
int minRespawnDist = spawnArgs.GetInt( "respawn_range", "256" );
if ( minRespawnDist ) {
float minDist = -1;
for ( i = 0; i < gameLocal.numClients; i++ ) {
if ( !gameLocal.entities[ i ] || !gameLocal.entities[ i ]->IsType( idPlayer::Type ) ) {
continue;
}
idVec3 v = gameLocal.entities[ i ]->GetPhysics()->GetOrigin() - GetPhysics()->GetOrigin();
float dist = v.Length();
if ( minDist < 0 || dist < minDist ) {
minDist = dist;
}
}
if ( minDist < minRespawnDist ) {
PostEventSec( &EV_Respawn, spawnArgs.GetInt( "respawn_again", "10" ) );
return;
}
}
const char *temp = spawnArgs.GetString( "model" );
if ( temp && *temp ) {
SetModel( temp );
}
health = spawnArgs.GetInt( "health", "5" );
fl.takedamage = true;
physicsObj.SetOrigin( spawnOrigin );
physicsObj.SetAxis( spawnAxis );
physicsObj.SetContents( CONTENTS_SOLID );
physicsObj.DropToFloor();
state = NORMAL;
Show();
UpdateVisuals();
}
示例8: UpdateVisuals
/*
======================
idMoveableItem::ReadFromSnapshot
======================
*/
void idMoveableItem::ReadFromSnapshot(const idBitMsgDelta &msg)
{
physicsObj.ReadFromSnapshot(msg);
if (msg.HasChanged()) {
UpdateVisuals();
}
}
示例9: SetModel
/*
================
idLight::BecomeBroken
================
*/
void idLight::BecomeBroken( idEntity *activator ) {
const char *damageDefName;
fl.takedamage = false;
if ( brokenModel.Length() ) {
SetModel( brokenModel );
if ( !spawnArgs.GetBool( "nonsolid" ) ) {
GetPhysics()->SetClipModel( new idClipModel( brokenModel.c_str() ), 1.0f );
GetPhysics()->SetContents( CONTENTS_SOLID );
}
} else if ( spawnArgs.GetBool( "hideModelOnBreak" ) ) {
SetModel( "" );
GetPhysics()->SetContents( 0 );
}
if ( gameLocal.isServer ) {
ServerSendEvent( EVENT_BECOMEBROKEN, NULL, true, -1 );
if ( spawnArgs.GetString( "def_damage", "", &damageDefName ) ) {
idVec3 origin = renderEntity.origin + renderEntity.bounds.GetCenter() * renderEntity.axis;
gameLocal.RadiusDamage( origin, activator, activator, this, this, damageDefName );
}
}
ActivateTargets( activator );
// offset the start time of the shader to sync it to the game time
renderEntity.shaderParms[ SHADERPARM_TIMEOFFSET ] = -MS2SEC( gameLocal.time );
renderLight.shaderParms[ SHADERPARM_TIMEOFFSET ] = -MS2SEC( gameLocal.time );
// set the state parm
renderEntity.shaderParms[ SHADERPARM_MODE ] = 1;
renderLight.shaderParms[ SHADERPARM_MODE ] = 1;
// if the light has a sound, either start the alternate (broken) sound, or stop the sound
const char *parm = spawnArgs.GetString( "snd_broken" );
if ( refSound.shader || ( parm && *parm ) ) {
StopSound( SND_CHANNEL_ANY, false );
const idSoundShader *alternate = refSound.shader ? refSound.shader->GetAltSound() : declManager->FindSound( parm );
if ( alternate ) {
// start it with no diversity, so the leadin break sound plays
refSound.referenceSound->StartSound( alternate, SND_CHANNEL_ANY, 0.0, 0 );
}
}
parm = spawnArgs.GetString( "mtr_broken" );
if ( parm && *parm ) {
SetShader( parm );
}
UpdateVisuals();
}
示例10: ReadBindFromSnapshot
void hhProxDoorSection::ReadFromSnapshot( const idBitMsgDelta &msg ) {
ReadBindFromSnapshot(msg);
GetPhysics()->ReadFromSnapshot(msg);
if (msg.HasChanged()) {
Show();
UpdateVisuals();
Present();
GetPhysics()->LinkClip();
}
}
示例11: RunPhysics
void hhControlHand::ClientPredictionThink( void ) {
RunPhysics();
// HUMANHEAD pdm
if (thinkFlags & TH_TICKER) {
Ticker();
}
UpdateAnimation();
UpdateVisuals();
Present();
}
示例12: FreeSoundEmitter
/*
================
idLight::UpdateChangeableSpawnArgs
================
*/
void idLight::UpdateChangeableSpawnArgs( const idDict *source ) {
idEntity::UpdateChangeableSpawnArgs( source );
if( source ) {
source->Print();
}
FreeSoundEmitter( true );
gameEdit->ParseSpawnArgsToRefSound( source ? source : &spawnArgs, &refSound );
if( refSound.shader && !refSound.waitfortrigger ) {
StartSoundShader( refSound.shader, SND_CHANNEL_ANY, 0, false, NULL );
}
gameEdit->ParseSpawnArgsToRenderLight( source ? source : &spawnArgs, &renderLight );
UpdateVisuals();
}
示例13: SetModel
/*
================
idExplodingBarrel::Event_Respawn
================
*/
void idExplodingBarrel::Event_Respawn() {
const char *temp = spawnArgs.GetString( "model" );
if ( temp && *temp ) {
SetModel( temp );
}
health = spawnArgs.GetInt( "health", "5" );
fl.takedamage = (health > 0);
physicsObj.SetOrigin( spawnOrigin );
physicsObj.SetAxis( spawnAxis );
physicsObj.SetContents( CONTENTS_SOLID );
physicsObj.DropToFloor();
state = NORMAL;
Show();
UpdateVisuals();
}
示例14: GetOrigin
void hhFuncEmitter::Ticker() {
if( IsHidden() ) {
return;
}
if( particle && particleStartTime != -1 ) {
if( !gameLocal.smokeParticles->EmitSmoke(particle, particleStartTime, gameLocal.random.RandomFloat(), GetOrigin(), GetAxis()) ) {
particleStartTime = -1;
}
}
if( modelDefHandle != -1 ) {
renderEntity.origin = GetOrigin();
renderEntity.axis = GetAxis();
UpdateVisuals();
}
}
示例15: StopSound
void idTrembler::Reset( void )
{
StopSound( SND_CHANNEL_ANY, false );
renderEntity.shaderParms[ SHADERPARM_RED ] = 0;
renderEntity.shaderParms[ SHADERPARM_GREEN ] = 0.7f;
renderEntity.shaderParms[ SHADERPARM_BLUE ] = 1;
UpdateVisuals();
state = -1;
int resettime = spawnArgs.GetInt("armtime");
Event_PlayAnim("idle", 1);
PostEventMS( &EV_TremblerArm, resettime ); //give a little delay to let physics settle the objects down.
}