From 070a81e5d48059b795ecf130f309199d7294add0e38862a6a8832b1751f344db Mon Sep 17 00:00:00 2001 From: Albert Fabregat Date: Sun, 30 Jan 2005 18:27:05 +0000 Subject: [PATCH] By |Root| --> Arreglado un poco lo de los BPP --- dlls/src/graphics/carga.c | 2 ++ dlls/src/graphics/graphics.c | 18 ++++++++++++++++-- dlls/src/graphics/map_ops.c | 6 ++++-- ediv/CHANGE_LOG.txt | 8 ++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/dlls/src/graphics/carga.c b/dlls/src/graphics/carga.c index ab921a7..ee5c535 100644 --- a/dlls/src/graphics/carga.c +++ b/dlls/src/graphics/carga.c @@ -100,10 +100,12 @@ int eDIV_LOAD_FPG(FUNCTION_PARAMS) } else { bpp=16; + printf("\n 16 bits"); } } else { bpp=8; + printf("\n 8 bits"); fseek(f,0,SEEK_SET); fread(&cabecera8,1,sizeof(FPGHEADER8),f); diff --git a/dlls/src/graphics/graphics.c b/dlls/src/graphics/graphics.c index e871a81..e68104c 100644 --- a/dlls/src/graphics/graphics.c +++ b/dlls/src/graphics/graphics.c @@ -621,6 +621,7 @@ int Dibuja(SDL_Surface *src,int x,int y,int cx,int cy,int region,int z,int flags * perfecto antialiasing, pero vamos, esto hay ke optimizarlo bastante (habrá * que guarrear bastante en el SDL_rotozoomer.c) */ + temp=SDL_CreateRGBSurface(src->flags,src->w,src->h,src->format->BitsPerPixel,0,0,0,0); SDL_SetColorKey(temp,src->flags,color_transparente); @@ -654,11 +655,15 @@ int Dibuja(SDL_Surface *src,int x,int y,int cx,int cy,int region,int z,int flags memcpy(temp->pixels,src->pixels,temp->h*temp->pitch); } + blits[last_blit].src = xput(temp,zoom,angulo); + /*! * Pequeño hack para arreglar transparency * \todo Debería limpiarse y revisarse un poco :P */ - if(src->flags & SDL_SRCALPHA) { + + + /*if(src->flags & SDL_SRCALPHA) { for(i=0;ih*temp->w*temp->format->BytesPerPixel;i+=temp->format->BytesPerPixel) { if(*((int*)&((byte*)src->pixels)[i])!=color_transparente) ((byte*)temp->pixels)[i+3]=trans; @@ -666,9 +671,18 @@ int Dibuja(SDL_Surface *src,int x,int y,int cx,int cy,int region,int z,int flags } else { SDL_SetAlpha(temp,SDL_SRCALPHA,trans); + }*/ + + if(blits[last_blit].src->flags & SDL_SRCALPHA) { + for(i=0;ih*blits[last_blit].src->w*blits[last_blit].src->format->BytesPerPixel;i+=blits[last_blit].src->format->BytesPerPixel) { + if(*((int*)&((unsigned char*)blits[last_blit].src->pixels)[i])!=color_transparente) + ((unsigned char*)blits[last_blit].src->pixels)[i+3]=trans; + } + } + else { + SDL_SetAlpha(blits[last_blit].src,SDL_SRCALPHA,trans); } - blits[last_blit].src = xput(temp,zoom,angulo); // if(temp!=src) SDL_FreeSurface(temp); diff --git a/dlls/src/graphics/map_ops.c b/dlls/src/graphics/map_ops.c index 91464ca..f5e0a58 100644 --- a/dlls/src/graphics/map_ops.c +++ b/dlls/src/graphics/map_ops.c @@ -457,9 +457,11 @@ int eDIV_NEW_MAP(FUNCTION_PARAMS) { if ( !files[0].mapa[i].existe ) { - files[0].mapa[i].Surface = SDL_CreateRGBSurface( SDL_HWSURFACE , w , h , screen->format->BitsPerPixel , 0xFF0000 , 0x00FF00 , 0x0000FF , 0x000000 ) ; + files[0].mapa[i].Surface = SDL_CreateRGBSurface( SDL_HWSURFACE , w , h , screen->format->BitsPerPixel , screen->format->Rmask , screen->format->Gmask ,screen->format->Bmask ,screen->format->Amask ) ; + if(fp->graphics->bpp==8) + PaletteCopy(files[0].mapa[i].Surface,screen); files[0].mapa[i].existe = 1 ; - files[0].mapa[i].cpoint[0].x = cx ; + files[0].mapa[i]. cpoint[0].x = cx ; files[0].mapa[i].cpoint[0].y = cy ; SDL_FillRect( files[0].mapa[i].Surface , NULL , c ) ; SDL_SetColorKey( files[0].mapa[i].Surface , SDL_SRCCOLORKEY | SDL_RLEACCEL , color_transparente ) ; diff --git a/ediv/CHANGE_LOG.txt b/ediv/CHANGE_LOG.txt index a6c3ca8..5c90db8 100644 --- a/ediv/CHANGE_LOG.txt +++ b/ediv/CHANGE_LOG.txt @@ -1,3 +1,11 @@ +30/1/2005 +--------- + * Se ha arreglado un poco el problema que habia con los bpps de 8 y 16 bits. + El problema estaba en que en 8 y 16 no cargaba la paleta y no eran las mismas mas- + caras que en 24 y 32. Ahora toca mirar que pasa con los FPG's de 8 bits (|RooT|) + * Ya funcionan correctamente el COLORIDO.PRG en todos los bpp's (|RooT|) + + 28/1/2005 --------- * He investigado un poco el asunto de los juegos de caracteres. Se me ha ocurrido una