head 1.1; branch 1.1.1; access ; symbols start:1.1.1.1 PAlibDoc:1.1.1; locks ; strict; comment @# @; 1.1 date 2005.11.02.08.30.23; author jandujar; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2005.11.02.08.30.23; author jandujar; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @
00001 #ifndef _PA_Text 00002 #define _PA_Text 00003 00004 00005 00012 //#include "../PA.h" 00013 #include "PA_Tile.h" 00014 00015 00017 // Système pour le texte 00019 00020 extern const u16 PA_font_Map[256]; 00021 extern const u8 PA_font_Tiles[6080]; 00022 00023 extern const u16 PA_font2_Map[256]; 00024 extern const u8 PA_font2_Tiles[6016]; 00025 00026 extern u16 textcol[2]; // Garde en mémoire la couleur du texte 00027 extern u8 PAbgtext[2]; 00028 00029 00030 extern u16 *PA_textmap[2]; //Pointeur vers la map et les tiles... 00031 extern u16 *PA_texttiles[2]; 00032 00033 extern s8 PA_font[2]; // 0 pour normal, 1 pour dégradé, -1 pour custom 00034 00035 00036 00037 00038 // Texte à taille variable 00039 00040 #include "text0.h" // La police à taille variable... 00041 #include "text1.h" // La police à taille variable... 00042 #include "text2.h" // La police à taille variable... 00043 #include "text3.h" // La police à taille variable... 00044 #include "text4.h" // La police à taille variable... 00045 00046 00047 00048 typedef void(*letterfp)(u8 size, bool screen, u16 x, u16 y, char lettertemp, u8 color); 00049 00050 extern const u8 *textData[5]; 00051 extern const u8 policeheight[5]; 00052 extern const u16 policewidth[5]; 00053 extern const u8 policesize[5][256]; 00054 00055 00056 extern letterfp letters[5]; 00057 00058 00059 00060 00061 00062 00063 00064 00084 void PA_InitText(bool screen, u8 bg_select); 00085 00086 00104 extern inline void PA_SetTileLetter(bool screen, u16 x, u16 y, char letter) { 00105 PA_SetMapTileAll(screen, PAbgtext[screen], x, y, PA_textmap[screen][(u16)letter]); 00106 } 00107 00125 void PA_OutputText(bool screen, u16 x, u16 y, char* text, ...); 00126 00144 u16 PA_OutputSimpleText(bool screen, u16 x, u16 y, const char *text); 00145 00172 u32 PA_BoxText(bool screen, u16 basex, u16 basey, u16 maxx, u16 maxy, const char *text, u32 limit); 00173 00200 u32 PA_BoxTextNoWrap(bool screen, u16 basex, u16 basey, u16 maxx, u16 maxy, const char *text, u32 limit); 00201 00202 00221 void PA_SetTextCol(bool screen, u8 r, u8 g, u8 b); 00222 00223 00224 00238 void PA_SetTextFont(bool screen, u8 font); 00239 00240 00250 #define PA_ShowFont(screen) PA_LoadBgMap(screen, PAbgtext[screen], (void*)PA_textmap[screen], BG_256X256) 00251 00252 00253 00270 void PA_SetTextCustomFont(bool screen, void* tiles, void* map); 00271 00272 00273 00309 s16 PA_SmartText(bool screen, s16 basex, s16 basey, s16 maxx, s16 maxy, char* text, u8 color, u8 size, u8 transp, s32 limit); 00310 00311 00312 00345 s16 PA_CenterSmartText(bool screen, s16 basex, s16 basey, s16 maxx, s16 maxy, char* text, u8 color, u8 size, u8 transp); 00346 00347 00348 00360 extern inline bool PA_CompareText(char *text1, char *text2){ 00361 bool ok = 1; // Devrait etre bon 00362 u8 i = 0; 00363 while(ok && text2[i]){ 00364 if (text1[i] != text2[i]) ok = 0; 00365 i++; 00366 } 00367 return ok; 00368 } 00369 00370 00382 extern inline void PA_CopyText(char *text1, char *text2){ 00383 u8 i = 0; 00384 text1[i] = text2[i]; 00385 do{ 00386 i++; 00387 text1[i] = text2[i]; 00388 } 00389 while (text2[i]); 00390 } 00391 00392 00393 00394 00395 // end of Text 00397 00398 00399 00400 #endif 00401 00402