mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 10:09:43 +01:00
Interpolate tower scrolling
Now tower scrolling will look smooth ayy-eff.
This commit is contained in:
parent
880465c2e5
commit
fe1045b515
4 changed files with 13 additions and 5 deletions
|
@ -1481,7 +1481,7 @@ void Graphics::drawentities()
|
|||
int yoff;
|
||||
if (map.towermode)
|
||||
{
|
||||
yoff = map.ypos;
|
||||
yoff = lerp(map.oldypos, map.ypos);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2320,12 +2320,13 @@ void Graphics::drawfinalmap()
|
|||
void Graphics::drawtowermap()
|
||||
{
|
||||
int temp;
|
||||
int yoff = lerp(map.oldypos, map.ypos);
|
||||
for (int j = 0; j < 31; j++)
|
||||
{
|
||||
for (int i = 0; i < 40; i++)
|
||||
{
|
||||
temp = map.tower.at(i, j, map.ypos);
|
||||
if (temp > 0) drawtile3(i * 8, (j * 8) - ((int)map.ypos % 8), temp, map.colstate);
|
||||
temp = map.tower.at(i, j, yoff);
|
||||
if (temp > 0) drawtile3(i * 8, (j * 8) - (yoff % 8), temp, map.colstate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2333,12 +2334,13 @@ void Graphics::drawtowermap()
|
|||
void Graphics::drawtowermap_nobackground()
|
||||
{
|
||||
int temp;
|
||||
int yoff = lerp(map.oldypos, map.ypos);
|
||||
for (int j = 0; j < 31; j++)
|
||||
{
|
||||
for (int i = 0; i < 40; i++)
|
||||
{
|
||||
temp = map.tower.at(i, j, map.ypos);
|
||||
if (temp > 0 && temp<28) drawtile3(i * 8, (j * 8) - ((int)map.ypos % 8), temp, map.colstate);
|
||||
temp = map.tower.at(i, j, yoff);
|
||||
if (temp > 0 && temp<28) drawtile3(i * 8, (j * 8) - (yoff % 8), temp, map.colstate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -260,6 +260,7 @@ void gamelogic()
|
|||
|
||||
if (map.towermode)
|
||||
{
|
||||
map.oldypos = map.ypos;
|
||||
if(!game.completestop)
|
||||
{
|
||||
if (map.cameramode == 0)
|
||||
|
|
|
@ -91,6 +91,10 @@ mapclass::mapclass()
|
|||
2,2,2,2,2,0,0,2,0,3,0,0,0,0,0,0,0,0,0,0,
|
||||
};
|
||||
areamap.insert(areamap.end(), tmap, tmap+400);
|
||||
|
||||
ypos = 0;
|
||||
oldypos = 0;
|
||||
bypos = 0;
|
||||
}
|
||||
|
||||
int mapclass::RGB(int red,int green,int blue)
|
||||
|
|
|
@ -98,6 +98,7 @@ public:
|
|||
//Special tower stuff
|
||||
bool towermode;
|
||||
float ypos;
|
||||
float oldypos;
|
||||
int bypos;
|
||||
int cameramode;
|
||||
int cameraseek, cameraseekframe;
|
||||
|
|
Loading…
Reference in a new issue