mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 09:54:10 +03:00
Change font::print_wrap text argument from std::string to const char*
We no longer need to pass a std::string object to the print and len functions - in fact, we often only have a C string that we want to print or get the visual width of (that C string most often comes from loc::gettext), and it's a bit wasteful to wrap it in a new std::string object on every print/len call. This does mean adding a few more .c_str()s, but there's not many places where a std::string is being passed to these functions, and we already use .c_str() sometimes. -> Commit 1/3: font::print_wrap Commit 2/3: font::print Commit 3/3: font::len
This commit is contained in:
committed by
Misa Elizabeth Kai
parent
58d21e956b
commit
264b6474be
@@ -1181,7 +1181,7 @@ void editorrender(void)
|
||||
graphics.fill_rect(0,238-textheight,320,240, graphics.getRGB(32,32,32));
|
||||
graphics.fill_rect(0,239-textheight,320,240, graphics.getRGB(0,0,0));
|
||||
|
||||
font::print_wrap(0, 4, 240-textheight, message, 255,255,255, 8, 312);
|
||||
font::print_wrap(0, 4, 240-textheight, message.c_str(), 255,255,255, 8, 312);
|
||||
}
|
||||
else if(ed.scripteditmod)
|
||||
{
|
||||
@@ -1283,7 +1283,7 @@ void editorrender(void)
|
||||
|
||||
graphics.fill_rect(0, 238-textheight, 320, 240, graphics.getRGB(32, 32, 32));
|
||||
graphics.fill_rect(0, 239-textheight, 320, 240, graphics.getRGB(0, 0, 0));
|
||||
font::print_wrap(0, 4, 240-textheight, wrapped, 255, 255, 255, 8, 312);
|
||||
font::print_wrap(0, 4, 240-textheight, wrapped.c_str(), 255, 255, 255, 8, 312);
|
||||
std::string input = key.keybuffer;
|
||||
if (ed.entframe < 2)
|
||||
{
|
||||
@@ -1640,7 +1640,7 @@ void editorrender(void)
|
||||
float alpha = graphics.lerp(ed.oldnotedelay, ed.notedelay);
|
||||
graphics.fill_rect(0, banner_y, 320, 10+textheight, graphics.getRGB(92,92,92));
|
||||
graphics.fill_rect(0, banner_y+1, 320, 8+textheight, graphics.getRGB(0,0,0));
|
||||
font::print_wrap(PR_CEN, -1,banner_y+5, wrapped, 196-((45.0f-alpha)*4), 196-((45.0f-alpha)*4), 196-((45.0f-alpha)*4));
|
||||
font::print_wrap(PR_CEN, -1,banner_y+5, wrapped.c_str(), 196-((45.0f-alpha)*4), 196-((45.0f-alpha)*4), 196-((45.0f-alpha)*4));
|
||||
}
|
||||
|
||||
graphics.drawfade();
|
||||
|
||||
Reference in New Issue
Block a user