diff options
author | James Brown | 2002-07-04 15:48:17 +0000 |
---|---|---|
committer | James Brown | 2002-07-04 15:48:17 +0000 |
commit | e346e6c28ca9a59b0f3992f5c4e9abc8f9421f00 (patch) | |
tree | b71b1ad628a47002a684b72f20c21700ad6ef31d | |
parent | e8d21d7b575b1db02ba1238f4107c56fd3adbabe (diff) | |
download | scummvm-rg350-e346e6c28ca9a59b0f3992f5c4e9abc8f9421f00.tar.gz scummvm-rg350-e346e6c28ca9a59b0f3992f5c4e9abc8f9421f00.tar.bz2 scummvm-rg350-e346e6c28ca9a59b0f3992f5c4e9abc8f9421f00.zip |
Theres nothing to see here...
- Start of CMI support
svn-id: r4459
-rw-r--r-- | gameDetector.cpp | 2 | ||||
-rw-r--r-- | gui.cpp | 103 | ||||
-rw-r--r-- | gui.h | 15 | ||||
-rw-r--r-- | insane.cpp | 8 | ||||
-rw-r--r-- | resource.cpp | 65 | ||||
-rw-r--r-- | scumm.h | 12 |
6 files changed, 136 insertions, 69 deletions
diff --git a/gameDetector.cpp b/gameDetector.cpp index 5491e52263..e91095cd87 100644 --- a/gameDetector.cpp +++ b/gameDetector.cpp @@ -426,7 +426,7 @@ static const VersionSettings version_settings[] = { {"simon2win", "Simon the Sorcerer 2 for Windows", GID_SIMON_FIRST+3, 99, 99, 99, 0}, /* Scumm Version 8 */ -// {"curse", "The Curse of Monkey Island", GID_CMI, 8, 1, 0,}, + {"comi", "The Curse of Monkey Island", GID_CMI, 8, 1, 0, GF_NEW_OPCODES|GF_AFTER_V6|GF_AFTER_V7|GF_AFTER_V8}, {NULL, NULL} }; @@ -27,6 +27,9 @@ #include "guimaps.h" #include "config-file.h" +#define hline(x, y, x2, color) line(x, y, x2, y, color); +#define vline(x, y, y2, color) line(x, y, x, y2, color); + #ifdef _WIN32_WCE // Additional variables for WinCE specific GUI #include "gapi_keys.h" @@ -510,42 +513,19 @@ void Gui::widgetClear(const GuiWidget * wid) void Gui::widgetBorder(const GuiWidget * w) { - int x = w->_x, y = w->_y; - int x2 = x + w->_w - 1, y2 = y + w->_h - 1; - byte tmp; - - hline(x + 1, y, x2 - 1); - hline(x, y + 1, x2); - vline(x, y + 1, y2 - 1); - vline(x + 1, y, y2); - - tmp = _color; - _color = _shadowcolor; - - hline(x + 1, y2 - 1, x2); - hline(x + 1, y2, x2 - 1); - vline(x2, y + 1, y2 - 1); - vline(x2 - 1, y + 1, y2); - - _color = tmp; + box(w->_x, w->_y, w->_w, w->_h); } -void Gui::hline(int x, int y, int x2) -{ - moveto(x, y); - lineto(x2, y); -} +void Gui::box(int x, int y, int width, int height) { + hline(x + 1, y, x + width - 2, _color); + hline(x, y + 1, x + width - 1, _color); + vline(x, y + 1, y + height - 2, _color); + vline(x + 1, y, y + height - 1, _color); -void Gui::vline(int x, int y, int y2) -{ - moveto(x, y); - lineto(x, y2); -} - -void Gui::moveto(int x, int y) -{ - _curX = x; - _curY = y; + hline(x + 1, y + height - 2, x + width - 1, _shadowcolor); + hline(x + 1, y + height - 1, x + width - 2, _shadowcolor); + vline(x + width - 1, y + 1, y + height - 2, _shadowcolor); + vline(x + width - 2, y + 1, y + height - 1, _shadowcolor); } byte *Gui::getBasePtr(int x, int y) @@ -561,15 +541,10 @@ byte *Gui::getBasePtr(int x, int y) _s->_screenStartStrip * 8 + (_s->camera._cur.y - 100)*320; } -void Gui::lineto(int x, int y) +void Gui::line(int x, int y, int x2, int y2, byte color) { byte *ptr; - int x2 = _curX; - int y2 = _curY; - - _curX = x; - _curY = y; - + if (x2 < x) x2 ^= x ^= x2 ^= x; // Swap x2 and x @@ -584,13 +559,13 @@ void Gui::lineto(int x, int y) if (x == x2) { /* vertical line */ while (y++ <= y2) { - *ptr = _color; + *ptr = color; ptr += 320; } } else if (y == y2) { /* horizontal line */ while (x++ <= x2) { - *ptr++ = _color; + *ptr++ = color; } } } @@ -1192,3 +1167,47 @@ void Gui::launcher() _cur_page = 0; _dialog = LAUNCHER_DIALOG; } + + + + + + + + + + + + + + + + + + +/* +void Gui::loop() +{ + if (_active && !_inited) { + _inited = true; + _old_soundsPaused = _s->_soundsPaused; + _s->pauseSounds(true); + + // Backup old cursor + memcpy(_old_grabbedCursor, _s->_grabbedCursor, sizeof(_old_grabbedCursor)); + _old_cursorWidth = _s->_cursorWidth; + _old_cursorHeight = _s->_cursorHeight; + _old_cursorHotspotX = _s->_cursorHotspotX; + _old_cursorHotspotY = _s->_cursorHotspotY; + _old_cursor_mode = _s->_system->show_mouse(true); + + _s->_cursorAnimate++; + _s->gdi._cursorActive = 1; + } + _s->animateCursor(); + _s->getKeyInput(0); + + _s->drawDirtyScreenParts(); + _s->_mouseButStat = 0; +} +*/
\ No newline at end of file @@ -49,8 +49,7 @@ public: protected: Scumm *_s; const GuiWidget *_widgets[4]; - int _return_to; - int _curX, _curY; + int _return_to; VirtScreen *_vs; int _parentX, _parentY; bool _active; @@ -84,11 +83,13 @@ protected: // Drawing void draw(int start, int end); void draw(int item) { draw(item,-1); } - void drawWidget(const GuiWidget *w); - void moveto(int x, int y); - void lineto(int x, int y); - void hline(int x, int y, int x2); - void vline(int x, int y, int y2); + void drawWidget(const GuiWidget *w); + + void line(int x, int y, int x2, int y2, byte color); + void box(int x, int y, int width, int height); + + //void hline(int x, int y, int x2, byte color); + //void vline(int x, int y, int y2, byte color); void drawChar(const char str, int xx, int yy); void drawString(const char *str, int x, int y, int w, byte color, bool center); void widgetClear(const GuiWidget *w); diff --git a/insane.cpp b/insane.cpp index 475f299583..df91e0bb54 100644 --- a/insane.cpp +++ b/insane.cpp @@ -236,15 +236,15 @@ void SmushPlayer::parseIACT() { temp = (temp | _imusData[idx][0]) << 4; temp -= 0x8000; - buf[bpos++] = (temp >> 8) & 0xff; - buf[bpos++] = temp & 0xff; + buf[bpos++] = (byte)((temp >> 8) & 0xff); + buf[bpos++] = (byte)(temp & 0xff); temp = (_imusData[idx][1] & 0xf0) << 4; temp = (temp | _imusData[idx][2]) << 4; temp -= 0x8000; - buf[bpos++] = (temp >> 8) & 0xff; - buf[bpos++] = temp & 0xff; + buf[bpos++] = (byte)((temp >> 8) & 0xff); + buf[bpos++] = (byte)(temp & 0xff); _imusPos[idx] = 0; } } diff --git a/resource.cpp b/resource.cpp index 298a7f0a7b..f05dbb4f56 100644 --- a/resource.cpp +++ b/resource.cpp @@ -263,14 +263,24 @@ void Scumm::readIndexFile() break; case MKID('DOBJ'): - num = fileReadWordLE(); + if (_features & GF_AFTER_V8) + num = fileReadDwordLE(); + else + num = fileReadWordLE(); assert(num == _numGlobalObjects); - if (_features & GF_AFTER_V7) { + if (_features & GF_AFTER_V8) { /* FIXME: Not sure.. */ + for (i=0; i<num; i++) { + fileSeek(_fileHandle, 40, SEEK_CUR); + _objectStateTable[i] = fileReadByte(); + _objectRoomTable[i] = fileReadByte(); + _classData[i] = fileReadDwordLE(); + } + memset(_objectOwnerTable, 0xFF, num); + } else if (_features & GF_AFTER_V7) { fileRead(_fileHandle, _objectStateTable, num); fileRead(_fileHandle, _objectRoomTable, num); memset(_objectOwnerTable, 0xFF, num); - } else { fileRead(_fileHandle, _objectOwnerTable, num); for (i = 0; i < num; i++) { @@ -278,15 +288,16 @@ void Scumm::readIndexFile() _objectOwnerTable[i] &= OF_OWNER_MASK; } } - fileRead(_fileHandle, _classData, num * sizeof(uint32)); - /* This code should be here. Otherwise the flags will be swapped for big endian computers. - * If it doesn't work with this code, something else is wrong */ + if (!(_features & GF_AFTER_V8)) { + fileRead(_fileHandle, _classData, num * sizeof(uint32)); + + // Swap flag endian where applicable #if defined(SCUMM_BIG_ENDIAN) - for (i = 0; i != num; i++) { - _classData[i] = FROM_LE_32(_classData[i]); - } + for (i = 0; i != num; i++) + _classData[i] = FROM_LE_32(_classData[i]); #endif + } break; case MKID('RNAM'): @@ -298,6 +309,10 @@ void Scumm::readIndexFile() readResTypeList(rtRoom, MKID('ROOM'), "room"); break; + case MKID('DRSC'): // FIXME: Verify + readResTypeList(rtRoomScripts,MKID('RMSC'), "room script"); + break; + case MKID('DSCR'): readResTypeList(rtScript, MKID('SCRP'), "script"); break; @@ -354,7 +369,10 @@ void Scumm::readResTypeList(int id, uint32 tag, const char *name) debug(9, "readResTypeList(%s,%x,%s)", resTypeFromId(id), FROM_LE_32(tag), name); - num = fileReadWordLE(); + if (_features & GF_AFTER_V8) + num = fileReadDwordLE(); + else + num = fileReadWordLE(); if (1 || _features & GF_AFTER_V6) { if (num != res.num[id]) { @@ -1152,7 +1170,31 @@ void Scumm::unkHeapProc2(int a, int b) void Scumm::readMAXS() { - if (_features & GF_AFTER_V7) { + if (_features & GF_AFTER_V8) { + fileSeek(_fileHandle, 50+50, SEEK_CUR); + _numVariables = fileReadDwordLE(); /* ? 1500 */ + _numBitVariables = fileReadDwordLE(); /* ? 2048 */ + fileReadDwordLE(); /* 40 */ + _numScripts = fileReadDwordLE(); + _numSounds = fileReadDwordLE(); + _numCharsets = fileReadDwordLE(); + _numCostumes = fileReadDwordLE(); + _numRooms = fileReadDwordLE(); + _numInventory = fileReadDwordLE(); + _numGlobalObjects = fileReadDwordLE(); + _numFlObject = fileReadDwordLE(); + _numLocalObjects = fileReadDwordLE(); + _numVerbs = fileReadDwordLE(); + _numNewNames = fileReadDwordLE(); + fileReadDwordLE(); + fileReadDwordLE(); + _numArray = fileReadDwordLE(); + + _objectRoomTable = (byte*)calloc(_numGlobalObjects, 1); + _numGlobalScripts = 2000; + + _shadowPaletteSize = NUM_SHADOW_PALETTE * 256; + } else if (_features & GF_AFTER_V7) { fileSeek(_fileHandle, 50 + 50, SEEK_CUR); _numVariables = fileReadWordLE(); _numBitVariables = fileReadWordLE(); @@ -1247,6 +1289,7 @@ void Scumm::allocateArrays() MKID('COST'), _numCostumes, "costume", 1); allocResTypeData(rtRoom, MKID('ROOM'), _numRooms, "room", 1); + allocResTypeData(rtRoomScripts, MKID('RMSC'), _numRooms, "room script", 1); allocResTypeData(rtSound, MKID('SOUN'), _numSounds, "sound", 1); allocResTypeData(rtScript, MKID('SCRP'), _numScripts, "script", 1); allocResTypeData(rtCharset, MKID('CHAR'), _numCharsets, "charset", 1); @@ -248,8 +248,9 @@ enum ResTypes { rtMatrix = 14, rtBox = 15, rtObjectName = 16, - rtLast = 16, - rtNumTypes = 17 + rtRoomScripts = 17, + rtLast = 17, + rtNumTypes = 18 }; enum { @@ -449,8 +450,10 @@ enum GameId { GID_FT = 11, GID_DIG = 12, GID_MONKEY_VGA = 13, + GID_CMI = 14, + /* Simon the Sorcerer */ - GID_SIMON_FIRST = 14, + GID_SIMON_FIRST = 20, GID_SIMON_LAST = GID_SIMON_FIRST+3, }; @@ -476,7 +479,8 @@ enum GameFeatures { GF_NO_SCALLING = 2048, GF_ADLIB_DEFAULT = 4096, GF_AMIGA = 8192, - GF_HUMONGOUS = 16384 + GF_HUMONGOUS = 16384, + GF_AFTER_V8 = 32768 }; enum WhereIsObject { |