AVALANCHE: Rename variables in Parser. Add _leftMargin to Parser. Fix _leftMargins in Basher.

This commit is contained in:
uruk 2013-07-27 21:48:28 +02:00
parent eec48fa42e
commit 31f8e91444
5 changed files with 17 additions and 17 deletions

View file

@ -89,8 +89,8 @@ void Avalot::setup() {
_vm->_lucerna->load_digits();
_vm->_gyro->cheat = false;
_vm->_gyro->cp = 0;
_vm->_parser->inputTextPos = 0;
_vm->_parser->quote = true;
_vm->_parser->_inputTextPos = 0;
_vm->_parser->_quote = true;
_vm->_gyro->ledstatus = 177;
_vm->_gyro->defaultled = 2;
/* TSkellern:=0; { Replace with a more local variable sometime }*/

View file

@ -179,10 +179,10 @@ void Basher::filename_edit() {
void Basher::normal_edit() {
entering_filename = false;
left_margin = 1;
if (!_vm->_parser->inputText.empty())
_vm->_parser->inputText.clear();
_vm->_parser->inputTextPos = 0;
_vm->_parser->_leftMargin = 0;
if (!_vm->_parser->_inputText.empty())
_vm->_parser->_inputText.clear();
_vm->_parser->_inputTextPos = 0;
}
} // End of namespace Avalanche.

View file

@ -73,7 +73,6 @@ private:
AvalancheEngine *_vm;
bool entering_filename;
byte left_margin;
void wipetext();

View file

@ -39,17 +39,17 @@ void Parser::handleInputText(const Common::Event &event) {
if (_vm->_dropdown->ddm_o.menunow) {
_vm->_dropdown->parsekey(inChar, _vm->_enhanced->extd);
} else {
if (inputText.size() < 76) {
if (_inputText.size() < 76) {
if ((inChar == '"') || (inChar == '`')) {
if (quote)
if (_quote)
inChar = '`';
else
inChar = '"';
quote = !quote; // quote - unquote
_quote = !_quote; // quote - unquote
}
inputText.insertChar(inChar, inputTextPos);
inputTextPos++;
_inputText.insertChar(inChar, _inputTextPos);
_inputTextPos++;
plotText();
} else
_vm->_gyro->blip();
@ -65,9 +65,9 @@ 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 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];
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)

View file

@ -35,9 +35,10 @@ class AvalancheEngine;
class Parser {
public:
Common::String inputText;
byte inputTextPos;
bool quote; // 66 or 99 next?
Common::String _inputText;
byte _inputTextPos;
bool _quote; // 66 or 99 next?
byte _leftMargin;