예제 #1
0
void CNPC_Dog::CreateBeams( void )
{
	if ( m_bBeamEffects == false )
	{
		ClearBeams();
		return;
	}

	CreateSprites();

	for ( int i = 0; i < EFFECT_COUNT; i++ )
	{
		if ( m_hBeams[i] )
			continue;

		const char *attachNames[] = 
		{
			"physgun",
			"thumb",
			"pinky",
			"index",
		};

		m_hBeams[i] = CBeam::BeamCreate( "sprites/physcannon_bluelight2.vmt", 5.0 );

		m_hBeams[i]->EntsInit( m_hPhysicsEnt, this );
		m_hBeams[i]->SetEndAttachment( LookupAttachment( attachNames[i] ) );
		m_hBeams[i]->SetBrightness( 255 );
		m_hBeams[i]->SetColor( 255, 255, 255 );
		m_hBeams[i]->SetNoise( 5.5 );
		m_hBeams[i]->SetRenderMode( kRenderTransAdd );
	}

}
예제 #2
0
//************************************************************************
void CNutDropScene::ToonInitDone()
//************************************************************************
{
	if (GetToon())
		GetToon()->SetHintState(TRUE);

	CreateSprites();
	PlayIntro(m_hWnd);
}
예제 #3
0
void CreateSpriteStuff (Rect *windowBounds, CGrafPtr windowPtr)
{
	OSErr err;
	Rect bounds;

	// calculate the size of the destination
	bounds = *windowBounds;
	OffsetRect (&bounds, -bounds.left, -bounds.top);
	gBounceBox = bounds;
	InsetRect (&gBounceBox, 16, 16);

	// create a sprite layer graphics world with a bit depth of 32
	NewGWorld (&gSpritePlane, 32, &bounds, nil, nil, useTempMem);
	if (gSpritePlane == nil)
	{
		NewGWorld (&gSpritePlane, 32, &bounds, nil, nil, 0);
	}
	
	if (gSpritePlane)
	{
		LockPixels (GetPortPixMap(gSpritePlane));
		
		gBackgroundColor.red = 0x1234;
		gBackgroundColor.green = 0x0001;
		gBackgroundColor.blue = 0x0044;
		

		// create a sprite world
		err = NewSpriteWorld (&gSpriteWorld,		/* on return, a new sprite world */
								windowPtr,			/* destination */
								gSpritePlane,		/* sprite layer graphics world */
								&gBackgroundColor,	/* background color */
								nil);				/* graphics world to be used as the background. */
		
		// create sprites
		CreateSprites();
	}
}
예제 #4
0
//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void CCrossbowBolt::Spawn( void )
{
	Precache( );

	SetModel( "models/crossbow_bolt.mdl" );
	SetMoveType( MOVETYPE_FLYGRAVITY, MOVECOLLIDE_FLY_CUSTOM );
	UTIL_SetSize( this, -Vector(1,1,1), Vector(1,1,1) );
	SetSolid( SOLID_BBOX );
	SetGravity( 0.05f );
	
	// Make sure we're updated if we're underwater
	UpdateWaterState();

	SetTouch( &CCrossbowBolt::BoltTouch );

	SetThink( &CCrossbowBolt::BubbleThink );
	SetNextThink( gpGlobals->curtime + 0.1f );
	
	CreateSprites();

	// Make us glow until we've hit the wall
	m_nSkin = BOLT_SKIN_GLOW;
}
QtGameWidget::QtGameWidget(QWidget *parent)
 : QWidget(parent),
   m_sprites(CreateSprites())
{

}