| 1 |
|
| 2 |
! |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
. |
| 7 |
|
| 8 |
|
| 9 |
y |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
, |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 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 |