summaryrefslogtreecommitdiffstats
path: root/gui/terminal.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2018-08-24 18:17:36 +0200
committerEthan Yonker <dees_troy@teamw.in>2018-08-24 18:17:39 +0200
commit58f2132bc3954fc704787d477500a209eedb8e29 (patch)
treeeb0f79aacd68724b0c0c091018384ef924380f47 /gui/terminal.cpp
parentRemove remaining pieces of supersu (diff)
parentSnap for 4745538 from 723056a83f8c8b15af02d9c302862dbb2304ea8c to pi-release (diff)
downloadandroid_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.gz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.bz2
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.lz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.xz
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.tar.zst
android_bootable_recovery-58f2132bc3954fc704787d477500a209eedb8e29.zip
Diffstat (limited to 'gui/terminal.cpp')
-rw-r--r--gui/terminal.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/gui/terminal.cpp b/gui/terminal.cpp
index 65ad2c026..b1799ce63 100644
--- a/gui/terminal.cpp
+++ b/gui/terminal.cpp
@@ -861,9 +861,12 @@ size_t GUITerminal::GetItemCount()
return engine->getLinesCount();
}
-void GUITerminal::RenderItem(size_t itemindex, int yPos, bool selected)
+void GUITerminal::RenderItem(size_t itemindex, int yPos, bool selected __unused)
{
const TerminalEngine::Line& line = engine->getLine(itemindex);
+
+ if (!mFont || !mFont->GetResource())
+ return;
gr_color(mFontColor.red, mFontColor.green, mFontColor.blue, mFontColor.alpha);
// later: handle attributes here
@@ -887,7 +890,7 @@ void GUITerminal::RenderItem(size_t itemindex, int yPos, bool selected)
}
}
-void GUITerminal::NotifySelect(size_t item_selected)
+void GUITerminal::NotifySelect(size_t item_selected __unused)
{
// do nothing - terminal ignores selections
}
@@ -897,8 +900,10 @@ void GUITerminal::InitAndResize()
// make sure the shell is started
engine->initPty();
// send window resize
- int charWidth = gr_ttf_measureEx("N", mFont->GetResource());
- engine->setSize(mRenderW / charWidth, GetDisplayItemCount(), mRenderW, mRenderH);
+ if (mFont && mFont->GetResource()) {
+ int charWidth = gr_ttf_measureEx("N", mFont->GetResource());
+ engine->setSize(mRenderW / charWidth, GetDisplayItemCount(), mRenderW, mRenderH);
+ }
}
void GUITerminal::SetPageFocus(int inFocus)