Ejemplo n.º 1
0
void Journal::drawPanelText(int y, const char *text) {
    debug(7, "Journal::drawPanelText(%d, '%s')", y, text);
    char s[128];
    strncpy(s, text, 127);
    s[127] = 0;
    char *p;

    // remove leading and trailing spaces (necessary for spanish version)
    for (p = s + strlen(s) - 1; p >= s && *p == ' '; --p) {
        *p = 0;
    }
    text = s;
    for (p = s; *p == ' '; ++p) {
        text = p + 1;
    }
    // draw the substrings
    p = (char *)strchr(text, ' ');
    if (!p) {
        int x = (128 - _vm->display()->textWidth(text)) / 2;
        _vm->display()->setText(x, y, text, false);
        assert(_panelTextCount < MAX_PANEL_TEXTS);
        _panelTextY[_panelTextCount++] = y;
    } else {
        *p++ = '\0';
        if (_vm->resource()->getLanguage() == Common::HB_ISR) {
            drawPanelText(y - 5, p);
            drawPanelText(y + 5, text);
        } else {
            drawPanelText(y - 5, text);
            drawPanelText(y + 5, p);
        }
    }
}
Ejemplo n.º 2
0
void Journal::drawPanel(const int *frames, const int *titles, int n) {
    for (int i = 0; i < _panelTextCount; ++i) {
        _vm->display()->clearTexts(_panelTextY[i], _panelTextY[i]);
    }
    _panelTextCount = 0;
    int bobNum = 1;
    int y = 8;
    while (n--) {
        showBob(bobNum++, 32, y, *frames++);
        drawPanelText(y + 12, _vm->logic()->joeResponse(*titles++));
        y += 48;
    }
}
Ejemplo n.º 3
0
void Journal::drawPanelText(int y, const char *text) {
	debug(7, "Journal::drawPanelText(%d, '%s')", y, text);

	char s[128];
	removeLeadingAndTrailingSpaces(s, 128, text); // necessary for spanish version

	// draw the substrings
	char *p = strchr(s, ' ');
	if (!p) {
		int x = (128 - _vm->display()->textWidth(s)) / 2;
		_vm->display()->setText(x, y, s, false);
		assert(_panelTextCount < MAX_PANEL_TEXTS);
		_panelTextY[_panelTextCount++] = y;
	} else {
		*p++ = '\0';
		if (_vm->resource()->getLanguage() == Common::HE_ISR) {
			drawPanelText(y - 5, p);
			drawPanelText(y + 5, s);
		} else {
			drawPanelText(y - 5, s);
			drawPanelText(y + 5, p);
		}
	}
}