All pastes #769174 Raw Edit

Stuff

public text v1 · immutable
·published 2007-11-11 05:12 UTC
rendered paste body
		{
			byte *tmpscr;
			int i, j;
			static int disStart = 0;
			int newpix;
			float sine;
			tmpscr = malloc(vid.width*vid.height*vid.bpp);

				for(j=0; j < vid.height; j++)
				{
					sine = (float)(sin(disStart)*2);
					for(i=0; i<vid.width; i++)
			  {
			/*			newpix = (int)(i + (float)sine);

						if(newpix < 0)
							newpix = 0;
						if(newpix >= vid.width)
							newpix = vid.width-1;*/

						newpix = i;

				 tmpscr[j*vid.width + i] = screens[0][j*vid.width+newpix];
			  }
   			  disStart++;//the offset into the displacement map, increment each game loop
				}
      
			  VID_BlitLinearScreen(tmpscr, screens[0], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, ScreenPitch);

			  free(tmpscr);