Since lost/smaller use default windows cursor we setup our own

svn-id: r17705
This commit is contained in:
Eugene Sandulenko 2005-04-20 03:13:06 +00:00
parent f960d3006e
commit 89ca4bf716
4 changed files with 62 additions and 11 deletions

View file

@ -65,6 +65,17 @@ static const byte default_cursor_hotspots[10] = {
8, 7, //zak256
};
static const uint16 default_he_cursor[] = {
0x0000, 0x0000, 0x3800, 0x0000, 0x7e00, 0x0000, 0x5f80, 0x0000,
0x5fe0, 0x0000, 0x2ff8, 0x0000, 0x27fe, 0x0000, 0x17ff, 0x8000,
0x13ff, 0xe000, 0x09ff, 0xf000, 0x09ff, 0xf800, 0x04ff, 0xf800,
0x047f, 0xf000, 0x027f, 0xe000, 0x023f, 0xf000, 0x011f, 0xf800,
0x0111, 0xfc00, 0x0080, 0xfc00, 0x0084, 0x0c00, 0x004a, 0x0800,
0x0031, 0x1000, 0x0000, 0xe000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
};
ScummEngine_v5::ScummEngine_v5(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16])
: ScummEngine(detector, syst, gs, md5sum) {
@ -152,6 +163,38 @@ void ScummEngine_v70he::setCursorFromImg(uint img, uint room, uint imgindex) {
_win32ResExtractor->setCursor(img);
}
void ScummEngine_v90he::setDefaultCursor() {
const uint16 *src;
int i, j;
static byte palette[] = { 0xff, 0xff, 0xff, 0,
0, 0, 0, 0};
memset(_grabbedCursor, 0xFF, sizeof(_grabbedCursor));
_cursor.hotspotX = _cursor.hotspotY = 2;
src = default_he_cursor;
_cursor.width = 32;
_cursor.height = 32;
for (i = 0; i < 32; i++) {
for (j = 0; j < 32; j++) {
if (*src & (1 << (15 - (j % 16))))
_grabbedCursor[32 * i + j] = 0xfe;
if (j == 15)
src++;
}
src++;
}
// Since white color position is not guaranteed
// we setup our own palette if supported by backend
if (_system->hasFeature(OSystem::kFeatureCursorHasPalette))
_system->setCursorPalette(palette, 0xfe, 2);
updateCursor();
}
void ScummEngine_v6::setCursorFromImg(uint img, uint room, uint imgindex) {
int w, h;
const byte *dataptr, *bomp;

View file

@ -1068,6 +1068,8 @@ protected:
void spritesResetTables(bool refreshScreen);
void spriteAddImageToList(int spriteId, int imageNum, int *spriteIdptr);
void setDefaultCursor();
public:
void saveOrLoadSpriteData(Serializer *s, uint32 savegameVersion);
void spritesBlitToScreen();

View file

@ -314,7 +314,7 @@ static const ScummGameSettings scumm_settings[] = {
// these and later games can easily be identified by the .(a) file instead of a .he1
// and INIB chunk in the .he0
{"lost", "Pajama Sam's Lost & Found", GID_HEGAME, 6, 98, 61, MDT_NONE,
GF_USE_KEY | GF_NEW_COSTUMES | GF_MULTIPLE_VERSIONS, 0, 0},
GF_USE_KEY | GF_NEW_COSTUMES | GF_HE_CURSORLESS | GF_MULTIPLE_VERSIONS, 0, 0},
{"racedemo", "Putt-Putt Enters the Race (Demo)", GID_HEGAME, 6, 98, 61, MDT_NONE,
GF_USE_KEY | GF_NEW_COSTUMES | GF_MULTIPLE_VERSIONS, 0, 0},
{"puttrace", "Putt-Putt Enters the Race", GID_HEGAME, 6, 98, 61, MDT_NONE,
@ -333,7 +333,7 @@ static const ScummGameSettings scumm_settings[] = {
// Engine moved to c++
// Humongous Entertainment Scumm Version 9.9 ? Scummsys.99
{"smaller", "Pajama Sam's Lost & Found (Test)", GID_HEGAME, 6, 99, 61, MDT_NONE,
GF_USE_KEY | GF_NEW_COSTUMES, 0, 0},
GF_USE_KEY | GF_NEW_COSTUMES | GF_HE_CURSORLESS, 0, 0},
{"puttcircus", "Putt-Putt Joins the Circus", GID_HEGAME, 6, 99, 61, MDT_NONE,
GF_USE_KEY | GF_NEW_COSTUMES, 0, 0},
{"circdemo", "Putt-Putt Joins the Circus (Demo)", GID_HEGAME, 6, 99, 61, MDT_NONE,
@ -1670,6 +1670,9 @@ void ScummEngine_v90he::scummInit() {
spritesResetTables(0);
memset(&_wizParams, 0, sizeof(_wizParams));
if (_features & GF_HE_CURSORLESS)
setDefaultCursor();
}
void ScummEngine_v99he::scummInit() {

View file

@ -114,18 +114,21 @@ enum GameFeatures {
*/
GF_FEW_LOCALS = 1 << 11,
/** HE games without cursor resources */
GF_HE_CURSORLESS = 1 << 12,
/** Games with multiple versions */
GF_MULTIPLE_VERSIONS = 1 << 12,
GF_MULTIPLE_VERSIONS = 1 << 13,
GF_FMTOWNS = 1 << 13,
GF_AMIGA = 1 << 14,
GF_NES = 1 << 15,
GF_ATARI_ST = 1 << 16,
GF_MACINTOSH = 1 << 17,
GF_PC = 1 << 18,
GF_WINDOWS = 1 << 19,
GF_FMTOWNS = 1 << 14,
GF_AMIGA = 1 << 15,
GF_NES = 1 << 16,
GF_ATARI_ST = 1 << 17,
GF_MACINTOSH = 1 << 18,
GF_PC = 1 << 19,
GF_WINDOWS = 1 << 20,
GF_DEMO = 1 << 20
GF_DEMO = 1 << 21
};
/* SCUMM Debug Channels */