Some graphics library cleanup

This commit is contained in:
Víctor Román Archidona 2014-07-29 09:25:00 +02:00
parent b5f45a61eb
commit 3b65888eb1
2 changed files with 30 additions and 40 deletions

View file

@ -554,21 +554,24 @@ transformSurfaceY (SDL_Surface * src, SDL_Surface * dst, int cx, int cy,
*/ */
/*XPUT/* Sanity check */ /*
/* Determine if source surface is 32bit or 8bit */ Sanity check
/* New source surface is 32bit with a defined RGBA ordering */ Determine if source surface is 32bit or 8bit
/* Sanity check zoom factor */ New source surface is 32bit with a defined RGBA ordering
/* Check if we have a rotozoom or just a zoom */ Sanity check zoom factor
/* Angle!=0: full rotozoom * Check if we have a rotozoom or just a zoom
//* ----------------------- */ Angle!=0: full rotozoom
/* Calculate target factors from sin/cos and zoom Calculate target factors from sin/cos and zoom
*/
/*
Determine destination width and height by rotating a centered source box
Alloc space to completely contain the rotated surface
Target surface is 32bit with source RGBA/ABGR ordering
Lock source surface
Check which kind of surface we have
Call the 32bit transformation routine to do the rotation (using alpha)
*/ */
/* Determine destination width and height by rotating a centered source box */
/* Alloc space to completely contain the rotated surface */
/* Target surface is 32bit with source RGBA/ABGR ordering */
/* Lock source surface */
/* Check which kind of surface we have */
/* Call the 32bit transformation routine to do the rotation (using alpha) */
#define VALUE_LIMIT 0.001 #define VALUE_LIMIT 0.001

View file

@ -177,20 +177,26 @@ FILE * memo ;
* nombre. * nombre.
* @param nombre_program Nombre del programa, obtenido de fp->nombre_program * @param nombre_program Nombre del programa, obtenido de fp->nombre_program
*/ */
void guarda_pantallazo(char* nombre_program) void guarda_pantallazo(unsigned char *nombre_program)
{ {
char capturef[256]; char capturef[256];
int c=0; int c=0;
FILE* f; FILE* f;
sprintf(capturef,"%s%04d.bmp",nombre_program,c); while(1) {
while(f=fopen(capturef,"rb")) { /* 256 son mas que suficientes */
fclose(f); if (c >= 256)
c++;
sprintf(capturef,"%s%04d.bmp",nombre_program,c);
if(c==0)
break; break;
sprintf(capturef,"%s%04d.bmp",nombre_program,c);
f = fopen(capturef, "rb");
if (f == NULL)
c++;
fclose(f);
} }
SDL_SaveBMP(screen,capturef); SDL_SaveBMP(screen,capturef);
} }
@ -344,25 +350,6 @@ void frame(FUNCTION_PARAMS)
{ {
if ( draws[i].existe ) if ( draws[i].existe )
{ {
/* if ( draws[i].x + draws[i].Surface->w >= fp->regions[0].x && draws[i].x < fp->regions[0].x + fp->regions[0].w &&
draws[i].y + draws[i].Surface->h >= fp->regions[0].y && draws[i].y < fp->regions[0].y + fp->regions[0].h )
{
if ( draws[i].x >= fp->regions[0].x && draws[i].x + draws[i].Surface->w < fp->regions[0].x + fp->regions[0].w &&
draws[i].y >= fp->regions[0].y && draws[i].y + draws[i].Surface->h < fp->regions[0].y + fp->regions[0].h )
{
srcrect.x = 0 ;
srcrect.y = 0 ;
srcrect.w = draws[i].Surface->w ;
srcrect.h = draws[i].Surface->h ;
dstrect.x = draws[i].x ;
dstrect.y = draws[i].y ;
dstrect.w = 0 ; /* Se ignora *//*
dstrect.h = 0 ; /* Se ignora *//*
Dibuja( draws[i].Surface , srcrect , dstrect , z , draws[i].t,100,0) ;
}
}*/
Dibuja(draws[i].Surface,draws[i].x,draws[i].y,0,0,draws[i].region,z,0,draws[i].t,100,0); Dibuja(draws[i].Surface,draws[i].x,draws[i].y,0,0,draws[i].region,z,0,draws[i].t,100,0);
} }
} }