AVALANCHE: Introduce Graphics::drawText(). Rename raw to fontType, move it from Gyro to Graphics. Update the rest of the code using these two. Simplifying underlining of characters in Parser and Dropdown.
This commit is contained in:
parent
ee6119d07f
commit
698dae201a
8 changed files with 44 additions and 58 deletions
|
@ -93,16 +93,7 @@ void Parser::plotText() {
|
|||
|
||||
_vm->_graphics->drawBar(24, 161, 640, 169, black); // Black out the line of the text.
|
||||
|
||||
// Draw the text. Similar to chalk(), but here we don't have to bother with the color of the characters.
|
||||
for (byte i = 0; i < _vm->_parser->_inputText.size(); i++)
|
||||
for (byte j = 0; j < 8; j++) {
|
||||
byte pixel = _vm->_gyro->characters[_vm->_parser->_inputText[i]][j];
|
||||
for (byte bit = 0; bit < 8; bit++) {
|
||||
byte pixelBit = (pixel >> bit) & 1;
|
||||
if (pixelBit != 0)
|
||||
*_vm->_graphics->getPixel(24 + i * 8 + 7 - bit, 161 + j) = white;
|
||||
}
|
||||
}
|
||||
_vm->_graphics->drawText(_vm->_graphics->_surface, _vm->_parser->_inputText, _vm->_gyro->characters, 8, 24, 161, white);
|
||||
|
||||
cursorOn();
|
||||
_vm->_gyro->super_on();
|
||||
|
@ -134,19 +125,9 @@ int16 Parser::pos(const Common::String &crit, const Common::String &src) {
|
|||
}
|
||||
|
||||
void Parser::drawCursor() {
|
||||
// Draw the '_' character. Similar to plotText().
|
||||
char cursor = '_';
|
||||
|
||||
for (byte j = 0; j < 8; j++) {
|
||||
byte pixel = _vm->_gyro->characters[cursor][j];
|
||||
for (byte bit = 0; bit < 8; bit++) {
|
||||
byte pixelBit = (pixel >> bit) & 1;
|
||||
if (pixelBit != 0)
|
||||
*_vm->_graphics->getPixel(24 + _inputTextPos * 8 + 7 - bit, 161 + j) = white;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Draw the '_' character.
|
||||
for (byte bit = 0; bit < 8; bit++)
|
||||
*_vm->_graphics->getPixel(24 + _inputTextPos * 8 + 7 - bit, 168) = white;
|
||||
|
||||
bytefield bf;
|
||||
bf.x1 = _inputTextPos + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue