1 /*
2 * BB: The portable demo
3 *
4 * (C) 1997 by AA-group (e-mail: aa@horac.ta.jcu.cz)
5 *
6 * 3rd August 1997
7 * version: 1.2 [final3]
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public Licences as by published
11 * by the Free Software Foundation; either version 2; or (at your option)
12 * any later version
13 *
14 * This program is distributed in the hope that it will entertaining,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILTY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17 * Publis License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.
21 * 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24 #include "bb.h"
25
26 /* An hack - but I did aalib, so I can hack :) */
27 struct parameters
28 {
29 unsigned int p[AA_NPARAMS];
30 };
31
32
backconvert(int x1,int y1,int x2,int y2)33 void backconvert(int x1, int y1, int x2, int y2)
34 {
35 int x, y;
36 for (y = y1; y < y2; y++)
37 for (x = x1; x < x2; x++) {
38 int n = context->textbuffer[x + y * aa_scrwidth(context)] + 256 * context->attrbuffer[x + y * aa_scrwidth(context)];
39 aa_putpixel(context, x * 2, y * 2, context->parameters[n].p[1]);
40 aa_putpixel(context, x * 2 + 1, y * 2, context->parameters[n].p[0]);
41 aa_putpixel(context, x * 2, y * 2 + 1, context->parameters[n].p[3]);
42 aa_putpixel(context, x * 2 + 1, y * 2 + 1, context->parameters[n].p[2]);
43 }
44 }
45