static void dvojprujezd2(int starttime, char *text1, char *text2) { int pos = (getwidth(2) * strlen(text1) + 1); centerprint(-pos / 2 + (aa_imgwidth(context) + pos * 1.2) * STATE / (endtime - starttime), aa_imgheight(context) / 3, 2, 255, text1, 0); pos = (getwidth(2) * strlen(text2) + 1); centerprint(aa_imgwidth(context) + pos / 2 - (aa_imgwidth(context) + pos * 1.2) * STATE / (endtime - starttime), 2 * aa_imgheight(context) / 3, 2, 255, text2, 0); }
static void pryc() { float size = 3 + (STATE) * 10.0 / MAXTIME; float radius = (STATE) * aa_imgwidth(context) / MAXTIME; float yradius = (STATE) * aa_imgheight(context) / MAXTIME; int xm = aa_imgwidth(context) / 2; int ym = aa_imgheight(context) / 3; clrscr(); centerprint(xm + radius * sin(STATE / 100000.0), ym + yradius * cos(STATE / 300000.0), size, 128, "The", 0); centerprint(xm + radius * sin(STATE / 150000.0), 2 * ym + yradius * cos(STATE / 400000.0), size, 128, "END", 0); }
void drawzoomer(char *mesg, int starttime, int pos) { float width = 1000000.0 / (STATE); if (width > 1.0) { int color = (width - 1) * 255; if (color > 255) color = 255; centerprint(aa_imgwidth(context) / 2, pos * aa_imgheight(context) / 6, width, color, mesg, 0); } }
void message(char *text, int starttime) { int state = STATE; if (state > 0 && state < MAXPOS) { double pp = state * M_PI / MAXPOS * 2; double width = (1 + cos(pp)) * 5 + 2; int pos = aa_imgheight(context) - aa_imgheight(context) * state / MAXPOS; if (width <= 0) return; centerprint(aa_imgwidth(context) / 2, pos, width, sin(pp / 2) * 255, text, 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; } }