Exemplo n.º 1
0
void GfxMgr::rawDrawButton(int x, int y, const char *s, int fgcolor, int bgcolor, bool border, int textOffset) {
	int len = strlen(s);
	int x1, y1, x2, y2;

	x1 = x - 3;
	y1 = y - 3;
	x2 = x + CHAR_COLS * len + 2;
	y2 = y + CHAR_LINES + 2;

	// Draw a filled rectangle that's larger than the button. Used for drawing
	// a border around the button as the button itself is drawn after this.
	drawRectangle(x1, y1, x2, y2, border ? BUTTON_BORDER : MSG_BOX_COLOR);

	while (*s) {
		putTextCharacter(0, x + textOffset, y + textOffset, *s++, fgcolor, bgcolor, false, _vm->getFontData());
		x += CHAR_COLS;
	}

	x1 -= 2;
	y1 -= 2;
	x2 += 2;
	y2 += 2;

	flushBlock(x1, y1, x2, y2);
}
Exemplo n.º 2
0
void GfxMgr::putTextCharacter(int l, int x, int y, unsigned char c, int fg, int bg, bool checkerboard, const uint8 *font) {
	int x1, y1, xx, yy, cc;
	const uint8 *p;

	assert(font);

	p = font + ((unsigned int)c * CHAR_LINES);
	for (y1 = 0; y1 < CHAR_LINES; y1++) {
		for (x1 = 0; x1 < CHAR_COLS; x1++) {
			xx = x + x1;
			yy = y + y1;
			cc = (*p & (1 << (7 - x1))) ? fg : bg;
			_agiScreen[xx + yy * GFX_WIDTH] = cc;
		}

		p++;
	}

	// Simple checkerboard effect to simulate "greyed out" text.
	// This is what Sierra's interpreter does for things like menu items
	// that aren't selectable (such as separators). -- dsymonds
	if (checkerboard) {
		for (yy = y; yy < y + CHAR_LINES; yy++)
			for (xx = x + (~yy & 1); xx < x + CHAR_COLS; xx += 2)
				_agiScreen[xx + yy * GFX_WIDTH] = 15;
	}

	// FIXME: we don't want this when we're writing on the
	//        console!
	flushBlock(x, y, x + CHAR_COLS - 1, y + CHAR_LINES - 1);
}
void WriteMessageBlock::setIoDevice(QIODevice *ioDevice)
{
    m_ioDevice = ioDevice;
    if (m_localSocket != ioDevice)
        m_localSocket = nullptr;

    flushBlock();
}
Exemplo n.º 4
0
static void
pcmDestruct (NoteDevice *device) {
  flushBlock(device);
  free(device->blockAddress);
  closePcmDevice(device->pcm);
  free(device);
  logMessage(LOG_DEBUG, "PCM disabled");
}
Exemplo n.º 5
0
void GfxMgr::drawBox(int x1, int y1, int x2, int y2, int color1, int color2, int m) {
	x1 += m;
	y1 += m;
	x2 -= m;
	y2 -= m;

	drawRectangle(x1, y1, x2, y2, color1);
	drawFrame(x1 + 2, y1 + 2, x2 - 2, y2 - 2, color2, color2);
	flushBlock(x1, y1, x2, y2);
}
Exemplo n.º 6
0
void GfxMgr::shakeEnd() {
	int i;

	for (i = 0; i < GFX_HEIGHT - SHAKE_MAG; i++) {
		memcpy(_agiScreen + i * GFX_WIDTH, _shakeV + i * SHAKE_MAG, SHAKE_MAG);
	}

	for (i = 0; i < SHAKE_MAG; i++) {
		memcpy(_agiScreen + i * GFX_WIDTH, _shakeH + i * GFX_WIDTH, GFX_WIDTH);
	}

	flushBlock(0, 0, GFX_WIDTH - 1, GFX_HEIGHT - 1);

	free(_shakeV);
	free(_shakeH);
}
void WriteMessageBlock::write(const MessageEnvelop &message)
{
    QDataStream out(&m_block, QIODevice::WriteOnly | QIODevice::Append);

    int startOffset = m_block.size();
    const qint32 dummyBockSize = 0;
    out << dummyBockSize;

    out << m_messageCounter;

    out << message;

    out.device()->seek(startOffset);
    out << qint32(m_block.size() - startOffset - sizeof(qint32));

    ++m_messageCounter;

    flushBlock();
}
Exemplo n.º 8
0
static int
pcmFlush (NoteDevice *device) {
  return flushBlock(device);
}