Añadido fp.screen

This commit is contained in:
Albert Fabregat 2002-10-29 21:59:37 +00:00
parent 8d2b551aca
commit 9dd4008212
3 changed files with 174 additions and 13 deletions

View file

@ -173,6 +173,7 @@ int ExportaFuncs(EXPORTAFUNCS_PARAMS)
FUNCTION("graphic_info",3,eDIV_GRAPHIC_INFO) ;
FUNCTION("fade",4,eDIV_FADE) ;
FUNCTION("xput",6,eDIV_XPUT);
FUNCTION("setmode",4,eDIV_SETMODE);
ENTRYPOINT( frame ) ;
ENTRYPOINT( first_load ) ;
@ -1163,6 +1164,21 @@ int eDIV_FADE(FUNCTION_PARAMS2)
return 1 ;
}
int eDIV_SETMODE(FUNCTION_PARAMS)
{
int x,y,bpp,full;
full = getparm();
bpp = getparm();
y = getparm();
x = getparm();
//SDL_SWSURFACE SDL_HWSURFACE
if(full)
screen = SDL_SetVideoMode(x, y, bpp, SDL_SWSURFACE |SDL_FULLSCREEN );
else
screen = SDL_SetVideoMode(x, y, bpp, SDL_SWSURFACE );
return;
}
//*********************************** Entry Points **********************************************//
@ -1338,7 +1354,7 @@ void frame(FUNCTION_PARAMS)
last_blit = -1 ;
SDL_Flip(screen) ;
fp->screen=screen;
fclose(fichero);
}
@ -1364,8 +1380,8 @@ void first_load(FUNCTION_PARAMS2)
//k_error(K_ERR_SDL_SET_VIDEO_MODE);
screen = SDL_SetVideoMode(320, 200, 24, SDL_HWSURFACE );
rmask = 0x00ff0000;
screen = SDL_SetVideoMode(320, 200, 24, SDL_HWSURFACE );
rmask = 0x00ff0000;
gmask = 0x0000ff00;
bmask = 0x000000ff;
amask = 0x00000000;
@ -1415,7 +1431,7 @@ void first_load(FUNCTION_PARAMS2)
int Dibuja(SDL_Surface *src , SDL_Rect srcrect , SDL_Rect dstrect , int z , int trans,int size,int angle)
{
float zoom;
double angulo;
register int i , j ;
last_blit++ ;
@ -1425,11 +1441,13 @@ int Dibuja(SDL_Surface *src , SDL_Rect srcrect , SDL_Rect dstrect , int z , int
zoom=size*0.01;
angulo=angle*10;
blits[last_blit].src = rotozoomSurface (src, 0, zoom,smooth);//zoomSurface (src, zoom,zoom,SMOOTHING_OFF);;
//blits[last_blit].src = //rotozoomSurface (src, angle, zoom,smooth);//zoomSurface (src, zoom,zoom,SMOOTHING_OFF);;
//blits[last_blit].src = SDL_BlitSurface(rotozoomSurface (src, angle, 2,1), NULL , fondo , &dstrect );//src ;
//blits[last_blit].src = src;
blits[last_blit].src =xput(src, zoom,angulo);
blits[last_blit].srcrect.x = srcrect.x ;
blits[last_blit].srcrect.y = srcrect.y ;
blits[last_blit].srcrect.w = blits[last_blit].src->w;//srcrect.w ;
@ -1467,11 +1485,15 @@ int Dibuja(SDL_Surface *src , SDL_Rect srcrect , SDL_Rect dstrect , int z , int
SDL_Surface *xput(SDL_Surface *src,double size,double angle)
{
SDL_Surface *dst;
SDL_Surface *tmp;
tmp= zoomSurface (src, size/100, size/100,1);
dst=rotozoomSurface (tmp, angle, 1,1);
int s;
SDL_Surface *dst;
SDL_Surface *tmp;
s=smooth;
if(size==1 && angle ==0)s=0;
tmp= zoomSurface (src, size, size,s);
dst=rotozoomSurface (tmp, angle, 1,s);
SDL_FreeSurface (tmp);
return dst;

View file

@ -200,7 +200,7 @@ int main(int argc, char* argv[])
for(i=0;i<num_indexed_vars;i++) {
varindex[i].hash=*ptr++;
varindex[i].nombre=strdup(ptr);
varindex[i].nombre=_strdup(ptr);
while(*ptr!=0) ptr++;
ptr++;
varindex[i].offset=*(int*)ptr; ptr+=4;
@ -336,8 +336,10 @@ int main(int argc, char* argv[])
teclas=SDL_GetKeyState(NULL);
if(teclas[SDLK_x] && (teclas[SDLK_RALT] || teclas[SDLK_LALT]))
stub_quit(0);
interprete();
if(teclas[SDLK_p] && (teclas[SDLK_RALT] || teclas[SDLK_LALT]))
SDL_SaveBMP(fp.screen,"SC.BMP");
interprete();
#ifdef _DEBUG
if(sp!=0) printf("PANIC! Quedan restos en la pila!! (sp=%d)\n",sp);

View file

@ -0,0 +1,137 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "ANSIC"="..\..\DLLS\ANSIC.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "dinmem"="..\..\DLLS\dinmem\dinmem.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "edivstd"="..\..\dlls\edivstd\edivstd.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "file"="..\..\DLLS\file\file.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "graphics"="..\..\dlls\graphics\graphics.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "input"="..\..\DLLS\input\input.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "math"="..\..\dlls\math\math.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "scroll"="..\..\DLLS\scroll\scroll.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "strings"="..\..\dlls\strings\strings.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "text"="..\..\DLLS\text\text.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################