improved code to show scaled movies
This commit is contained in:
parent
844c1cf845
commit
794a6f72a8
23
main/movie.c
23
main/movie.c
|
@ -95,7 +95,6 @@ char movielib_files[4][FILENAME_LEN] = {"intro","other","robots"};
|
||||||
|
|
||||||
int MovieHires = 1; //default is highres
|
int MovieHires = 1; //default is highres
|
||||||
int bPlayMovie;
|
int bPlayMovie;
|
||||||
int bRobotRotate;
|
|
||||||
|
|
||||||
SDL_RWops *RoboFile;
|
SDL_RWops *RoboFile;
|
||||||
|
|
||||||
|
@ -175,7 +174,6 @@ int PlayMovie(const char *filename, int must_have)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bRobotRotate;
|
|
||||||
void MovieShowFrame(ubyte *buf, uint bufw, uint bufh, uint sx, uint sy, uint w, uint h, uint dstx, uint dsty)
|
void MovieShowFrame(ubyte *buf, uint bufw, uint bufh, uint sx, uint sy, uint w, uint h, uint dstx, uint dsty)
|
||||||
{
|
{
|
||||||
grs_bitmap source_bm;
|
grs_bitmap source_bm;
|
||||||
|
@ -196,21 +194,22 @@ void MovieShowFrame(ubyte *buf, uint bufw, uint bufh, uint sx, uint sy, uint w,
|
||||||
int yOffs = (grd_curcanv->cv_h - dh) / 2;
|
int yOffs = (grd_curcanv->cv_h - dh) / 2;
|
||||||
int mip;
|
int mip;
|
||||||
|
|
||||||
bPlayMovie = 1;
|
|
||||||
if (FindArg("-nomoviesmooth"))
|
if (FindArg("-nomoviesmooth"))
|
||||||
mip = 0;
|
mip = 0;
|
||||||
else
|
else
|
||||||
mip = 1;
|
mip = 1;
|
||||||
|
|
||||||
glDisable (GL_BLEND);
|
glDisable (GL_BLEND);
|
||||||
if (bRobotRotate) {
|
|
||||||
ogl_ubitblt_i(grd_curcanv->cv_w/2, dh/2, grd_curcanv->cv_w/2.3, grd_curcanv->cv_h/2.3, bufw, bufh, sx, sy, &source_bm,&grd_curcanv->cv_bitmap, mip);
|
ogl_ubitblt_i( w*((double)grd_curscreen->sc_w/(MovieHires?640:320)),
|
||||||
} else {
|
h*((double)grd_curscreen->sc_h/(MovieHires?480:200)),
|
||||||
ogl_ubitblt_i(grd_curcanv->cv_w/1.08, dh/1.08, grd_curcanv->cv_w/26, yOffs+13, bufw, bufh, sx, sy, &source_bm,&grd_curcanv->cv_bitmap, mip); // ZICO - divided by 1.08 gives more original size - offset additions are just approximate values
|
dstx*((double)grd_curscreen->sc_w/(MovieHires?640:320)),
|
||||||
}
|
dsty*((double)grd_curscreen->sc_h/(MovieHires?480:200)),
|
||||||
|
bufw, bufh, sx, sy,
|
||||||
|
&source_bm,&grd_curcanv->cv_bitmap, mip);
|
||||||
|
|
||||||
glEnable (GL_BLEND);
|
glEnable (GL_BLEND);
|
||||||
|
|
||||||
bPlayMovie = 0;
|
|
||||||
#else
|
#else
|
||||||
gr_bm_ubitblt(bufw,bufh,dstx,dsty,sx,sy,&source_bm,&grd_curcanv->cv_bitmap);
|
gr_bm_ubitblt(bufw,bufh,dstx,dsty,sx,sy,&source_bm,&grd_curcanv->cv_bitmap);
|
||||||
#endif
|
#endif
|
||||||
|
@ -331,6 +330,8 @@ int RunMovie(char *filename, int hires_flag, int must_have,int dx,int dy)
|
||||||
return MOVIE_NOT_PLAYED;
|
return MOVIE_NOT_PLAYED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bPlayMovie = 1;
|
||||||
|
|
||||||
MVE_memCallbacks(MPlayAlloc, MPlayFree);
|
MVE_memCallbacks(MPlayAlloc, MPlayFree);
|
||||||
MVE_ioCallbacks(FileRead);
|
MVE_ioCallbacks(FileRead);
|
||||||
|
|
||||||
|
@ -397,6 +398,8 @@ int RunMovie(char *filename, int hires_flag, int must_have,int dx,int dy)
|
||||||
|
|
||||||
SDL_FreeRW(filehndl); // Close Movie File
|
SDL_FreeRW(filehndl); // Close Movie File
|
||||||
|
|
||||||
|
bPlayMovie = 0;
|
||||||
|
|
||||||
// Restore old graphic state
|
// Restore old graphic state
|
||||||
|
|
||||||
Screen_mode=-1; //force reset of screen mode
|
Screen_mode=-1; //force reset of screen mode
|
||||||
|
@ -456,7 +459,6 @@ void DeInitRobotMovie(void)
|
||||||
{
|
{
|
||||||
MVE_rmEndMovie();
|
MVE_rmEndMovie();
|
||||||
SDL_FreeRW(RoboFile); // Close Movie File
|
SDL_FreeRW(RoboFile); // Close Movie File
|
||||||
bRobotRotate = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -465,7 +467,6 @@ int InitRobotMovie(char *filename)
|
||||||
if (FindArg("-nomovies"))
|
if (FindArg("-nomovies"))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
bRobotRotate = 1;
|
|
||||||
con_printf(CON_DEBUG, "RoboFile=%s\n", filename);
|
con_printf(CON_DEBUG, "RoboFile=%s\n", filename);
|
||||||
|
|
||||||
MVE_sndInit(-1); //tell movies to play no sound for robots
|
MVE_sndInit(-1); //tell movies to play no sound for robots
|
||||||
|
|
Loading…
Reference in a new issue