All pastes #417247 Raw Edit

Stuff

public cpp v1 · immutable
#417247 ·published 2007-03-30 19:23 UTC
rendered paste body
//this is actually the core renderloop for the whole demo.PixelArray *Scene::Render(float ftime){	Timer::Update();	//Update global timer.	//sett spole timer her:	Timer::SetTime(ftime);	float time = Timer::GetTime();	//PRACHK!	clear_zbuffer();	for (int i=0; i<num_effects; i++)	{		if (effects[i]->Run(time)) //if true then draw		{			effects[i]->ProcessEffectChanges();			//todo: blendmodes and overdraw stuff..			effects[i]->Draw();	//draw each effect first			//in each pass we overdraw the framebuffer with the chosen blendmode			if (effects[i]->GetBlendMode() == BLENDMODE_NORMAL)				frameBuffer.Copy(this->GetEffect(i));			if (effects[i]->GetBlendMode() == BLENDMODE_ADDITIVE)				frameBuffer.BlendAdd(this->GetEffect(i), this->GetEffect(i)->varBlend);			if (effects[i]->GetBlendMode() == BLENDMODE_SUBTRACTIVE)				frameBuffer.BlendSub(this->GetEffect(i), this->GetEffect(i)->varBlend);			if (effects[i]->GetBlendMode() == BLENDMODE_ALPHA)				frameBuffer.BlendAlpha(this->GetEffect(i), this->GetEffect(i)->varBlend);			if (effects[i]->GetBlendMode() == BLENDMODE_INVERT)				frameBuffer.Invert(&this->frameBuffer, this->GetEffect(i)->varBlend);			if (effects[i]->GetBlendMode() == BLENDMODE_NONZERO)				frameBuffer.CopyNonZero(this->GetEffect(i));		}	}	return &frameBuffer;}