Esempio n. 1
0
File: bb.c Progetto: stroucki/bb
void bbflushwait(int maxtime)
{
    int wait;
    if (finish_stuff)
	return;
    wait = maxtime + starttime - TIME;
    if (wait > 0) {
	aa_flush(context);
    }
    bbwait(maxtime);
}
Esempio n. 2
0
void scene10()
{
    salpha = sbeta = sgamma = scenterx = scentery = scenterz;
    szoom = 0;
    ealpha = ebeta = egamma = ecenterx = ecentery = ecenterz = 0;
    ezoom = 0;
    poww = 1;
    drawptr = NULL;
    patnikconstructor();
    params->gamma = 1;
    centery = -40;
    strobikstart();
    zoom = 3;
    alfa = 90;
    beta = 0;
    gama = 180;
    disp3d();
    aa_render(context, params, 0, 0, aa_scrwidth(context), aa_scrheight(context));
    strobikend();
    bbwait(500000);

    strobikstart();
    alfa = 0;
    disp3d();
    aa_render(context, params, 0, 0, aa_scrwidth(context), aa_scrheight(context));
    strobikend();
    bbwait(500000);

    strobikstart();
    alfa = 180;
    disp3d();
    aa_render(context, params, 0, 0, aa_scrwidth(context), aa_scrheight(context));
    strobikend();
    bbwait(500000);

    strobikstart();
    alfa = 270;
    disp3d();
    aa_render(context, params, 0, 0, aa_scrwidth(context), aa_scrheight(context));
    strobikend();

    salpha = 270;
    sbeta = 0;
    sgamma = 180;
    szoom = 3;
    scentery = -40;
    ealpha = 360 + 90;
    ebeta = 0;
    egamma = 180;
    ezoom = 3;
    ecentery = -40;
    do3d(4 * 1000000);
    poww = 3;
    ezoom = 2;
    ebeta = 90;
    ecenterz = 60;
    ecentery = 50;
    do3d(3 * 1000000);
    poww = 0.4;
    ebeta = 60;
    do3d(0.5 * 1000000);
    poww = 5;
    ebeta = 90;
    do3d(0.5 * 1000000);
    poww = 2;
    ecenterz = 0;
    ecenterx = 60;
    ebeta = 0;
    egamma = 180 * 5;
    ezoom = 0.1;
    do3d(11.5 * 1000000);
    params->gamma = 1;

}
Esempio n. 3
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;
    }
}