# HG changeset patch # User pontscho # Date 1031132163 0 # Node ID 634d93c689127e027a8c272ef21f5a1d948da378 # Parent afe8885a64466faccb526e7b629390115f09ab59 - add workaround for fuckin locale - remove tga and bmp filter diff -r afe8885a6446 -r 634d93c68912 Gui/Makefile --- a/Gui/Makefile Wed Sep 04 09:32:53 2002 +0000 +++ b/Gui/Makefile Wed Sep 04 09:36:03 2002 +0000 @@ -15,7 +15,7 @@ CFLAGS = $(OPTIMIZE) $(INCDIR) $(DEBUG) SRCS = wm/ws.c wm/wsxdnd.c app.c events.c interface.c cfg.c \ - bitmap/bitmap.c bitmap/tga/tga.c bitmap/bmp/bmp.c bitmap/png/png.c \ + bitmap/bitmap.c bitmap/png/png.c \ skin/skin.c skin/font.c skin/cut.c \ mplayer/mplayer.c mplayer/widgets.c mplayer/play.c \ mplayer/gtk/menu.c mplayer/gtk/mb.c mplayer/gtk/about.c mplayer/gtk/pl.c mplayer/gtk/sb.c mplayer/gtk/fs.c mplayer/gtk/opts.c mplayer/gtk/url.c mplayer/gtk/eq.c diff -r afe8885a6446 -r 634d93c68912 Gui/bitmap.c --- a/Gui/bitmap.c Wed Sep 04 09:32:53 2002 +0000 +++ b/Gui/bitmap.c Wed Sep 04 09:36:03 2002 +0000 @@ -5,13 +5,6 @@ #include "bitmap.h" -#define BMP 1 -#define TGA 2 -#define PNG 3 -#define TGAPACKED 4 - -extern char * strcat( char * dest,const char * src ); - int conv24to32( txSample * bf ) { unsigned char * tmpImage; @@ -74,7 +67,7 @@ unsigned char * fExist( unsigned char * fname ) { FILE * fl; - unsigned char ext[][6] = { ".tga\0",".TGA\0",".png\0",".PNG\0",".bmp\0",".BMP\0" }; + unsigned char ext[][6] = { ".png\0",".PNG\0" }; int i; fl=fopen( fname,"rb" ); @@ -83,10 +76,9 @@ fclose( fl ); return fname; } - for ( i=0;i<10;i++ ) + for ( i=0;i<2;i++ ) { - strcpy( tmp,fname ); - strcat( tmp,ext[i] ); + sprintf( tmp,"%s%s",fname,ext[i] ); fl=fopen( tmp,"rb" ); if ( fl != NULL ) { @@ -97,80 +89,22 @@ return NULL; } -int aComp( unsigned char * b1,unsigned char * b2,int size ) -{ - int i; - for( i=0;iBPP < 24 ) { - mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, 16 or less bitmaps not supported.\n" ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, 16 or less bitmaps not supported.\n" ); return -1; } if ( conv24to32( bf ) ) return -8; - if ( bgr ) bgr2rgb( bf ); + bgr2rgb( bf ); Normalize( bf ); return 0; } diff -r afe8885a6446 -r 634d93c68912 Gui/bitmap.h --- a/Gui/bitmap.h Wed Sep 04 09:32:53 2002 +0000 +++ b/Gui/bitmap.h Wed Sep 04 09:36:03 2002 +0000 @@ -11,8 +11,6 @@ char * Image; } txSample; -#include "tga/tga.h" -#include "bmp/bmp.h" #include "png/png.h" #include "../../mp_msg.h" diff -r afe8885a6446 -r 634d93c68912 Gui/bitmap/bitmap.c --- a/Gui/bitmap/bitmap.c Wed Sep 04 09:32:53 2002 +0000 +++ b/Gui/bitmap/bitmap.c Wed Sep 04 09:36:03 2002 +0000 @@ -5,13 +5,6 @@ #include "bitmap.h" -#define BMP 1 -#define TGA 2 -#define PNG 3 -#define TGAPACKED 4 - -extern char * strcat( char * dest,const char * src ); - int conv24to32( txSample * bf ) { unsigned char * tmpImage; @@ -74,7 +67,7 @@ unsigned char * fExist( unsigned char * fname ) { FILE * fl; - unsigned char ext[][6] = { ".tga\0",".TGA\0",".png\0",".PNG\0",".bmp\0",".BMP\0" }; + unsigned char ext[][6] = { ".png\0",".PNG\0" }; int i; fl=fopen( fname,"rb" ); @@ -83,10 +76,9 @@ fclose( fl ); return fname; } - for ( i=0;i<10;i++ ) + for ( i=0;i<2;i++ ) { - strcpy( tmp,fname ); - strcat( tmp,ext[i] ); + sprintf( tmp,"%s%s",fname,ext[i] ); fl=fopen( tmp,"rb" ); if ( fl != NULL ) { @@ -97,80 +89,22 @@ return NULL; } -int aComp( unsigned char * b1,unsigned char * b2,int size ) -{ - int i; - for( i=0;iBPP < 24 ) { - mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, 16 or less bitmaps not supported.\n" ); + mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[bitmap] sorry, 16 or less bitmaps not supported.\n" ); return -1; } if ( conv24to32( bf ) ) return -8; - if ( bgr ) bgr2rgb( bf ); + bgr2rgb( bf ); Normalize( bf ); return 0; } diff -r afe8885a6446 -r 634d93c68912 Gui/bitmap/bitmap.h --- a/Gui/bitmap/bitmap.h Wed Sep 04 09:32:53 2002 +0000 +++ b/Gui/bitmap/bitmap.h Wed Sep 04 09:36:03 2002 +0000 @@ -11,8 +11,6 @@ char * Image; } txSample; -#include "tga/tga.h" -#include "bmp/bmp.h" #include "png/png.h" #include "../../mp_msg.h" diff -r afe8885a6446 -r 634d93c68912 Gui/cfg.c --- a/Gui/cfg.c Wed Sep 04 09:32:53 2002 +0000 +++ b/Gui/cfg.c Wed Sep 04 09:36:03 2002 +0000 @@ -199,7 +199,25 @@ { case CONF_TYPE_INT: case CONF_TYPE_FLAG: fprintf( f,"%s = %d\n",gui_opts[i].name,*( (int *)gui_opts[i].p ) ); break; - case CONF_TYPE_FLOAT: fprintf( f,"%s = %f\n",gui_opts[i].name,*( (float *)gui_opts[i].p ) ); break; + case CONF_TYPE_FLOAT: + #if 0 + fprintf( f,"%s = %f\n",gui_opts[i].name,*( (float *)gui_opts[i].p ) ); + #else + #warning ugly hakk for fucking locale + { + char tmp[64]; + snprintf( tmp,64,"%f",*( (float *)gui_opts[i].p ) ); + // locale emulator + // { char * c = strchr( tmp,'.' ); if ( c ) *c=','; } + // --- + { int i; + for ( i=0;i < strlen( tmp );i++ ) + if ( ( tmp[i] != '.' )&&( ( tmp[i] < '0' )||( tmp[i] > '9' ) ) ) tmp[i]='.'; + } + fprintf( f,"%s = %s\n",gui_opts[i].name,tmp ); + } + #endif + break; case CONF_TYPE_STRING: { char * tmp = *( (char **)gui_opts[i].p );