From 0db3b3d55f6036dc0c5269b7771569bc99d5378b400eb3203695fbfa944e439d Mon Sep 17 00:00:00 2001 From: Gabriel Lorenzo Date: Tue, 25 Jan 2005 13:23:16 +0000 Subject: [PATCH] =?UTF-8?q?a=C3=B1adida=20utilidad=20builtinfont?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/src/bmp2fnt/b2f.c | 13 +- util/src/bmp2fnt/win32/bmp2fnt.vcproj | 21 ++- util/src/builtinfont/builtinfont.c | 138 ++++++++++++++++++ util/src/builtinfont/builtinfont.vcproj | 133 +++++++++++++++++ util/src/doku/doku.c | 4 +- util/src/doku/win32/doku.vcproj | 18 ++- util/src/iconchanger/win32/iconchanger.vcproj | 18 ++- util/src/win32/util.sln | 22 ++- 8 files changed, 344 insertions(+), 23 deletions(-) create mode 100644 util/src/builtinfont/builtinfont.c create mode 100644 util/src/builtinfont/builtinfont.vcproj diff --git a/util/src/bmp2fnt/b2f.c b/util/src/bmp2fnt/b2f.c index 02db3e0..bbde64b 100644 --- a/util/src/bmp2fnt/b2f.c +++ b/util/src/bmp2fnt/b2f.c @@ -1,7 +1,8 @@ /* * eDiv Compiler - * Copyleft (C) 2000-2002 Sion Entertainment - * http://www.sion-e.com + * Copyleft (C) 2000-2003 Sion Ltd. + * Copyleft (C) 2005 eDIV Team + * http://ediv.divsite.net * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,14 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _WIN32 -#error Este archivo aun NO ha sido portado a otras plataformas. -#endif -#include #include -#include -#include #include #include @@ -62,7 +57,7 @@ int main(int argc, char* argv[]) none[1] = *(px + 1); none[2] = *(px + 2); - // Colo trasparente ( Fila 1, Columna1, corresponde al caracter 0 ) + // Color transparente ( Fila 1, Columna1, corresponde al caracter 0 ) tras[0] = *(px + imagen->pitch + 3 + 0); tras[1] = *(px + imagen->pitch + 3 + 1); tras[2] = *(px + imagen->pitch + 3 + 2); diff --git a/util/src/bmp2fnt/win32/bmp2fnt.vcproj b/util/src/bmp2fnt/win32/bmp2fnt.vcproj index f343d73..4a1c0da 100644 --- a/util/src/bmp2fnt/win32/bmp2fnt.vcproj +++ b/util/src/bmp2fnt/win32/bmp2fnt.vcproj @@ -1,9 +1,10 @@ - + + + + + + + + + +#include +#include + +#include + +typedef unsigned char byte; + +void ayuda() +{ + printf("Modo de uso: builtinfont \n"); + exit(EXIT_FAILURE); +} + +int main(int argc, char* argv[]) +{ + FILE *fp; + byte trans; + byte *px; + SDL_Surface *imagen ; + int i, x, y, pos=0; + unsigned char fuente[256*8]; + char nombre[256]; + char nombreh[256]; + + if(argc<2) + ayuda(); + + imagen = SDL_LoadBMP(argv[1]); + if(imagen==NULL) { + printf("No se ha podido abrir: %s\n",argv[1]); + ayuda(); + } + + SDL_LockSurface(imagen); + + px = (byte*)imagen->pixels+imagen->pitch+1; + + // Color transparente ( Fila 1, Columna1, corresponde al caracter 0 ) + trans = *px; + + for(i=0;i<256;i++) { + for(y=0;y<8;y++) { + fuente[pos]=0; + for(x=0;x<6;x++) { + if(*px!=trans) + fuente[pos]|=1<pitch-6; + pos++; + } + px+=(-imagen->pitch*8)+7; + } + SDL_UnlockSurface( imagen ); + SDL_FreeSurface(imagen); + + // Descomentarizar esto para ver el resultado en la consola + /*pos=0; + for(i=0;i<256;i++) { + for(y=0;y<8;y++) { + for(x=0;x<6;x++) { + if(fuente[pos]&(1< + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/util/src/doku/doku.c b/util/src/doku/doku.c index 26d965a..80cd479 100644 --- a/util/src/doku/doku.c +++ b/util/src/doku/doku.c @@ -284,7 +284,7 @@ void situame(char* actual, char* ant, char* sig, char* sup) } if(!sw) { - printf("Error: no se encuentra directiva <%index%> en index.dok\n"); + printf("Error: no se encuentra directiva <%%index%%> en index.dok\n"); exit(16); } @@ -508,7 +508,7 @@ void procesa_subindice(char* actual) } if(!sw) { - printf("Error: no se encuentra directiva <%index%> en index.dok\n"); + printf("Error: no se encuentra directiva <%%index%%> en index.dok\n"); exit(22); } diff --git a/util/src/doku/win32/doku.vcproj b/util/src/doku/win32/doku.vcproj index c9f7dcd..673753f 100644 --- a/util/src/doku/win32/doku.vcproj +++ b/util/src/doku/win32/doku.vcproj @@ -1,7 +1,7 @@ - + @@ -49,8 +49,14 @@ Name="VCResourceCompilerTool"/> + + + + + + + + + @@ -49,8 +49,14 @@ Name="VCResourceCompilerTool"/> + + + + + + + +