2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2004-01-04 14:35:46 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-10-18 01:30:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2004-01-04 14:35:46 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2004-12-27 22:08:20 +00:00
|
|
|
#include "common/system.h"
|
2005-01-10 22:35:43 +00:00
|
|
|
#include "common/util.h"
|
2006-05-25 22:51:42 +00:00
|
|
|
#include "graphics/cursorman.h"
|
2011-08-16 05:23:02 +00:00
|
|
|
#ifdef ENABLE_HE
|
|
|
|
#include "graphics/wincursor.h"
|
|
|
|
#endif
|
2005-05-14 23:28:22 +00:00
|
|
|
#include "scumm/bomp.h"
|
2004-08-23 08:37:55 +00:00
|
|
|
#include "scumm/charset.h"
|
2006-02-15 00:57:50 +00:00
|
|
|
#include "scumm/he/intern_he.h"
|
2004-08-22 23:38:00 +00:00
|
|
|
#include "scumm/object.h"
|
2006-02-15 18:48:49 +00:00
|
|
|
#include "scumm/he/resource_he.h"
|
2005-01-06 15:57:12 +00:00
|
|
|
#include "scumm/saveload.h"
|
2004-01-04 14:35:46 +00:00
|
|
|
#include "scumm/scumm.h"
|
2009-03-20 16:33:58 +00:00
|
|
|
#include "scumm/scumm_v2.h"
|
|
|
|
#include "scumm/scumm_v5.h"
|
2004-01-04 14:35:46 +00:00
|
|
|
|
|
|
|
namespace Scumm {
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Mouse cursor cycle colors (for the default crosshair).
|
|
|
|
*/
|
|
|
|
static const byte default_v1_cursor_colors[4] = {
|
|
|
|
1, 1, 12, 11
|
|
|
|
};
|
|
|
|
|
2009-11-22 08:55:36 +00:00
|
|
|
static const uint16 default_pce_cursor_colors[4] = {
|
2009-11-22 10:56:49 +00:00
|
|
|
0x01FF, 0x01FF, 0x016D, 0x0092
|
2009-11-22 08:55:36 +00:00
|
|
|
};
|
|
|
|
|
2004-01-04 14:35:46 +00:00
|
|
|
static const byte default_cursor_colors[4] = {
|
|
|
|
15, 15, 7, 8
|
|
|
|
};
|
|
|
|
|
2008-01-27 15:10:56 +00:00
|
|
|
// 2bpp
|
|
|
|
static const uint16 default_he_cursor[128] = {
|
|
|
|
0x0a80, 0x0000, 0x0000, 0x0000, 0x2568, 0x0000, 0x0000, 0x0000,
|
|
|
|
0x9556, 0x8000, 0x0000, 0x0000, 0x9955, 0x6800, 0x0000, 0x0000,
|
|
|
|
0x9955, 0x5680, 0x0000, 0x0000, 0x2655, 0x5568, 0x0000, 0x0000,
|
|
|
|
0x2695, 0x5556, 0x8000, 0x0000, 0x0995, 0x5555, 0x6800, 0x0000,
|
|
|
|
0x09a5, 0x5555, 0x5600, 0x0000, 0x0269, 0x5555, 0x5580, 0x0000,
|
|
|
|
0x0269, 0x5555, 0x5560, 0x0000, 0x009a, 0x5555, 0x5560, 0x0000,
|
|
|
|
0x009a, 0x9555, 0x5580, 0x0000, 0x0026, 0x9555, 0x5600, 0x0000,
|
|
|
|
0x0026, 0xa555, 0x5580, 0x0000, 0x0009, 0xa955, 0x5560, 0x0000,
|
|
|
|
0x0009, 0xa9a9, 0x5558, 0x0000, 0x0002, 0x6aaa, 0x5558, 0x0000,
|
|
|
|
0x0002, 0x6a9a, 0xaa58, 0x0000, 0x0000, 0x9a66, 0xaa60, 0x0000,
|
|
|
|
0x0000, 0x2589, 0xa980, 0x0000, 0x0000, 0x0a02, 0x5600, 0x0000,
|
|
|
|
0x0000, 0x0000, 0xa800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
|
|
|
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
|
|
|
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
2005-04-20 03:13:06 +00:00
|
|
|
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
|
|
|
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
|
|
|
|
};
|
|
|
|
|
2005-07-19 17:53:55 +00:00
|
|
|
static const byte default_v6_cursor[] = {
|
|
|
|
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x0F,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
|
|
|
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x0F,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
|
|
|
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x0F,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
|
|
|
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x0F,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
|
|
|
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x0F,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
|
|
|
0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x0F,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,
|
|
|
|
0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, 0x0F,0x0F,0x0F, 0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0xFF,
|
|
|
|
0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x0F,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,
|
|
|
|
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x0F,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
|
|
|
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x0F,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
|
|
|
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x0F,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
|
|
|
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x0F,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
|
|
|
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0x00,0x0F,0x00, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
|
|
|
|
};
|
|
|
|
|
2004-09-18 20:29:13 +00:00
|
|
|
void ScummEngine_v5::animateCursor() {
|
2004-08-22 23:38:00 +00:00
|
|
|
if (_cursor.animate) {
|
|
|
|
if (!(_cursor.animateIndex & 0x1)) {
|
|
|
|
setBuiltinCursor((_cursor.animateIndex >> 1) & 3);
|
|
|
|
}
|
|
|
|
_cursor.animateIndex++;
|
2004-01-04 14:35:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-09-18 20:29:13 +00:00
|
|
|
void ScummEngine_v6::setCursorHotspot(int x, int y) {
|
2004-08-22 23:38:00 +00:00
|
|
|
_cursor.hotspotX = x;
|
|
|
|
_cursor.hotspotY = y;
|
|
|
|
}
|
|
|
|
|
2004-09-18 20:29:13 +00:00
|
|
|
void ScummEngine_v6::setCursorTransparency(int a) {
|
2004-08-22 23:38:00 +00:00
|
|
|
int i, size;
|
|
|
|
|
|
|
|
size = _cursor.width * _cursor.height;
|
|
|
|
|
|
|
|
for (i = 0; i < size; i++)
|
|
|
|
if (_grabbedCursor[i] == (byte)a)
|
|
|
|
_grabbedCursor[i] = 0xFF;
|
|
|
|
|
|
|
|
updateCursor();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine::updateCursor() {
|
2009-06-05 06:41:04 +00:00
|
|
|
int transColor = (_game.heversion >= 80) ? 5 : 255;
|
2009-08-21 18:16:37 +00:00
|
|
|
#ifdef USE_RGB_COLOR
|
2011-06-15 20:01:24 +00:00
|
|
|
Graphics::PixelFormat format = _system->getScreenFormat();
|
|
|
|
CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
|
|
|
|
_cursor.hotspotX, _cursor.hotspotY,
|
|
|
|
(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
|
|
|
|
(_game.heversion == 70 ? 2 : 1),
|
|
|
|
&format);
|
|
|
|
#else
|
2009-06-11 05:56:00 +00:00
|
|
|
CursorMan.replaceCursor(_grabbedCursor, _cursor.width, _cursor.height,
|
|
|
|
_cursor.hotspotX, _cursor.hotspotY,
|
|
|
|
(_game.platform == Common::kPlatformNES ? _grabbedCursor[63] : transColor),
|
|
|
|
(_game.heversion == 70 ? 2 : 1));
|
2009-06-24 06:44:30 +00:00
|
|
|
#endif
|
2004-08-22 23:38:00 +00:00
|
|
|
}
|
|
|
|
|
2004-09-18 20:29:13 +00:00
|
|
|
void ScummEngine_v6::grabCursor(int x, int y, int w, int h) {
|
2004-01-04 14:35:46 +00:00
|
|
|
VirtScreen *vs = findVirtScreen(y);
|
|
|
|
|
|
|
|
if (vs == NULL) {
|
2005-08-14 02:04:26 +00:00
|
|
|
debug(0, "grabCursor: invalid Y %d", y);
|
2004-01-04 14:35:46 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2004-08-22 23:38:00 +00:00
|
|
|
setCursorFromBuffer((byte *)vs->pixels + (y - vs->topline) * vs->pitch + x, w, h, vs->pitch);
|
2004-01-04 14:35:46 +00:00
|
|
|
}
|
|
|
|
|
2005-07-19 17:53:55 +00:00
|
|
|
void ScummEngine_v6::setDefaultCursor() {
|
|
|
|
setCursorHotspot(7, 6);
|
|
|
|
setCursorFromBuffer(default_v6_cursor, 16, 13, 16);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine::setCursorFromBuffer(const byte *ptr, int width, int height, int pitch) {
|
2004-01-04 14:35:46 +00:00
|
|
|
uint size;
|
|
|
|
byte *dst;
|
|
|
|
|
2009-09-25 09:13:33 +00:00
|
|
|
size = width * height * _bytesPerPixel;
|
2004-01-04 14:35:46 +00:00
|
|
|
if (size > sizeof(_grabbedCursor))
|
|
|
|
error("grabCursor: grabbed cursor too big");
|
|
|
|
|
|
|
|
_cursor.width = width;
|
|
|
|
_cursor.height = height;
|
|
|
|
_cursor.animate = 0;
|
|
|
|
|
|
|
|
dst = _grabbedCursor;
|
|
|
|
for (; height; height--) {
|
2009-09-25 09:13:33 +00:00
|
|
|
memcpy(dst, ptr, width * _bytesPerPixel);
|
|
|
|
dst += width * _bytesPerPixel;
|
2004-08-23 00:41:43 +00:00
|
|
|
ptr += pitch;
|
2004-01-04 14:35:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
updateCursor();
|
|
|
|
}
|
|
|
|
|
2004-09-21 01:00:30 +00:00
|
|
|
void ScummEngine_v70he::setCursorFromImg(uint img, uint room, uint imgindex) {
|
2005-05-18 15:57:16 +00:00
|
|
|
_resExtractor->setCursor(img);
|
2004-09-18 22:26:19 +00:00
|
|
|
}
|
|
|
|
|
2006-04-03 11:35:02 +00:00
|
|
|
void ScummEngine_v70he::setDefaultCursor() {
|
2005-04-20 03:13:06 +00:00
|
|
|
const uint16 *src;
|
|
|
|
int i, j;
|
2011-02-13 19:10:34 +00:00
|
|
|
static const byte palette[] = {0, 0, 0,
|
|
|
|
0xff, 0xff, 0xff,
|
|
|
|
0, 0, 0, };
|
2010-01-25 01:39:44 +00:00
|
|
|
|
2011-08-16 06:44:29 +00:00
|
|
|
|
|
|
|
memset(_grabbedCursor, 5, sizeof(_grabbedCursor));
|
2005-04-20 03:13:06 +00:00
|
|
|
|
|
|
|
_cursor.hotspotX = _cursor.hotspotY = 2;
|
|
|
|
src = default_he_cursor;
|
|
|
|
|
|
|
|
_cursor.width = 32;
|
|
|
|
_cursor.height = 32;
|
|
|
|
|
|
|
|
for (i = 0; i < 32; i++) {
|
2008-01-27 15:10:56 +00:00
|
|
|
int p = *src;
|
2005-04-20 03:13:06 +00:00
|
|
|
for (j = 0; j < 32; j++) {
|
2008-01-27 15:10:56 +00:00
|
|
|
switch ((p & (0x3 << 14)) >> 14) {
|
|
|
|
case 1:
|
2011-08-16 06:44:29 +00:00
|
|
|
_grabbedCursor[32 * i + j] = 0xfe;
|
2008-01-27 15:10:56 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2011-08-16 06:44:29 +00:00
|
|
|
_grabbedCursor[32 * i + j] = 0xfd;
|
2008-01-27 15:10:56 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
p <<= 2;
|
|
|
|
|
|
|
|
if ((j + 1) % 8 == 0)
|
|
|
|
p = *(++src);
|
2005-04-20 03:13:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-16 06:44:29 +00:00
|
|
|
// Since white color position is not guaranteed
|
|
|
|
// we setup our own palette if supported by backend
|
|
|
|
CursorMan.disableCursorPalette(false);
|
|
|
|
CursorMan.replaceCursorPalette(palette, 0xfd, 3);
|
2005-04-20 03:13:06 +00:00
|
|
|
|
|
|
|
updateCursor();
|
|
|
|
}
|
|
|
|
|
2011-08-16 05:23:02 +00:00
|
|
|
#ifdef ENABLE_HE
|
2011-08-16 06:44:29 +00:00
|
|
|
void ScummEngine_v80he::setDefaultCursor() {
|
|
|
|
// v80+ games use the default Windows cursor instead of the usual
|
|
|
|
// default HE cursor.
|
|
|
|
Graphics::Cursor *cursor = Graphics::makeDefaultWinCursor();
|
2011-08-16 05:23:02 +00:00
|
|
|
|
2011-08-16 06:44:29 +00:00
|
|
|
// Clear the cursor
|
|
|
|
if (_bytesPerPixel == 2) {
|
2011-08-16 05:23:02 +00:00
|
|
|
for (int i = 0; i < 1024; i++)
|
|
|
|
WRITE_UINT16(_grabbedCursor + i * 2, 5);
|
2011-08-16 06:44:29 +00:00
|
|
|
} else {
|
|
|
|
memset(_grabbedCursor, 5, sizeof(_grabbedCursor));
|
|
|
|
}
|
2011-08-16 05:23:02 +00:00
|
|
|
|
2011-08-16 06:44:29 +00:00
|
|
|
_cursor.width = cursor->getWidth();
|
|
|
|
_cursor.height = cursor->getHeight();
|
|
|
|
_cursor.hotspotX = cursor->getHotspotX();
|
|
|
|
_cursor.hotspotY = cursor->getHotspotY();
|
2011-08-16 05:23:02 +00:00
|
|
|
|
2011-08-16 06:44:29 +00:00
|
|
|
const byte *surface = cursor->getSurface();
|
|
|
|
const byte *palette = cursor->getPalette();
|
2011-08-16 05:23:02 +00:00
|
|
|
|
2011-08-16 06:44:29 +00:00
|
|
|
for (uint16 y = 0; y < _cursor.height; y++) {
|
|
|
|
for (uint16 x = 0; x < _cursor.width; x++) {
|
|
|
|
byte pixel = *surface++;
|
|
|
|
|
|
|
|
if (pixel != cursor->getKeyColor()) {
|
|
|
|
pixel -= cursor->getPaletteStartIndex();
|
2011-08-16 05:23:02 +00:00
|
|
|
|
2011-08-16 06:44:29 +00:00
|
|
|
if (_bytesPerPixel == 2)
|
|
|
|
WRITE_UINT16(_grabbedCursor + (y * _cursor.width + x) * 2, get16BitColor(palette[pixel * 3], palette[pixel * 3 + 1], palette[pixel * 3 + 2]));
|
|
|
|
else
|
|
|
|
_grabbedCursor[y * _cursor.width + x] = (pixel == 0) ? 0xfd : 0xfe;
|
2011-08-16 05:23:02 +00:00
|
|
|
}
|
|
|
|
}
|
2011-08-16 06:44:29 +00:00
|
|
|
}
|
2011-08-16 05:23:02 +00:00
|
|
|
|
2011-08-18 04:21:13 +00:00
|
|
|
if (_bytesPerPixel == 1) {
|
|
|
|
// Since white color position is not guaranteed
|
|
|
|
// we setup our own palette if supported by backend
|
|
|
|
CursorMan.disableCursorPalette(false);
|
|
|
|
CursorMan.replaceCursorPalette(palette, 0xfd, cursor->getPaletteCount());
|
|
|
|
}
|
2011-08-16 05:23:02 +00:00
|
|
|
|
2011-08-18 04:21:13 +00:00
|
|
|
delete cursor;
|
2011-08-16 06:44:29 +00:00
|
|
|
|
|
|
|
updateCursor();
|
2011-08-16 05:23:02 +00:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-08-22 23:38:00 +00:00
|
|
|
void ScummEngine_v6::setCursorFromImg(uint img, uint room, uint imgindex) {
|
|
|
|
int w, h;
|
|
|
|
const byte *dataptr, *bomp;
|
|
|
|
uint32 size;
|
|
|
|
FindObjectInRoom foir;
|
2005-04-17 23:19:16 +00:00
|
|
|
const ImageHeader *imhd;
|
2004-08-22 23:38:00 +00:00
|
|
|
|
|
|
|
if (room == (uint) - 1)
|
|
|
|
room = getObjectRoom(img);
|
|
|
|
|
|
|
|
findObjectInRoom(&foir, foCodeHeader | foImageHeader | foCheckAlreadyLoaded, img, room);
|
2011-04-12 14:53:15 +00:00
|
|
|
imhd = (const ImageHeader *)findResourceData(MKTAG('I','M','H','D'), foir.obim);
|
2004-08-22 23:38:00 +00:00
|
|
|
|
2006-02-20 16:51:30 +00:00
|
|
|
if (_game.version == 8) {
|
2005-04-17 23:19:16 +00:00
|
|
|
setCursorHotspot(READ_LE_UINT32(&imhd->v8.hotspot[0].x),
|
|
|
|
READ_LE_UINT32(&imhd->v8.hotspot[0].y));
|
|
|
|
w = READ_LE_UINT32(&imhd->v8.width) / 8;
|
|
|
|
h = READ_LE_UINT32(&imhd->v8.height) / 8;
|
2006-02-20 16:51:30 +00:00
|
|
|
} else if (_game.version == 7) {
|
2005-04-17 23:19:16 +00:00
|
|
|
setCursorHotspot(READ_LE_UINT16(&imhd->v7.hotspot[0].x),
|
|
|
|
READ_LE_UINT16(&imhd->v7.hotspot[0].y));
|
|
|
|
w = READ_LE_UINT16(&imhd->v7.width) / 8;
|
|
|
|
h = READ_LE_UINT16(&imhd->v7.height) / 8;
|
2004-08-22 23:38:00 +00:00
|
|
|
} else {
|
2006-02-20 16:51:30 +00:00
|
|
|
if (_game.heversion == 0) {
|
2005-04-17 23:19:16 +00:00
|
|
|
setCursorHotspot(READ_LE_UINT16(&imhd->old.hotspot[0].x),
|
2008-01-28 00:14:17 +00:00
|
|
|
READ_LE_UINT16(&imhd->old.hotspot[0].y));
|
2005-04-20 01:33:44 +00:00
|
|
|
}
|
2004-08-22 23:38:00 +00:00
|
|
|
w = READ_LE_UINT16(&foir.cdhd->v6.w) / 8;
|
|
|
|
h = READ_LE_UINT16(&foir.cdhd->v6.h) / 8;
|
|
|
|
}
|
|
|
|
|
|
|
|
dataptr = getObjectImage(foir.obim, imgindex);
|
|
|
|
assert(dataptr);
|
2006-02-20 16:51:30 +00:00
|
|
|
if (_game.version == 8) {
|
2004-08-22 23:38:00 +00:00
|
|
|
bomp = dataptr;
|
|
|
|
} else {
|
|
|
|
size = READ_BE_UINT32(dataptr + 4);
|
|
|
|
if (size > sizeof(_grabbedCursor))
|
|
|
|
error("setCursorFromImg: Cursor image too large");
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2011-04-12 14:53:15 +00:00
|
|
|
bomp = findResource(MKTAG('B','O','M','P'), dataptr);
|
2004-08-22 23:38:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (bomp != NULL)
|
|
|
|
useBompCursor(bomp, w, h);
|
|
|
|
else
|
|
|
|
useIm01Cursor(dataptr, w, h);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScummEngine_v6::useIm01Cursor(const byte *im, int w, int h) {
|
2007-09-08 11:15:27 +00:00
|
|
|
VirtScreen *vs = &_virtscr[kMainVirtScreen];
|
2004-01-04 14:35:46 +00:00
|
|
|
byte *buf, *dst;
|
|
|
|
const byte *src;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
w *= 8;
|
|
|
|
h *= 8;
|
|
|
|
|
2004-08-14 19:42:00 +00:00
|
|
|
// Backup the screen content
|
|
|
|
dst = buf = (byte *)malloc(w * h);
|
|
|
|
src = vs->getPixels(0, 0);
|
2004-01-04 14:35:46 +00:00
|
|
|
|
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
memcpy(dst, src, w);
|
|
|
|
dst += w;
|
2004-08-14 19:42:00 +00:00
|
|
|
src += vs->pitch;
|
2004-01-04 14:35:46 +00:00
|
|
|
}
|
|
|
|
|
2004-08-14 19:42:00 +00:00
|
|
|
// Do some drawing
|
2004-01-04 14:35:46 +00:00
|
|
|
drawBox(0, 0, w - 1, h - 1, 0xFF);
|
|
|
|
|
2004-01-06 11:47:34 +00:00
|
|
|
vs->hasTwoBuffers = false;
|
2006-09-17 20:22:47 +00:00
|
|
|
_gdi->disableZBuffer();
|
|
|
|
_gdi->drawBitmap(im, vs, _screenStartStrip, 0, w, h, 0, w / 8, 0);
|
2004-01-06 11:47:34 +00:00
|
|
|
vs->hasTwoBuffers = true;
|
2006-09-17 20:22:47 +00:00
|
|
|
_gdi->enableZBuffer();
|
2004-01-04 14:35:46 +00:00
|
|
|
|
2004-08-14 19:42:00 +00:00
|
|
|
// Grab the data we just drew and setup the cursor with it
|
2004-08-22 23:38:00 +00:00
|
|
|
setCursorFromBuffer(vs->getPixels(0, 0), w, h, vs->pitch);
|
2004-01-04 14:35:46 +00:00
|
|
|
|
2004-08-14 19:42:00 +00:00
|
|
|
// Restore the screen content
|
2004-01-04 14:35:46 +00:00
|
|
|
src = buf;
|
2004-08-14 19:42:00 +00:00
|
|
|
dst = vs->getPixels(0, 0);
|
2004-01-04 14:35:46 +00:00
|
|
|
|
|
|
|
for (i = 0; i < h; i++) {
|
|
|
|
memcpy(dst, src, w);
|
2004-08-14 19:42:00 +00:00
|
|
|
dst += vs->pitch;
|
2004-01-04 14:35:46 +00:00
|
|
|
src += w;
|
|
|
|
}
|
|
|
|
|
|
|
|
free(buf);
|
|
|
|
}
|
|
|
|
|
2004-08-22 23:38:00 +00:00
|
|
|
void ScummEngine_v6::useBompCursor(const byte *im, int width, int height) {
|
2004-01-04 14:35:46 +00:00
|
|
|
uint size;
|
|
|
|
|
|
|
|
width *= 8;
|
|
|
|
height *= 8;
|
|
|
|
|
|
|
|
size = width * height;
|
|
|
|
if (size > sizeof(_grabbedCursor))
|
|
|
|
error("useBompCursor: cursor too big (%d)", size);
|
|
|
|
|
|
|
|
_cursor.width = width;
|
|
|
|
_cursor.height = height;
|
|
|
|
_cursor.animate = 0;
|
|
|
|
|
|
|
|
// Skip the header
|
2006-02-20 16:51:30 +00:00
|
|
|
if (_game.version == 8) {
|
2004-01-04 14:35:46 +00:00
|
|
|
im += 16;
|
|
|
|
} else {
|
|
|
|
im += 18;
|
|
|
|
}
|
|
|
|
decompressBomp(_grabbedCursor, im, width, height);
|
|
|
|
|
|
|
|
updateCursor();
|
|
|
|
}
|
|
|
|
|
2004-09-18 20:29:13 +00:00
|
|
|
void ScummEngine_v5::redefineBuiltinCursorFromChar(int index, int chr) {
|
2008-12-09 19:54:01 +00:00
|
|
|
// Cursor image in both Loom versions are based on images from charset.
|
|
|
|
// This function is *only* supported for Loom!
|
|
|
|
assert(_game.id == GID_LOOM);
|
2004-08-24 06:36:12 +00:00
|
|
|
|
2004-09-18 20:29:13 +00:00
|
|
|
assert(index >= 0 && index < 4);
|
2005-07-30 21:11:48 +00:00
|
|
|
|
|
|
|
// const int oldID = _charset->getCurID();
|
2004-08-23 08:37:55 +00:00
|
|
|
|
2009-11-22 10:56:49 +00:00
|
|
|
uint16 *ptr = _cursorImages[index];
|
|
|
|
int h;
|
2004-08-23 08:37:55 +00:00
|
|
|
|
2009-11-22 10:56:49 +00:00
|
|
|
if (index == 1 && _game.platform == Common::kPlatformPCEngine) {
|
|
|
|
uint16 cursorPCE[] = {
|
|
|
|
0x8000, 0xC000, 0xE000, 0xF000, 0xF800, 0xFC00, 0xFE00, 0xFF00,
|
2009-11-22 11:00:14 +00:00
|
|
|
0xF180, 0xF800, 0x8C00, 0x0C00, 0x0600, 0x0600, 0x0300, 0x0000
|
2009-11-22 10:56:49 +00:00
|
|
|
};
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2009-11-22 10:56:49 +00:00
|
|
|
for (h = 0; h < ARRAYSIZE(cursorPCE); h++) {
|
|
|
|
*ptr++ = cursorPCE[h];
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (_game.version == 3) {
|
|
|
|
_charset->setCurID(0);
|
|
|
|
} else if (_game.version >= 4) {
|
|
|
|
_charset->setCurID(1);
|
|
|
|
}
|
2004-08-23 08:37:55 +00:00
|
|
|
|
2009-11-22 10:56:49 +00:00
|
|
|
Graphics::Surface s;
|
|
|
|
byte buf[16*17];
|
|
|
|
memset(buf, 123, 16*17);
|
|
|
|
s.pixels = buf;
|
|
|
|
s.w = _charset->getCharWidth(chr);
|
|
|
|
s.h = _charset->getFontHeight();
|
|
|
|
s.pitch = s.w;
|
|
|
|
// s.h = 17 for FM-TOWNS Loom Japanese. Fixes bug #1166917
|
|
|
|
assert(s.w <= 16 && s.h <= 17);
|
2011-04-17 15:29:09 +00:00
|
|
|
s.format = Graphics::PixelFormat::createFormatCLUT8();
|
2009-11-22 10:56:49 +00:00
|
|
|
|
|
|
|
_charset->drawChar(chr, s, 0, 0);
|
|
|
|
|
|
|
|
memset(ptr, 0, 17 * sizeof(uint16));
|
|
|
|
for (h = 0; h < s.h; h++) {
|
|
|
|
for (int w = 0; w < s.w; w++) {
|
|
|
|
if (buf[s.pitch * h + w] != 123)
|
|
|
|
*ptr |= 1 << (15 - w);
|
|
|
|
}
|
|
|
|
ptr++;
|
2004-08-23 08:37:55 +00:00
|
|
|
}
|
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2004-08-23 08:37:55 +00:00
|
|
|
// _charset->setCurID(oldID);
|
|
|
|
}
|
|
|
|
|
2004-09-18 20:29:13 +00:00
|
|
|
void ScummEngine_v5::redefineBuiltinCursorHotspot(int index, int x, int y) {
|
2004-08-24 06:36:12 +00:00
|
|
|
// Cursor image in both Looms are based on images from charset.
|
2008-12-09 19:54:01 +00:00
|
|
|
// This function is *only* supported for Loom!
|
|
|
|
assert(_game.id == GID_LOOM);
|
2004-08-24 06:36:12 +00:00
|
|
|
|
2004-09-18 20:29:13 +00:00
|
|
|
assert(index >= 0 && index < 4);
|
2004-08-24 06:36:12 +00:00
|
|
|
|
2004-09-18 20:29:13 +00:00
|
|
|
_cursorHotspots[index * 2] = x;
|
|
|
|
_cursorHotspots[index * 2 + 1] = y;
|
2004-08-24 06:36:12 +00:00
|
|
|
}
|
|
|
|
|
2006-09-18 21:31:59 +00:00
|
|
|
void ScummEngine_v2::setBuiltinCursor(int idx) {
|
2004-01-04 14:35:46 +00:00
|
|
|
int i, j;
|
|
|
|
byte color;
|
|
|
|
|
|
|
|
memset(_grabbedCursor, 0xFF, sizeof(_grabbedCursor));
|
|
|
|
|
2006-05-29 12:45:11 +00:00
|
|
|
if (_game.version <= 1)
|
2004-01-04 14:35:46 +00:00
|
|
|
color = default_v1_cursor_colors[idx];
|
|
|
|
else
|
|
|
|
color = default_cursor_colors[idx];
|
|
|
|
|
2006-02-20 16:51:30 +00:00
|
|
|
if (_game.platform == Common::kPlatformNES) {
|
2005-03-17 02:55:20 +00:00
|
|
|
_cursor.width = 8;
|
|
|
|
_cursor.height = 8;
|
|
|
|
_cursor.hotspotX = 0;
|
|
|
|
_cursor.hotspotY = 0;
|
|
|
|
|
|
|
|
byte *dst = _grabbedCursor;
|
2005-03-24 03:22:32 +00:00
|
|
|
byte *src = &_NESPatTable[0][0xfa * 16];
|
|
|
|
byte *palette = _NESPalette[1];
|
2005-03-17 02:55:20 +00:00
|
|
|
|
|
|
|
for (i = 0; i < 8; i++) {
|
|
|
|
byte c0 = src[i];
|
|
|
|
byte c1 = src[i + 8];
|
|
|
|
for (j = 0; j < 8; j++)
|
2005-03-17 03:20:25 +00:00
|
|
|
*dst++ = palette[((c0 >> (7 - j)) & 1) | (((c1 >> (7 - j)) & 1) << 1) | ((idx == 3) ? 4 : 0)];
|
2005-03-17 02:55:20 +00:00
|
|
|
}
|
|
|
|
|
2006-09-18 21:31:59 +00:00
|
|
|
} else if (_game.platform == Common::kPlatformAmiga) {
|
2005-03-23 00:25:08 +00:00
|
|
|
_cursor.width = 15;
|
|
|
|
_cursor.height = 15;
|
|
|
|
_cursor.hotspotX = 7;
|
|
|
|
_cursor.hotspotY = 7;
|
|
|
|
|
|
|
|
byte *hotspot = _grabbedCursor + _cursor.hotspotY * _cursor.width + _cursor.hotspotX;
|
|
|
|
|
|
|
|
// Crosshair, symmetric
|
|
|
|
// TODO: Instead of setting this up via code, we should simply extend
|
|
|
|
// default_cursor_images to contain this shape.
|
|
|
|
for (i = 0; i < 5; i++) {
|
|
|
|
*(hotspot - 3 - i) = color;
|
|
|
|
*(hotspot + 3 + i) = color;
|
|
|
|
*(hotspot - _cursor.width * (3 + i)) = color;
|
|
|
|
*(hotspot + _cursor.width * (3 + i)) = color;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Arrow heads, diagonal lines
|
|
|
|
for (i = 1; i <= 2; i++) {
|
|
|
|
*(hotspot - _cursor.width * i - (3 + i)) = color;
|
|
|
|
*(hotspot + _cursor.width * i - (3 + i)) = color;
|
|
|
|
*(hotspot - _cursor.width * i + (3 + i)) = color;
|
|
|
|
*(hotspot + _cursor.width * i + (3 + i)) = color;
|
|
|
|
*(hotspot - _cursor.width * (3 + i) - i) = color;
|
|
|
|
*(hotspot + _cursor.width * (3 + i) - i) = color;
|
|
|
|
*(hotspot - _cursor.width * (3 + i) + i) = color;
|
|
|
|
*(hotspot + _cursor.width * (3 + i) + i) = color;
|
|
|
|
}
|
2006-09-18 21:31:59 +00:00
|
|
|
} else {
|
2004-01-04 14:35:46 +00:00
|
|
|
_cursor.width = 23;
|
|
|
|
_cursor.height = 21;
|
|
|
|
_cursor.hotspotX = 11;
|
|
|
|
_cursor.hotspotY = 10;
|
|
|
|
|
|
|
|
byte *hotspot = _grabbedCursor + _cursor.hotspotY * _cursor.width + _cursor.hotspotX;
|
|
|
|
|
|
|
|
// Crosshair, slightly assymetric
|
2004-06-27 13:32:50 +00:00
|
|
|
// TODO: Instead of setting this up via code, we should simply extend
|
|
|
|
// default_cursor_images to contain this shape.
|
2004-01-04 14:35:46 +00:00
|
|
|
|
|
|
|
for (i = 0; i < 7; i++) {
|
|
|
|
*(hotspot - 5 - i) = color;
|
|
|
|
*(hotspot + 5 + i) = color;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < 8; i++) {
|
|
|
|
*(hotspot - _cursor.width * (3 + i)) = color;
|
|
|
|
*(hotspot + _cursor.width * (3 + i)) = color;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Arrow heads, diagonal lines
|
|
|
|
|
|
|
|
for (i = 1; i <= 3; i++) {
|
|
|
|
*(hotspot - _cursor.width * i - 5 - i) = color;
|
|
|
|
*(hotspot + _cursor.width * i - 5 - i) = color;
|
|
|
|
*(hotspot - _cursor.width * i + 5 + i) = color;
|
|
|
|
*(hotspot + _cursor.width * i + 5 + i) = color;
|
|
|
|
*(hotspot - _cursor.width * (i + 3) - i) = color;
|
|
|
|
*(hotspot - _cursor.width * (i + 3) + i) = color;
|
|
|
|
*(hotspot + _cursor.width * (i + 3) - i) = color;
|
|
|
|
*(hotspot + _cursor.width * (i + 3) + i) = color;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Final touches
|
|
|
|
|
|
|
|
*(hotspot - _cursor.width - 7) = color;
|
|
|
|
*(hotspot - _cursor.width + 7) = color;
|
|
|
|
*(hotspot + _cursor.width - 7) = color;
|
|
|
|
*(hotspot + _cursor.width + 7) = color;
|
|
|
|
*(hotspot - (_cursor.width * 5) - 1) = color;
|
|
|
|
*(hotspot - (_cursor.width * 5) + 1) = color;
|
|
|
|
*(hotspot + (_cursor.width * 5) - 1) = color;
|
|
|
|
*(hotspot + (_cursor.width * 5) + 1) = color;
|
2006-09-18 21:31:59 +00:00
|
|
|
}
|
2005-07-30 21:11:48 +00:00
|
|
|
|
2006-09-18 21:31:59 +00:00
|
|
|
updateCursor();
|
|
|
|
}
|
|
|
|
|
2008-01-02 18:44:20 +00:00
|
|
|
void ScummEngine_v5::resetCursors() {
|
|
|
|
static const uint16 default_cursor_images[4][16] = {
|
|
|
|
/* cross-hair */
|
|
|
|
{ 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0000, 0x7e3f,
|
|
|
|
0x0000, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0080, 0x0000 },
|
|
|
|
/* hourglass */
|
|
|
|
{ 0x0000, 0x7ffe, 0x6006, 0x300c, 0x1818, 0x0c30, 0x0660, 0x03c0,
|
|
|
|
0x0660, 0x0c30, 0x1998, 0x33cc, 0x67e6, 0x7ffe, 0x0000, 0x0000 },
|
|
|
|
/* arrow */
|
|
|
|
{ 0x0000, 0x4000, 0x6000, 0x7000, 0x7800, 0x7c00, 0x7e00, 0x7f00,
|
|
|
|
0x7f80, 0x78c0, 0x7c00, 0x4600, 0x0600, 0x0300, 0x0300, 0x0180 },
|
|
|
|
/* hand */
|
|
|
|
{ 0x1e00, 0x1200, 0x1200, 0x1200, 0x1200, 0x13ff, 0x1249, 0x1249,
|
|
|
|
0xf249, 0x9001, 0x9001, 0x9001, 0x8001, 0x8001, 0x8001, 0xffff },
|
|
|
|
};
|
|
|
|
|
|
|
|
static const byte default_cursor_hotspots[10] = {
|
|
|
|
8, 7, 8, 7, 1, 1, 5, 0,
|
|
|
|
8, 7, //zak256
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 4; i++) {
|
|
|
|
memcpy(_cursorImages[i], default_cursor_images[i], 32);
|
|
|
|
}
|
|
|
|
memcpy(_cursorHotspots, default_cursor_hotspots, 8);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2006-09-18 21:31:59 +00:00
|
|
|
void ScummEngine_v5::setBuiltinCursor(int idx) {
|
|
|
|
int i, j;
|
2009-11-22 08:55:36 +00:00
|
|
|
uint16 color;
|
2006-09-18 21:31:59 +00:00
|
|
|
const uint16 *src = _cursorImages[_currentCursor];
|
|
|
|
|
2011-06-15 20:01:24 +00:00
|
|
|
if (_outputPixelFormat.bytesPerPixel == 2) {
|
2009-11-22 08:55:36 +00:00
|
|
|
if (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine) {
|
|
|
|
byte r, g, b;
|
|
|
|
colorPCEToRGB(default_pce_cursor_colors[idx], &r, &g, &b);
|
|
|
|
color = get16BitColor(r, g, b);
|
2010-10-05 19:04:52 +00:00
|
|
|
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
|
SCUMM/FM-TOWNS: fix palette and other graphics issues
This commit should fix at least the following bugs/feature requests: #1032859, #1252088, #1055391, #1315968, #1315938, #1742106, #812891.
The FM-Towns version of Scumm games use a mixed graphics mode with 2 layers (one with 32767 colors and one with 16 colors). Among other things I have added a screen output class which emulates this dual layer approach which allows specific hardware effects like enabling and disabling layers (e.g. in the voodoo priestess scene in MI1).
Old savegames (saved before this update) will load, but you’ll encounter palette glitches in the verb/inventory screen, since the 16 color palette for layer 2 is not contained in your savegame. This will be true at least for version 5 games. Certain scene change actions (which require the verb/inventory part to be redrawn) might correct this (e.g. try looking at the treasure map in MI1 and closing it). Version 3 games should be okay, since they use a static text palette which is never changed and which will be reset after loading a savegame.
This update requires a USE_RGB_COLORS setting for proper operation. 8 bit users will get a warning that they’ll have to expect palette glitches . Apart from that the engine in 8 bit mode should not only still work okay, but also benefit from some of the other (non palette related) improvements (e.g. bug #1032859 should be fixed even in 8 bit mode).
Japanese font drawing hasn’t been improved much yet. This will be a separate task.
svn-id: r52966
2010-10-01 19:24:52 +00:00
|
|
|
} else if (_game.platform == Common::kPlatformFMTowns) {
|
|
|
|
byte *palEntry = &_textPalette[default_cursor_colors[idx] * 3];
|
|
|
|
color = get16BitColor(palEntry[0], palEntry[1], palEntry[2]);
|
2010-10-05 19:04:52 +00:00
|
|
|
#endif
|
2009-11-22 08:55:36 +00:00
|
|
|
} else {
|
|
|
|
color = _16BitPalette[default_cursor_colors[idx]];
|
|
|
|
}
|
|
|
|
|
2009-10-26 09:11:18 +00:00
|
|
|
for (i = 0; i < 1024; i++)
|
|
|
|
WRITE_UINT16(_grabbedCursor + i * 2, 0xFF);
|
|
|
|
} else {
|
2011-08-26 16:27:21 +00:00
|
|
|
// Indy4 Amiga uses its own color set for the cursor image.
|
|
|
|
// This is patchwork code to make the cursor flash in correct colors.
|
|
|
|
if (_game.platform == Common::kPlatformAmiga && _game.id == GID_INDY4) {
|
|
|
|
static const uint8 indy4AmigaColors[4] = {
|
|
|
|
252, 252, 253, 254
|
|
|
|
};
|
|
|
|
color = indy4AmigaColors[idx];
|
|
|
|
} else {
|
|
|
|
color = default_cursor_colors[idx];
|
|
|
|
}
|
2009-10-26 09:11:18 +00:00
|
|
|
memset(_grabbedCursor, 0xFF, sizeof(_grabbedCursor));
|
|
|
|
}
|
2004-01-04 14:35:46 +00:00
|
|
|
|
SCUMM/FM-TOWNS: fix palette and other graphics issues
This commit should fix at least the following bugs/feature requests: #1032859, #1252088, #1055391, #1315968, #1315938, #1742106, #812891.
The FM-Towns version of Scumm games use a mixed graphics mode with 2 layers (one with 32767 colors and one with 16 colors). Among other things I have added a screen output class which emulates this dual layer approach which allows specific hardware effects like enabling and disabling layers (e.g. in the voodoo priestess scene in MI1).
Old savegames (saved before this update) will load, but you’ll encounter palette glitches in the verb/inventory screen, since the 16 color palette for layer 2 is not contained in your savegame. This will be true at least for version 5 games. Certain scene change actions (which require the verb/inventory part to be redrawn) might correct this (e.g. try looking at the treasure map in MI1 and closing it). Version 3 games should be okay, since they use a static text palette which is never changed and which will be reset after loading a savegame.
This update requires a USE_RGB_COLORS setting for proper operation. 8 bit users will get a warning that they’ll have to expect palette glitches . Apart from that the engine in 8 bit mode should not only still work okay, but also benefit from some of the other (non palette related) improvements (e.g. bug #1032859 should be fixed even in 8 bit mode).
Japanese font drawing hasn’t been improved much yet. This will be a separate task.
svn-id: r52966
2010-10-01 19:24:52 +00:00
|
|
|
_cursor.hotspotX = _cursorHotspots[2 * _currentCursor] * _textSurfaceMultiplier;
|
|
|
|
_cursor.hotspotY = _cursorHotspots[2 * _currentCursor + 1] * _textSurfaceMultiplier;
|
|
|
|
_cursor.width = 16 * _textSurfaceMultiplier;
|
|
|
|
_cursor.height = 16 * _textSurfaceMultiplier;
|
|
|
|
|
2011-06-15 20:01:24 +00:00
|
|
|
int scl = _outputPixelFormat.bytesPerPixel * _textSurfaceMultiplier;
|
2004-01-04 14:35:46 +00:00
|
|
|
|
2006-09-18 21:31:59 +00:00
|
|
|
for (i = 0; i < 16; i++) {
|
|
|
|
for (j = 0; j < 16; j++) {
|
2009-10-26 09:11:18 +00:00
|
|
|
if (src[i] & (1 << j)) {
|
SCUMM/FM-TOWNS: fix palette and other graphics issues
This commit should fix at least the following bugs/feature requests: #1032859, #1252088, #1055391, #1315968, #1315938, #1742106, #812891.
The FM-Towns version of Scumm games use a mixed graphics mode with 2 layers (one with 32767 colors and one with 16 colors). Among other things I have added a screen output class which emulates this dual layer approach which allows specific hardware effects like enabling and disabling layers (e.g. in the voodoo priestess scene in MI1).
Old savegames (saved before this update) will load, but you’ll encounter palette glitches in the verb/inventory screen, since the 16 color palette for layer 2 is not contained in your savegame. This will be true at least for version 5 games. Certain scene change actions (which require the verb/inventory part to be redrawn) might correct this (e.g. try looking at the treasure map in MI1 and closing it). Version 3 games should be okay, since they use a static text palette which is never changed and which will be reset after loading a savegame.
This update requires a USE_RGB_COLORS setting for proper operation. 8 bit users will get a warning that they’ll have to expect palette glitches . Apart from that the engine in 8 bit mode should not only still work okay, but also benefit from some of the other (non palette related) improvements (e.g. bug #1032859 should be fixed even in 8 bit mode).
Japanese font drawing hasn’t been improved much yet. This will be a separate task.
svn-id: r52966
2010-10-01 19:24:52 +00:00
|
|
|
byte *dst1 = _grabbedCursor + 16 * scl * i * _textSurfaceMultiplier + (15 - j) * scl;
|
|
|
|
byte *dst2 = (_textSurfaceMultiplier == 2) ? dst1 + 16 * scl : dst1;
|
2011-06-15 20:01:24 +00:00
|
|
|
if (_outputPixelFormat.bytesPerPixel == 2) {
|
2010-10-03 20:29:22 +00:00
|
|
|
for (int b = 0; b < scl; b += 2) {
|
2012-02-15 15:53:31 +00:00
|
|
|
*((uint16 *)dst1) = *((uint16 *)dst2) = color;
|
2010-10-03 20:29:22 +00:00
|
|
|
dst1 += 2;
|
|
|
|
dst2 += 2;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for (int b = 0; b < scl; b++)
|
|
|
|
*dst1++ = *dst2++ = color;
|
|
|
|
}
|
2009-10-26 09:11:18 +00:00
|
|
|
}
|
2004-01-04 14:35:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
updateCursor();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // End of namespace Scumm
|