Ejemplo n.º 1
0
void scene9(void)
{
    int width, height, scanline;
    int i, formula = 1;
    char *buffer1;
    signal(SIGFPE, SIG_IGN);
    width = aa_imgwidth(context);
    height = aa_imgheight(context);
    scanline = width;
    buffer1 = context->imagebuffer;
    params->bright = -255;
    params->dither = AA_NONE;

    zcontext = make_context(width, height, scanline, 0, 1, flip_buffers, ui_waitfunc, buffer1, buffer1, get_pixelwidth(width), get_pixelheight(height));
    if (!zcontext) {
	exit(-1);
    }
    set_formula(zcontext, formula);
    for (i = 0; i < 255; i++) {
	zcontext->colors[i] = (i * 15) % 255 + 1;
    }
    zcontext->colors[0] = 0;
    zcontext->num_colors = 255;
    tbreak = 2;
    zcontext->maxiter = 255;
    fastmode--;
    zcontext->range = 8;
    zcontext->incoloringmode = 0;
    zcontext->coloringmode = 0;
    zcontext->plane = 0;
    starttime = endtime;
    sef = 1;
    eef = 0;
    is = -1;
    rs = -1;
    ie = 2;
    re = -2;
    timestuff(0, NULL, juliov, ETIME2);
    sef = 0;
    eef = 0;
    is = ie, rs = re;
    ie = 2;
    re = 2;
    timestuff(0, NULL, juliov, ETIME2);
    sef = 0;
    eef = 0;
    is = ie, rs = re;
    ie = -2;
    re = 2;
    timestuff(0, NULL, juliov, ETIME2);
    sef = 0;
    eef = 1;
    is = ie, rs = re;
    ie = 2;
    re = -2;
    timestuff(0, NULL, juliov, ETIME2);
    context->imagebuffer = buffer1;
    params->bright = 0;
    params->dither = AA_FLOYD_S;
}
Ejemplo n.º 2
0
void devezen4()
{
    tographics();
    drawptr = decontr;
    timestuff(0, NULL, draw, 500000);
    drawptr = towhite;
    timestuff(0, NULL, draw, 500000);
    params->bright = 0;
    params->contrast = 0;
}
Ejemplo n.º 3
0
void devezen3()
{
    tographics();
    drawptr = incrandom;
    timestuff(0, NULL, draw, 1000000);
    params->randomval = 100;
    drawptr = toblack;
    timestuff(0, NULL, draw, 1000000);
    params->randomval = 0;
    params->bright = 0;
}
Ejemplo n.º 4
0
Archivo: scene2.c Proyecto: stroucki/bb
void scene2(void)
{
    char *pokec[] =
    {
	"Future",
	"Crew",
	"Triton",
	"Cascada",
	"Complex",
	"Pascal",
	"Titans",
	"Xography",
	"Sonic PC",
	"Scrymag",
	"...",
	"Microsoft",
	"",
	"!?!",
    };
    int i;
    params->randomval = 0;
    drawptr = mydraw;
    timestuff(60, NULL, draw, 2.75 * 1000000);

    drawptr = messaguj;
    mesg = "";
    pos = 2;
    lastpos = 1;
    for (i = 0; i < sizeof(pokec) / sizeof(char *); i++) {
	lastpos = pos;
	pos++;
	if (pos > 4)
	    pos = 2;
	lastmesg = mesg;
	mesg = pokec[i];
	if (i == sizeof(pokec) / sizeof(char *) - 1)
	     timestuff(0, NULL, draw, 3 * ETIME);
	else
	    timestuff(0, NULL, draw, ETIME);
    }
}
Ejemplo n.º 5
0
void devezen1()
{
    bckup = (char *) malloc(aa_imgwidth(context) * aa_imgheight(context));
    memcpy(bckup, context->imagebuffer, aa_imgwidth(context) * aa_imgheight(context));
    tographics();
    bckup1 = (char *) malloc(aa_imgwidth(context) * aa_imgheight(context));
    memcpy(bckup1, context->imagebuffer, aa_imgwidth(context) * aa_imgheight(context));
    drawptr = toblack1;
    timestuff(0, NULL, toblack1, 5000000);
    free(bckup);
    free(bckup1);
}
Ejemplo n.º 6
0
static void do3d(int time)
{
    timestuff(0, NULL, draw3d, time);
    ealpha %= 360;
    ebeta %= 360;
    egamma %= 360;
    salpha = ealpha;
    sbeta = ebeta;
    sgamma = egamma;
    szoom = ezoom;
    scenterx = ecenterx;
    scentery = ecentery;
    scenterz = ecenterz;
}
Ejemplo n.º 7
0
void scene6(void)
{
    int width, height, scanline;
    int i, formula = 0;
    char *buffer1, *buffer2;
    displayed = 0;
    incalculation = 0;
    fastmode = 2;
    interruptiblemode = 0;
    autopilot = 0;
    maxstep = MAXSTEP;
    speedup = STEP;
    step = 0;
    tbreak = 0;
    maintimer = tl_create_timer();
    signal(SIGFPE, SIG_IGN);
    width = aa_imgwidth(context);
    height = aa_imgheight(context);
    scanline = width;
    buffer1 = context->imagebuffer;
    buffer2 = malloc(width * height);
    endtime = starttime + ETIME1;
    params->bright = -255;

    zcontext = make_context(width, height, scanline, 0, 1, flip_buffers, ui_waitfunc, buffer1, buffer2, get_pixelwidth(width), get_pixelheight(height));
    if (!zcontext) {
	exit(-1);
    }
    set_formula(zcontext, formula);
    for (i = 0; i < 255; i++) {
	/*zcontext->colors[i] = (i * 15) % 255 + 1; */
	zcontext->colors[i] = (i * 8) % 255 + 1;
    }
    zcontext->colors[0] = 0;
    zcontext->num_colors = 255;
    tbreak = 2;
    zcontext->maxiter = 150;
    fastmode--;
    zcontext->range = 8;
    zcontext->incoloringmode = 0;
    zcontext->coloringmode = 0;
    zcontext->plane = 0;
    ui_do_fractal(NEW_IMAGE);
    ui_autopilot();
    speedup = 1 * STEP;
    maxstep *= 5;
    step = -maxstep;
    tl_process_group(syncgroup, NULL);
    bbupdate();
    tl_reset_timer(maintimer);
    main_loop();
    starttime = endtime;
    context->imagebuffer = buffer1;
    free(buffer2);
    tl_free_timer(maintimer);
    params->bright = 0;
    params->randomval = 0;
    initlepic();
    drawptr = mydraw1;
    timestuff(-60, ctrllepic, draw, 2000000);
    drawptr = mydraw;
    /*timestuff(60, NULL, draw, 4 * 1000000); */
    /*timestuff(20, blur, draw, 4 * 1000000); */
    timestuff(60, NULL, draw, 3 * 1000000);

}
Ejemplo n.º 8
0
void devezen2()
{
    tographics();
    drawptr = toblack;
    timestuff(0, NULL, draw, 1000000);
}
Ejemplo n.º 9
0
static void morph()
{
    params->dither = AA_NONE;
    timestuff(0, NULL, morphdraw, MTIME);
}
Ejemplo n.º 10
0
void credits2(void)
{
    int i, ch;
    int p;
    int plast = -1;
    clrscr();

    centerprint(aa_imgwidth(context) / 2, aa_imgheight(context) / 3, 3, 128, "The", 0);
    centerprint(aa_imgwidth(context) / 2, 2 * aa_imgheight(context) / 3, 3, 128, "END", 0);
    drawptr = decrand;
    params->randomval = 50;
    timestuff(0, NULL, draw, 5000000);
    drawptr = NULL;
    params->randomval = 0;
    drawptr = pryc;
    timestuff(0, NULL, draw, MAXTIME);
    drawptr = NULL;
    clrscr();
    draw();
    load_song("bb3.s3m");
    bbupdate();
    starttime = endtime = TIME;
    play();
    bbwait(1);
    for (i = 0; i < LOGOHEIGHT; i++) {
	aa_puts(context, aa_scrwidth(context) / 2 - 2, LOGOY + i, AA_BOLD, "8  8");
	if (i)
	    aa_puts(context, aa_scrwidth(context) / 2 - 2, LOGOY + i - 1, AA_NORMAL, "8  8");
	bbflushwait(100000);
    }
    aa_puts(context, aa_scrwidth(context) / 2 - 2, LOGOY + i - 1, AA_NORMAL, "8  8");

#define LWIDTH

    for (i = aa_scrwidth(context) / 2; i; i--) {
	display8();
	displaya(i);
	bbflushwait(10000);
    }
    for (; i < 100; i++) {
	textclrscr();
	displaya(10 * sin(i * M_PI / 100));
	display8();
	bbflushwait(10000);
    }
    aa_puts(context, aa_scrwidth(context) / 2 - 9, LOGOY + 3, AA_DIM, "<PROJECT><PROJECT>");
    bbflushwait(100000);
    aa_puts(context, aa_scrwidth(context) / 2 - 9, LOGOY + 3, AA_NORMAL, "<PROJECT><PROJECT>");
    bbflushwait(100000);
    aa_puts(context, aa_scrwidth(context) / 2 - 9, LOGOY + 3, AA_BOLD, "<PROJECT><PROJECT>");
    bbflushwait(100000);
    aa_puts(context, aa_scrwidth(context) / 2 - 9, LOGOY + 3, AA_NORMAL, "<PROJECT><PROJECT>");
    bbflushwait(100000);
    bbwait(1000000);
    for (i = LOGOY; i > 1; i--) {
	textclrscr();
	displogo(i);
	bbflushwait(30000);
    }

    source = malloc(aa_imgwidth(context) * (aa_imgheight(context)));
    target = malloc(aa_imgwidth(context) * (aa_imgheight(context)));
    params->dither = AA_NONE;
    format(dual ? aa_scrwidth(context) / 2 : aa_scrwidth(context));
    p = 0;
    while (1) {
	if (p != plast) {
	    getsource();
	    displaytext(p);
	    gettarget();
	    morph();
	    displaytext(p);
	    aa_flush(context);
        emscripten_sleep(1);
	    plast = p;
	}
      again:
    emscripten_sleep(100);
#ifndef __DJGPP__
	//ch = aa_getkey(context, 100);
    ch = AA_NONE;
#else
	while ((ch = bbupdate()) == AA_NONE) ;
#endif

	switch (ch) {
	case '1':
	    load_song("bb.s3m");
	    bbupdate();
	    play();
	    break;
	case '2':
	    load_song("bb2.s3m");
	    bbupdate();
	    play();
	    break;
	case '3':
	    load_song("bb3.s3m");
	    bbupdate();
	    play();
	    break;

	case 'b':
	case 'k':
	case 'B':
	case 'K':
	case AA_BACKSPACE:
	case AA_UP:
	    p -= (aa_scrheight(context) - YSTART) / 2 * (dual + 1);
	    if (p < 0)
		p = 0;
	    break;
	case AA_DOWN:
	case AA_LEFT:
	case 'f':
	case 'F':
	case ' ':
	case 'j':
	case 'J':
	    p += (aa_scrheight(context) - YSTART) / 2 * (dual + 1);
	    if (p > textsize)
		p = textsize;
	    break;
	case 'q':
	case 'Q':
	case AA_ESC:
	    finish_stuff = 0;
	    backconvert(0, 0, aa_scrwidth(context), aa_scrheight(context));
	    bbupdate();
	    starttime = endtime = TIME;
	    drawptr = decbright;
	    timestuff(0, NULL, draw, 1000000);
	    textclrscr();
	    drawptr = NULL;
	    aa_flush(context);
        emscripten_sleep(1);
	    free(source);
	    free(target);
	    return;
	default:
	    goto again;
	}
	bbupdate();
	starttime = endtime = TIME;
    }
}