Use an absolute directory under /usr/share/games/ for game data
[kraptor.git] / src / kfbuffer.c
blobe699b879fbb3e15f00cc45cf860a5823e140f022
1 /*
2 Todo el sistema trabaja renderizando en un bitmap
3 de un tama~o fijo, el cual luego se estira al tama~o de pantalla
4 Este archivo contiene el buffer, y los parametros de su tama~o
5 porque varias rutinas los necesitan, especialmente
6 la de descartar enemigos cuando salen por la parte inferior de pantalla
8 --------------------------------------------------------
9 Copyright (c) Kronoman
10 En memoria de mi querido padre
11 --------------------------------------------------------
13 #ifndef KFBUFFER_C
14 #define KFBUFFER_C
16 #include "allegro.h"
17 #include "kfbuffer.h"
19 /* globales */
21 /* BITMAP de dibujado, aqui debe dibujar toda la salida del programa */
22 BITMAP *kfbufferbmp = NULL;
24 /* Funcion que oscurece el buffer (ya dibujado)
25 con un interlazado en el color especificado
26 Sirve para boludeces
28 void interlazar_kfbuffer(int r, int g, int b)
30 int y = 0;
31 int c = makecol(r,g,b);
32 for (y = 0; y < kfbufferbmp->h; y+=2)
33 line(kfbufferbmp, 0, y, kfbufferbmp->w, y, c);
38 Funcion que envia el buffer a pantalla.
39 Si el buffer no esta iniciado, lo inicia.
41 void enviar_kfbuffer2screen()
43 if (kfbufferbmp == NULL) return; // kfbufferbmp = create_bitmap(ANCHO_RFB, ALTO_RFB);
45 // acquire_screen(); /* acelera todo en windoze? creo que NO */
47 if (ALTO_RFB == SCREEN_H && ANCHO_RFB == SCREEN_W)
48 blit(kfbufferbmp, screen, 0, 0, 0, 0, kfbufferbmp->w, kfbufferbmp->h);
49 else
50 stretch_blit(kfbufferbmp, screen, 0, 0, kfbufferbmp->w, kfbufferbmp->h, 0, 0, SCREEN_W, SCREEN_H);
52 // release_screen(); /* acordarse de hacer esto si se usa acquire_screen! */
55 #endif