|
@@ -615,6 +615,12 @@ Color Graphics::getBackgroundColor() const
|
|
|
|
|
|
void Graphics::setFont(Font *font)
|
|
void Graphics::setFont(Font *font)
|
|
{
|
|
{
|
|
|
|
+ // Hack: the Lua-facing love.graphics.print function will set the current
|
|
|
|
+ // font if needed, but only on its first call... we want to make sure a nil
|
|
|
|
+ // font is never accidentally set (e.g. via love.graphics.reset.)
|
|
|
|
+ if (font == nullptr)
|
|
|
|
+ return;
|
|
|
|
+
|
|
DisplayState &state = states.back();
|
|
DisplayState &state = states.back();
|
|
state.font.set(font);
|
|
state.font.set(font);
|
|
}
|
|
}
|
|
@@ -1289,11 +1295,6 @@ void Graphics::pop()
|
|
{
|
|
{
|
|
DisplayState &newstate = states[states.size() - 2];
|
|
DisplayState &newstate = states[states.size() - 2];
|
|
|
|
|
|
- // Hack: the Lua-facing love.graphics.print function will set the current
|
|
|
|
- // font if needed, but only on its first call... we always want a font.
|
|
|
|
- if (newstate.font.get() == nullptr)
|
|
|
|
- newstate.font.set(states.back().font.get());
|
|
|
|
-
|
|
|
|
restoreStateChecked(newstate);
|
|
restoreStateChecked(newstate);
|
|
|
|
|
|
// The last two states in the stack should be equal now.
|
|
// The last two states in the stack should be equal now.
|