void	DrawMaze( void )
{
	int		x;
	int		y;
	unsigned char	*p = maze;

	for ( y = 0; y < MAZEH; y++ ) {
		for ( x = 0; x < MAZEW; x++ ) {
			switch ( *p ) {
			case '#' :
				FBFillRect( x*32, y*32, 32, 32, STEELBLUE );
				break;
			case '.' :
				FBCopyImage( x*32, y*32, 32, 32, futter );
				break;
			case 'z' :
				FBFillRect( x*32, y*32, 32, 32, 0 );
				break;
			default :
				FBFillRect( x*32, y*32, 32, 32, BLACK );
				break;
			}
			p++;
		}
	}
	FBDrawFx2Logo( LOGO_X, LOGO_Y );
}
Example #2
0
int	InitLemm( void )
{
	int				i;

#ifdef USEX
			FBFlushGrafic();
#endif
	FBFillRect( 0, 0, 720, 576, STEELBLUE );
	FBFillRect( 60, 448, 300, 100, BLACK );

	if ( !bgImage )
	{
		FBDrawString(64,482,32,"Initialize...",WHITE,0);
		FBDrawFx2Logo( 320, 486 );
#ifdef USEX
		FBFlushGrafic();
#endif

		initNumbers();

		if ( LoadPics() == -1 )
			return -1;
		bgImage=malloc(1600*160);
		SoundStart();
	}

	if ( !bgImage )
		return -1;

	for( i=0; i<12; i++ )
		svdimage[i]=malloc(32*48);

	for( i=0; i<320; i+=32 )
		inSc( 19, 0, i+main_x, 352, 1 );

	inSc( 29, 0, 66+main_x, 370, 1 );
	inSc( 29, 1, 100+main_x, 372, 1 );
	inSc( 8, 0, 134+main_x, 372, 0 );		// explosion
	inSc( 4, 10, 166+main_x, 374, 1 );		// lemming2
	inSc( 29, 2, 200+main_x, 368, 1 );
	inSc( 29, 3, 234+main_x, 368, 1 );
	inSc( 29, 4, 264+main_x, 372, 1 );
	inSc( 5, 2, 292+main_x, 368, 1 );

	inSc( 20, 0, 320+main_x, 352, 1 );

	FBDrawString(44,390,48,"-",GREEN,0);
	FBDrawString(76,390,48,"+",GREEN,0);

	return 0;
}
Example #3
0
/**
 * Draws the complete board according to the values of the cells
 * and the fx logo
 *
 * Possible field values:
 * #    : inactive cell (not reachable with mouse)
 * ' '  : field which is not on the board
 * n,b,B: empty field
 * x    : cell with a tux
 * s    : selected cell with a tux 
 */
void	DrawBoard(void)
{
	int				x;
	int				y;
	unsigned char	*p = maze;

	for( y = 0; y < MAZEH; y++ )
	{
		for( x = 0; x < MAZEW; x++, p++ )
		{
			switch ( *p )
			{
			case '#' :
				FBFillRect( x*32, y*32, 32, 32, STEELBLUE );
				break;
			case ' ' :
				FBFillRect( x*32, y*32, 32, 32, BLACK );
				break;
			case 'n' :
				FBCopyImage( x*32, y*32, 32, 32, dout );
				break;
			case 'b' :
			        FBCopyImage( x*32, y*32, 32, 32, dout );
			        break;
			case 'B' :
			        FBCopyImage( x*32, y*32, 32, 32, dout );
				break;
			case 'x' :
			        FBCopyImage ( x*32, y*32, 32, 32, dtux );
			        break;
			case 's' :
			        FBCopyImage( x*32, y*32, 32, 32, dselectedtux );
			        break;
			}
		}
	}
	// draw white frame around board
	FBDrawRect( 3*32-3, 3*32-3, 9*32+5, 9*32+5, WHITE );
	FBDrawRect( 3*32-4, 3*32-4, 9*32+7, 9*32+7, WHITE );

	FBDrawString( LOGO_X-90, LOGO_Y, 32, "powered by", WHITE, 0 );
	FBDrawFx2Logo( LOGO_X, LOGO_Y );
	FBDrawString( LOGO_X-90, LOGO_Y+70, 32, 
		      "brought to you by", WHITE, 0 );
	FBDrawString( LOGO_X-80, LOGO_Y+110, 32, 
		      "ChakaZulu", WHITE, 0 );
	gettimeofday(&starttv,0);

	DrawMouse();
}
Example #4
0
void	DrawBoard( void )
{
	int				x;
	int				y;

	FBFillRect( 0, 0, 720, 576, BLACK );

	for( y = 0; y < 6; y++ )
	{
		for( x = 0; x < 7; x++ )
		{
			FBCopyImage( x*48+64, y*48+96, 48, 48, dout );
		}
	}
	FBOverlayImage( ipos*48+64+6, 48+4, 36, 40, 0, 0, WHITE, dred, 0,0,0);
	FBDrawFx2Logo( LOGO_X, LOGO_Y );
	gettimeofday(&starttv,0);
}