/******************************************************************************
 * This file is part of a software distribution, which is furnished under the *
 * terms of a license.  Use of this software  by any means is subject to this *
 * license  and  signifies  the  acceptance of  the  licensing  terms  stated *
 * therein. Please see  the file LICENSE in the  top-level directory  of this *
 * software  distribution  for detailed copyright  disclaimers  and licensing *
 * terms.                                                                     *
 ******************************************************************************
 * Copryight (c) by Andreas S. Wetzel - All rights reserved.                  *
 ******************************************************************************/

/* $Id: snake.c,v 1.3 2001/11/03 22:20:10 mickey Exp $ */

#include <vchat.h>
#include <proto_common.h>

/***** Globals *****/

extern int in_chat_window;

extern VP vp;
extern VTCAP vtcap;
extern VTIMER vtimer;

/**** Code ****/

void display_snake(void)
{
	u_int i;
	
	if(HAS_IM)
	{
		mv(1, vtcap.rows);
		in_chat_window = 0;

		if(vtcap.clear2eol)
			tputs(vtcap.clear2eol, 1, (void *)outc);
		else if(vtcap.clear2eod)
			tputs(vtcap.clear2eod, 1, (void *)outc);

		tputs(vtcap.insert_on, 1, (void *)outc);

		putchar('/');
		mv(1, vtcap.rows);
		vsleep(0, 17000);
		putchar('@');
		mv(1, vtcap.rows);
		vsleep(0, 17000);
		putchar('_');
		mv(1, vtcap.rows);

		for(i = 1; i < ((vtcap.cols) / 2); i++)
		{
			vsleep(0, 17000);
			putchar(' ');
		}

		tputs(vtcap.insert_off, 1, (void *)outc);

		mv(vtcap.cols / 2 + 4, vtcap.rows);

		printf("?!");

		vsleep(0, 900000);

		mv(vtcap.cols / 2, vtcap.rows);

		if(vtcap.clear2eol)
			tputs(vtcap.clear2eol, 1, (void *)outc);
		else if(vtcap.clear2eod)
			tputs(vtcap.clear2eod, 1, (void *)outc);

		printf("\\@_");
		mv(1, vtcap.rows);

		for(i = (vtcap.cols / 2 + 3); i > 1; i--)
		{
			vsleep(0, 17000);
			tputs(vtcap.deletechar, 1, (void *)outc);
		}
	}

	return;
}

void snake_enable(void)
{
	if(vp.videosnake > 0 && vp.videosnake < 256)
	{
		vtimer.snake_timer = (vp.videosnake * 60);
		vp.vclock_snake_enable = 0xff;
	}
}

void snake_disable(void)
{
	vtimer.snake_timer = vp.vclock_snake_enable = 0;
}


syntax highlighted by Code2HTML, v. 0.9.1