Ejemplo n.º 1
0
void Intro(void)
{	
	NewGameWindow(1);	/* Set to 512 mode */ 

	FadeToBlack();		/* Fade out the video */
	
	DisplayScreen(rMacPlayPic, rMacPlayPal);
	BlastScreen();

	StartSong(SongListPtr[0]);	/* Play the song */
	
	FadeTo(rMacPlayPal);		/* Fade in the picture */
	WaitTicksEvent(240);		/* Wait for event */
	
	DisplayScreen(rMacPlayPic, rIdLogoPal); /* higher bpp hack */
	BlastScreen();
	
	FadeTo(rIdLogoPal);

	if (toupper(WaitTicksEvent(240))=='B') { /* Wait for event */
		FadeToBlack();
		ClearTheScreen(BLACK);
		DisplayScreen(rYummyPic, rYummyPal);
		BlastScreen();
		FadeTo(rYummyPal);
		
		WaitTicksEvent(600);
	}	
}
Ejemplo n.º 2
0
	void IComponent::Show(uint32 time) {
		D3DXCOLOR standard(1.0f, 1.0f, 1.0f, 1.0f);
		D3DXCOLOR highlight(1.25f, 1.25f, 1.45f, 1.1f);

		if (GetColorMod() != standard)
			FadeTo(time, standard);

		else {
			FadeTo(time, highlight);
			sEngine.PulseTimer.AddTimer(time * 2, [=]
				(const Utils::STimerDispatchEvt&) {
					this->FadeTo(uint32(time * 1.5f), standard);
					return TIMER_STOP_EXECUTION;
				});
		}
	}
Ejemplo n.º 3
0
Boolean TitleScreen()
{
	Word RetVal;		/* Value to return */

	playstate = EX_LIMBO;	/* Game is not in progress */
	NewGameWindow(1);	/* Set to 512 mode */
	FadeToBlack();		/* Fade out the video */

	DisplayScreen(rTitlePic, rTitlePal);
	BlastScreen();

	StartSong(SongListPtr[0]);
	FadeTo(rTitlePal);	/* Fade in the picture */
	BlastScreen();
	
	RetVal = WaitTicksEvent(0);		/* Wait for event */
	
	playstate = EX_COMPLETED;

	return TRUE;	
}
Ejemplo n.º 4
0
	void IComponent::Hide(uint32 time) {
		FadeTo(time, D3DXCOLOR(1.0f, 1.0f, 1.0f, 0.0f));
	}
Ejemplo n.º 5
0
	void iLight::UpdateLight(float afTimeStep)
	{	
		/////////////////////////////////////////////
		// Fade
		if(mfFadeTime>0)
		{
			//Log("Fading: %f / %f\n",afTimeStep,mfFadeTime);
			
			mfFarAttenuation += mfRadiusAdd*afTimeStep;
			mDiffuseColor.r += mColAdd.r*afTimeStep;
			mDiffuseColor.g += mColAdd.g*afTimeStep;
			mDiffuseColor.b += mColAdd.b*afTimeStep;
			mDiffuseColor.a += mColAdd.a*afTimeStep;
			SetDiffuseColor(mDiffuseColor);

			mfFadeTime-=afTimeStep;
			
			//Set the dest values.
			if(mfFadeTime<=0)
			{
				mfFadeTime =0;
				SetDiffuseColor(mDestCol);
				mfFarAttenuation = mfDestRadius;
			}
		}

		/////////////////////////////////////////////
		// Flickering
		if(mbFlickering && mfFadeTime<=0)
		{	
			//////////////////////
			//On
			if(mbFlickerOn)
			{
				if(mfFlickerTime >= mfFlickerStateLength)
				{
					mbFlickerOn = false;
					if(!mbFlickerFade)
					{
						SetDiffuseColor(mFlickerOffColor);
						mfFarAttenuation = mfFlickerOffRadius;
					}
					else
					{
						FadeTo(mFlickerOffColor,mfFlickerOffRadius,mfFlickerOffFadeLength);
					}
					//Sound
					if(msFlickerOffSound!=""){
						cSoundEntity *pSound = mpWorld3D->CreateSoundEntity("FlickerOff",
							msFlickerOffSound,true);
						if(pSound) pSound->SetPosition(GetLightPosition());
					}

					OnFlickerOff();
                   
					mfFlickerTime =0;
					mfFlickerStateLength = cMath::RandRectf(mfFlickerOffMinLength,mfFlickerOffMaxLength);
				}
			}
			//////////////////////
			//Off
			else 
			{
				if(mfFlickerTime >= mfFlickerStateLength)
				{
					mbFlickerOn = true;
					if(!mbFlickerFade)
					{
						SetDiffuseColor(mFlickerOnColor);
						mfFarAttenuation = mfFlickerOnRadius;
					}
					else
					{
						FadeTo(mFlickerOnColor,mfFlickerOnRadius,mfFlickerOnFadeLength);
					}
					if(msFlickerOnSound!=""){
						cSoundEntity *pSound = mpWorld3D->CreateSoundEntity("FlickerOn",
															msFlickerOnSound,true);
						if(pSound) pSound->SetPosition(GetLightPosition());
					}

					OnFlickerOn();
					
					mfFlickerTime =0;
					mfFlickerStateLength = cMath::RandRectf(mfFlickerOnMinLength,mfFlickerOnMaxLength);
				}
			}

			mfFlickerTime += afTimeStep;
		}

		/*Log("Time: %f Length: %f FadeTime: %f Color: (%f %f %f %f)\n",mfFlickerTime, mfFlickerStateLength,
											mfFadeTime,
											mDiffuseColor.r,mDiffuseColor.g,
											mDiffuseColor.b,mDiffuseColor.a);*/
	}