By |Root| --> Arreglado un poco lo de los BPP

This commit is contained in:
Albert Fabregat 2005-01-30 18:27:05 +00:00
parent edc0478664
commit 070a81e5d4
4 changed files with 30 additions and 4 deletions

View file

@ -100,10 +100,12 @@ int eDIV_LOAD_FPG(FUNCTION_PARAMS)
} }
else { else {
bpp=16; bpp=16;
printf("\n 16 bits");
} }
} }
else { else {
bpp=8; bpp=8;
printf("\n 8 bits");
fseek(f,0,SEEK_SET); fseek(f,0,SEEK_SET);
fread(&cabecera8,1,sizeof(FPGHEADER8),f); fread(&cabecera8,1,sizeof(FPGHEADER8),f);

View file

@ -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á * perfecto antialiasing, pero vamos, esto hay ke optimizarlo bastante (habrá
* que guarrear bastante en el SDL_rotozoomer.c) * que guarrear bastante en el SDL_rotozoomer.c)
*/ */
temp=SDL_CreateRGBSurface(src->flags,src->w,src->h,src->format->BitsPerPixel,0,0,0,0); temp=SDL_CreateRGBSurface(src->flags,src->w,src->h,src->format->BitsPerPixel,0,0,0,0);
SDL_SetColorKey(temp,src->flags,color_transparente); 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); memcpy(temp->pixels,src->pixels,temp->h*temp->pitch);
} }
blits[last_blit].src = xput(temp,zoom,angulo);
/*! /*!
* Pequeño hack para arreglar transparency * Pequeño hack para arreglar transparency
* \todo Debería limpiarse y revisarse un poco :P * \todo Debería limpiarse y revisarse un poco :P
*/ */
if(src->flags & SDL_SRCALPHA) {
/*if(src->flags & SDL_SRCALPHA) {
for(i=0;i<temp->h*temp->w*temp->format->BytesPerPixel;i+=temp->format->BytesPerPixel) { for(i=0;i<temp->h*temp->w*temp->format->BytesPerPixel;i+=temp->format->BytesPerPixel) {
if(*((int*)&((byte*)src->pixels)[i])!=color_transparente) if(*((int*)&((byte*)src->pixels)[i])!=color_transparente)
((byte*)temp->pixels)[i+3]=trans; ((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 { else {
SDL_SetAlpha(temp,SDL_SRCALPHA,trans); SDL_SetAlpha(temp,SDL_SRCALPHA,trans);
}*/
if(blits[last_blit].src->flags & SDL_SRCALPHA) {
for(i=0;i<blits[last_blit].src->h*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) // if(temp!=src)
SDL_FreeSurface(temp); SDL_FreeSurface(temp);

View file

@ -457,9 +457,11 @@ int eDIV_NEW_MAP(FUNCTION_PARAMS)
{ {
if ( !files[0].mapa[i].existe ) 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].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 ; files[0].mapa[i].cpoint[0].y = cy ;
SDL_FillRect( files[0].mapa[i].Surface , NULL , c ) ; SDL_FillRect( files[0].mapa[i].Surface , NULL , c ) ;
SDL_SetColorKey( files[0].mapa[i].Surface , SDL_SRCCOLORKEY | SDL_RLEACCEL , color_transparente ) ; SDL_SetColorKey( files[0].mapa[i].Surface , SDL_SRCCOLORKEY | SDL_RLEACCEL , color_transparente ) ;

View file

@ -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 28/1/2005
--------- ---------
* He investigado un poco el asunto de los juegos de caracteres. Se me ha ocurrido una * He investigado un poco el asunto de los juegos de caracteres. Se me ha ocurrido una