Debian Codegraph @

src/fuente2.h

raw symbols SCIP
1 /*
2 * Don Ceferino Hazaña - video game similary to Super Pang!
3 * Copyright (c) 2004, 2005 Hugo Ruscitti
4 * web site: http://www.loosersjuegos.com.ar
5 *
6 * This file is part of Don Ceferino Hazaña (ceferino).
7 * Written by Hugo Ruscitti <[email protected]>
8 *
9 * Don Ceferino Hazaña is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * Don Ceferino Hazaña is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24
25 #ifndef _FUENTE2_H
26 #define _FUENTE2_H
27
28 #include <SDL/SDL.h>
29 #include <SDL/SDL_image.h>
30
31 #define KEY_R 0
32 #define KEY_G 0
33 #define KEY_B 0
34 #define KEY_A 0
35
36 enum posiciones {CENTRADO, NINGUNO, CONSALTO};
37
38 class fuente2
39 {
40 public:
41 fuente2 (int modo);
42 ~fuente2 ();
43
44 void myprintf (SDL_Surface * dst, int x, int y, \
45 SDL_Rect * rect, int * nrect, \
46 bool transparente, enum posiciones posicion, \
47 const char * format, ...);
48
49 void myprintf_inferior (SDL_Surface * dst, \
50 SDL_Rect * rect, int * nrect, \
51 bool transparente, const char * format, ...);
52
53 int imprimir_letra (SDL_Surface * destino, char letra, int x, \
54 int y, SDL_Rect * rect, \
55 bool transparente = false);
56
57 void imprimir (SDL_Surface * dst, char * cadena, int x, int y, \
58 SDL_Rect *rect, int * nrect, bool transparente);
59
60 void imprimir_con_salto (SDL_Surface * dst, char * cadena, \
61 int x, int y, SDL_Rect *rect, int * nrect, \
62 bool transparente);
63
64 int get_w (char letra);
65 int get_h (void);
66
67 private:
68 SDL_Rect rects [1024];
69 int letras;
70 SDL_Surface * ima;
71 int modo_reducido;
72
73
74 char * saltar_palabra (char * cadena);
75 SDL_Rect obtener_referencia (char letra, bool transparente);
76 void guardar_rect (int i, int x, int y, int w, int h);
77 void cargar_identificar_recs (void);
78 bool es_columna_vacia (SDL_Surface * ima, int col);
79 bool es_pixel_opaco (SDL_Surface * ima, int fila, int col);
80
81 int longitud (char * cadena);
82 int ancho_palabra (char * palabra);
83 void alinear_inferior (int * x1, int * y1, char * cadena);
84 void imprimir_palabra (SDL_Surface * dst, \
85 char * cadena, int x, int y, SDL_Rect *rect, \
86 int * nrect, bool transparente);
87
88 };
89
90 #endif