mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-02-02 23:42:21 +03:00
Update text boxes in the inner fixed-timestep loop
So they don't go really quickly.
This commit is contained in:
@@ -609,15 +609,6 @@ void Graphics::drawgui()
|
|||||||
//Draw all the textboxes to the screen
|
//Draw all the textboxes to the screen
|
||||||
for (size_t i = 0; i<textbox.size(); i++)
|
for (size_t i = 0; i<textbox.size(); i++)
|
||||||
{
|
{
|
||||||
//This routine also updates the textboxs
|
|
||||||
textbox[i].update();
|
|
||||||
if (textbox[i].tm == 2 && textbox[i].tl <= 0.5)
|
|
||||||
{
|
|
||||||
textbox.erase(textbox.begin() + i);
|
|
||||||
i--;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (textbox[i].r == 0 && textbox[i].g == 0 && textbox[i].b == 0)
|
if (textbox[i].r == 0 && textbox[i].g == 0 && textbox[i].b == 0)
|
||||||
{
|
{
|
||||||
if(flipmode)
|
if(flipmode)
|
||||||
@@ -752,6 +743,21 @@ void Graphics::drawgui()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Graphics::updatetextboxes()
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < textbox.size(); i++)
|
||||||
|
{
|
||||||
|
textbox[i].update();
|
||||||
|
|
||||||
|
if (textbox[i].tm == 2 && textbox[i].tl <= 0.5)
|
||||||
|
{
|
||||||
|
textbox.erase(textbox.begin() + i);
|
||||||
|
i--;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Graphics::drawimagecol( int t, int xp, int yp, int r = 0, int g = 0, int b = 0, bool cent/*= false*/ )
|
void Graphics::drawimagecol( int t, int xp, int yp, int r = 0, int g = 0, int b = 0, bool cent/*= false*/ )
|
||||||
{
|
{
|
||||||
if (!INBOUNDS(t, images))
|
if (!INBOUNDS(t, images))
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ public:
|
|||||||
|
|
||||||
void drawimagecol(int t, int xp, int yp, int r, int g, int b, bool cent= false);
|
void drawimagecol(int t, int xp, int yp, int r, int g, int b, bool cent= false);
|
||||||
|
|
||||||
|
void updatetextboxes();
|
||||||
void drawgui();
|
void drawgui();
|
||||||
|
|
||||||
void drawsprite(int x, int y, int t, int r, int g, int b);
|
void drawsprite(int x, int y, int t, int r, int g, int b);
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ void maplogic()
|
|||||||
{
|
{
|
||||||
//Misc
|
//Misc
|
||||||
help.updateglow();
|
help.updateglow();
|
||||||
|
graphics.updatetextboxes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1500,4 +1501,6 @@ void gamelogic()
|
|||||||
{
|
{
|
||||||
obj.trophytext--;
|
obj.trophytext--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
graphics.updatetextboxes();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ void textboxclass::update()
|
|||||||
if (tl <= 0.5)
|
if (tl <= 0.5)
|
||||||
{
|
{
|
||||||
tl = 0.5;
|
tl = 0.5;
|
||||||
//this textbox will be removed by drawgui() later
|
//this textbox will be removed by updatetextboxes() later
|
||||||
}
|
}
|
||||||
setcol(int(tr * tl), int(tg * tl), int(tb * tl));
|
setcol(int(tr * tl), int(tg * tl), int(tb * tl));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user