1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 10:09:43 +01:00

Interpolate horizontal warp BG

So that it's really, really smooth. Only noticeable in slowdown mode,
though.
This commit is contained in:
Misa 2020-04-29 11:03:17 -07:00 committed by Ethan Lee
parent c9c55d0c8b
commit c7d3a684ea
3 changed files with 7 additions and 1 deletions

View file

@ -111,6 +111,7 @@ void Graphics::init()
tempBuffer = NULL; tempBuffer = NULL;
tl = point(); tl = point();
towerbuffer = NULL; towerbuffer = NULL;
towerbuffer_lerp = NULL;
trinketr = 0; trinketr = 0;
trinketg = 0; trinketg = 0;
trinketb = 0; trinketb = 0;
@ -1957,7 +1958,9 @@ void Graphics::drawbackground( int t )
} }
break; break;
case 3: //Warp zone (horizontal) case 3: //Warp zone (horizontal)
BlitSurfaceStandard(towerbuffer, NULL, backBuffer, NULL); BlitSurfaceStandard(towerbuffer, NULL, towerbuffer_lerp, NULL);
ScrollSurface(towerbuffer_lerp, lerp(0, -3), 0);
BlitSurfaceStandard(towerbuffer_lerp, NULL, backBuffer, NULL);
break; break;
case 4: //Warp zone (vertical) case 4: //Warp zone (vertical)
backoffset+=3; backoffset+=3;

View file

@ -233,6 +233,7 @@ public:
Screen* screenbuffer; Screen* screenbuffer;
SDL_Surface* menubuffer; SDL_Surface* menubuffer;
SDL_Surface* towerbuffer; SDL_Surface* towerbuffer;
SDL_Surface* towerbuffer_lerp;
SDL_Surface* foregroundBuffer; SDL_Surface* foregroundBuffer;
SDL_Surface* tempBuffer; SDL_Surface* tempBuffer;

View file

@ -193,6 +193,8 @@ int main(int argc, char *argv[])
graphics.towerbuffer = SDL_CreateRGBSurface(SDL_SWSURFACE ,320 ,240 ,fmt->BitsPerPixel,fmt->Rmask,fmt->Gmask,fmt->Bmask,fmt->Amask ); graphics.towerbuffer = SDL_CreateRGBSurface(SDL_SWSURFACE ,320 ,240 ,fmt->BitsPerPixel,fmt->Rmask,fmt->Gmask,fmt->Bmask,fmt->Amask );
SDL_SetSurfaceBlendMode(graphics.towerbuffer, SDL_BLENDMODE_NONE); SDL_SetSurfaceBlendMode(graphics.towerbuffer, SDL_BLENDMODE_NONE);
graphics.towerbuffer_lerp = SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 240, fmt->BitsPerPixel, fmt->Rmask, fmt->Gmask, fmt->Bmask, fmt->Amask);
SDL_SetSurfaceBlendMode(graphics.towerbuffer, SDL_BLENDMODE_NONE);
graphics.tempBuffer = SDL_CreateRGBSurface(SDL_SWSURFACE ,320 ,240 ,fmt->BitsPerPixel,fmt->Rmask,fmt->Gmask,fmt->Bmask,fmt->Amask ); graphics.tempBuffer = SDL_CreateRGBSurface(SDL_SWSURFACE ,320 ,240 ,fmt->BitsPerPixel,fmt->Rmask,fmt->Gmask,fmt->Bmask,fmt->Amask );
SDL_SetSurfaceBlendMode(graphics.tempBuffer, SDL_BLENDMODE_NONE); SDL_SetSurfaceBlendMode(graphics.tempBuffer, SDL_BLENDMODE_NONE);