diff options
author | Filippos Karapetis | 2015-07-18 15:28:10 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2015-12-15 00:05:02 +0100 |
commit | 21e360b9b18e887bb35efaf21a16bf7f97338a35 (patch) | |
tree | e5e4eb9c15e918231e42b0e93a562315c604b971 | |
parent | 27683945e609d50947cecaf1b947fd85e40e9159 (diff) | |
download | scummvm-rg350-21e360b9b18e887bb35efaf21a16bf7f97338a35.tar.gz scummvm-rg350-21e360b9b18e887bb35efaf21a16bf7f97338a35.tar.bz2 scummvm-rg350-21e360b9b18e887bb35efaf21a16bf7f97338a35.zip |
LAB: Remove dead/superfluous code, and remove the newCheckMusic() wrapper
-rw-r--r-- | engines/lab/diff.h | 2 | ||||
-rw-r--r-- | engines/lab/engine.cpp | 14 | ||||
-rw-r--r-- | engines/lab/graphics.cpp | 87 | ||||
-rw-r--r-- | engines/lab/interface.cpp | 4 | ||||
-rw-r--r-- | engines/lab/interface.h | 4 | ||||
-rw-r--r-- | engines/lab/intro.cpp | 29 | ||||
-rw-r--r-- | engines/lab/labfun.h | 1 | ||||
-rw-r--r-- | engines/lab/labmusic.cpp | 7 | ||||
-rw-r--r-- | engines/lab/map.cpp | 33 | ||||
-rw-r--r-- | engines/lab/processroom.cpp | 7 | ||||
-rw-r--r-- | engines/lab/readdiff.cpp | 14 | ||||
-rw-r--r-- | engines/lab/special.cpp | 20 | ||||
-rw-r--r-- | engines/lab/vga.cpp | 4 |
13 files changed, 38 insertions, 188 deletions
diff --git a/engines/lab/diff.h b/engines/lab/diff.h index 4c906f7597..b5c84d3a93 100644 --- a/engines/lab/diff.h +++ b/engines/lab/diff.h @@ -46,7 +46,7 @@ struct DIFFHeader { struct BitMap { uint16 BytesPerRow, Rows; - byte Flags, Depth; + byte Flags; byte *Planes[16]; }; diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index 661cbdfb84..8960464aeb 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -397,8 +397,6 @@ void eatMessages() { do { Msg = getMsg(); - if (Msg) - replyMsg((void *) Msg); } while (Msg); return; @@ -787,7 +785,7 @@ static void mainGameLoop() { if (Msg == NULL) { /* Does music load and next animation frame when you've run out of messages */ GotMessage = false; checkRoomMusic(); - g_music->newCheckMusic(); + g_music->checkMusic(); diffNextFrame(); if (FollowingCrumbs) { @@ -830,8 +828,6 @@ static void mainGameLoop() { MouseY = Msg->MouseY; GadID = Msg->GadgetID; - replyMsg((void *) Msg); - FollowingCrumbs = false; from_crumbs: @@ -893,11 +889,9 @@ from_crumbs: Msg = getMsg(); if (Msg == NULL) { /* Does music load and next animation frame when you've run out of messages */ - g_music->newCheckMusic(); + g_music->checkMusic(); diffNextFrame(); } else { - replyMsg((void *) Msg); /* Can't do this in non-IBM versions */ - if (Msg->Class == RAWKEY) { if ((Msg->Code == 'Y') || (Msg->Code == 'y') || (Msg->Code == 'Q') || (Msg->Code == 'q')) { doit = true; @@ -1406,7 +1400,7 @@ void LabEngine::go() { readPict("P:End/L2In.1", true); for (counter = 0; counter < 120; counter++) { - g_music->newCheckMusic(); + g_music->checkMusic(); waitTOF(); } @@ -1415,7 +1409,7 @@ void LabEngine::go() { warning("STUB: waitForPress"); while (!1) { // 1 means ignore SDL_ProcessInput calls - g_music->newCheckMusic(); + g_music->checkMusic(); diffNextFrame(); waitTOF(); } diff --git a/engines/lab/graphics.cpp b/engines/lab/graphics.cpp index 360ffa873a..7f949d6bdf 100644 --- a/engines/lab/graphics.cpp +++ b/engines/lab/graphics.cpp @@ -47,7 +47,6 @@ extern BitMap RawDiffBM; extern char diffcmap[256 * 3], lastcmap[256 * 3]; extern bool IsBM, NoFlip, nopalchange; -extern int32 ReadSoFar; extern bool DoBlack, stopsound; extern bool IsHiRes; extern TextFont *MsgFont; @@ -62,7 +61,7 @@ extern const char *CurFileName; /*---------------------------------------------------------------------------*/ -extern uint32 VGAScreenWidth, VGAScreenHeight, VGAPages, VGABytesPerPage; +extern uint32 VGAScreenWidth, VGAScreenHeight, VGABytesPerPage; /*****************************************************************************/ /* Reads in a picture into the dest bitmap. */ @@ -72,8 +71,6 @@ bool readPict(const char *filename, bool PlayOnce) { stopDiff(); - ReadSoFar = 0L; - file = g_music->newOpen(filename); if (file == NULL) { @@ -86,7 +83,6 @@ bool readPict(const char *filename, bool PlayOnce) { DispBitMap->BytesPerRow = VGAScreenWidth; DispBitMap->Rows = VGAScreenHeight; DispBitMap->Flags = BITMAPF_VIDEO; - DispBitMap->Depth = VGAPages; readDiff(PlayOnce); @@ -128,8 +124,6 @@ byte *readPictToMem(const char *filename, uint16 x, uint16 y) { stopDiff(); - ReadSoFar = 0L; - allocFile((void **)&Mem, (int32) x * (int32) y, "Bitmap"); CurMem = Mem; @@ -141,7 +135,6 @@ byte *readPictToMem(const char *filename, uint16 x, uint16 y) { DispBitMap->BytesPerRow = x; DispBitMap->Rows = y; DispBitMap->Flags = 0; - DispBitMap->Depth = VGAPages; DispBitMap->Planes[0] = CurMem; DispBitMap->Planes[1] = DispBitMap->Planes[0] + 0x10000; DispBitMap->Planes[2] = DispBitMap->Planes[1] + 0x10000; @@ -423,70 +416,6 @@ void drawMessage(const char *str) { #define READFIRSTFRAME 6 #define READNEXTFRAME 7 - - - -/*****************************************************************************/ -/* Copies memory from one location to another 64 bytes at a time. */ -/*****************************************************************************/ -void copyLong64(uint32 *Dest, uint32 *Source, uint32 Many64) { - while (Many64) { - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - *Dest = *Source; - Dest++; - Source++; - - Many64--; - } -} - - - - /*****************************************************************************/ /* Scrolls the display to black. */ /*****************************************************************************/ @@ -516,7 +445,7 @@ static void doScrollBlack() { nheight = height; while (nheight) { - g_music->newCheckMusic(); + g_music->checkMusic(); if (!IsHiRes) waitTOF(); @@ -541,7 +470,7 @@ static void doScrollBlack() { size -= copysize; setPage(CurPage); - copyLong64(BaseAddr, (uint32 *) tempmem, copysize >> 6); + memcpy(BaseAddr, tempmem, copysize); tempmem += copysize; CurPage++; } @@ -596,7 +525,7 @@ static void copyPage(uint16 width, uint16 height, uint16 nheight, uint16 startli size -= copysize; setPage(CurPage); - copyLong64(BaseAddr + (OffSet >> 2), (uint32 *) mem, copysize >> 6); + memcpy(BaseAddr + (OffSet >> 2), mem, copysize); mem += copysize; CurPage++; OffSet = 0; @@ -618,7 +547,7 @@ static void doScrollWipe(char *filename) { height = VGAScaleY(149) + SVGACord(2); while (g_music->isSoundEffectActive()) { - g_music->newCheckMusic(); + g_music->checkMusic(); waitTOF(); } @@ -633,7 +562,7 @@ static void doScrollWipe(char *filename) { nheight = height; while (onrow < headerdata.y) { - g_music->newCheckMusic(); + g_music->checkMusic(); if ((by > nheight) && nheight) by = nheight; @@ -694,7 +623,7 @@ static void doScrollBounce() { int startline = headerdata.y - height - 1; for (int counter = 0; counter < 5; counter++) { - g_music->newCheckMusic(); + g_music->checkMusic(); startline -= newby[counter]; copyPage(width, height, 0, startline, mem); @@ -703,7 +632,7 @@ static void doScrollBounce() { } for (int counter = 8; counter > 0; counter--) { - g_music->newCheckMusic(); + g_music->checkMusic(); startline += newby1[counter - 1]; copyPage(width, height, 0, startline, mem); diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp index cffa054a8e..e2f7401114 100644 --- a/engines/lab/interface.cpp +++ b/engines/lab/interface.cpp @@ -207,8 +207,4 @@ IntuiMessage *getMsg() { return NULL; } -void replyMsg(void *Msg) { - return; -} - } // End of namespace Lab diff --git a/engines/lab/interface.h b/engines/lab/interface.h index 170006f64a..ea110f4015 100644 --- a/engines/lab/interface.h +++ b/engines/lab/interface.h @@ -111,16 +111,12 @@ extern Common::KeyState _keyPressed; /*--------------------------- Function Prototypes ---------------------------*/ /*---------------------------------------------------------------------------*/ - - - Gadget *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *im, Image *imalt); void freeButtonList(void *gptrlist); void drawGadgetList(Gadget *gadlist); void ghoastGadget(Gadget *curgad, uint16 pencolor); void unGhoastGadget(Gadget *curgad); IntuiMessage *getMsg(); -void replyMsg(void *Msg); } // End of namespace Lab diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp index 1f05afe231..c430b61058 100644 --- a/engines/lab/intro.cpp +++ b/engines/lab/intro.cpp @@ -81,8 +81,6 @@ void introEatMessages() { ((Msg->Class == RAWKEY) && (Msg->Code == 27)) ) QuitIntro = true; - - replyMsg(Msg); } } } @@ -110,7 +108,7 @@ static void doPictText(const char *Filename, bool isscreen) { g_music->fillUpMusic(true); timedelay = 35; } else { - g_music->newCheckMusic(); + g_music->checkMusic(); timedelay = 7; } @@ -162,7 +160,7 @@ static void doPictText(const char *Filename, bool isscreen) { Msg = getMsg(); if (Msg == NULL) { - g_music->newCheckMusic(); + g_music->checkMusic(); diffNextFrame(); getTime(&secs, µs); @@ -184,7 +182,6 @@ static void doPictText(const char *Filename, bool isscreen) { Class = Msg->Class; Qualifier = Msg->Qualifier; Code = Msg->Code; - replyMsg(Msg); if (((Class == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) || ((Class == RAWKEY) && (Code == 27))) { @@ -238,13 +235,13 @@ static void doPictText(const char *Filename, bool isscreen) { void musicDelay() { int16 counter; - g_music->newCheckMusic(); + g_music->checkMusic(); if (QuitIntro) return; for (counter = 0; counter < 20; counter++) { - g_music->newCheckMusic(); + g_music->checkMusic(); waitTOF(); waitTOF(); waitTOF(); @@ -256,7 +253,7 @@ void musicDelay() { static void NReadPict(const char *Filename, bool PlayOnce) { Common::String finalFileName = "P:Intro/"; - g_music->newCheckMusic(); + g_music->checkMusic(); introEatMessages(); if (QuitIntro) @@ -285,10 +282,12 @@ void introSequence() { NReadPict("EA3", true); } else { NReadPict("WYRMKEEP", true); - for (counter = 0; counter < 4; counter++) { + // Wait 4 seconds + for (counter = 0; counter < 4 * 1000 / 10; counter++) { + introEatMessages(); if (QuitIntro) break; - microDelay(1, 0); + g_system->delayMillis(10); } } @@ -314,14 +313,14 @@ void introSequence() { (diffcmap[counter * 3 + 2] >> 2); } - g_music->newCheckMusic(); + g_music->checkMusic(); fade(true, 0); for (int times = 0; times < 150; times++) { if (QuitIntro) break; - g_music->newCheckMusic(); + g_music->checkMusic(); uint16 temp = Palette[2]; for (counter = 2; counter < 15; counter++) @@ -336,7 +335,7 @@ void introSequence() { fade(false, 0); blackAllScreen(); - g_music->newCheckMusic(); + g_music->checkMusic(); NReadPict("Title.A", true); NReadPict("AB", true); @@ -360,7 +359,7 @@ void introSequence() { g_music->newOpen("p:Intro/Intro.1"); /* load the picture into the buffer */ - g_music->newCheckMusic(); + g_music->checkMusic(); blackAllScreen(); g_music->fillUpMusic(true); @@ -415,7 +414,7 @@ void introSequence() { for (counter1 = (8 * 3); counter1 < (255 * 3); counter1++) diffcmap[counter1] = 255 - diffcmap[counter1]; - g_music->newCheckMusic(); + g_music->checkMusic(); waitTOF(); VGASetPal(diffcmap, 256); waitTOF(); diff --git a/engines/lab/labfun.h b/engines/lab/labfun.h index e2f7844596..cd1e2df690 100644 --- a/engines/lab/labfun.h +++ b/engines/lab/labfun.h @@ -184,7 +184,6 @@ public: void updateMusic(); uint16 getPlayingBufferCount(); void checkMusic(); - void newCheckMusic(); void closeMusic(); void setMusic(bool on); void resumeBackMusic(); diff --git a/engines/lab/labmusic.cpp b/engines/lab/labmusic.cpp index a435710078..ecb5fd174b 100644 --- a/engines/lab/labmusic.cpp +++ b/engines/lab/labmusic.cpp @@ -253,13 +253,6 @@ void Music::checkMusic() { } /*****************************************************************************/ -/* Checks to see if need to fill buffers fill of music. */ -/*****************************************************************************/ -void Music::newCheckMusic() { - checkMusic(); -} - -/*****************************************************************************/ /* Turns the music on and off. */ /*****************************************************************************/ void Music::setMusic(bool on) { diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp index a0dffe04e9..458ff215df 100644 --- a/engines/lab/map.cpp +++ b/engines/lab/map.cpp @@ -142,16 +142,10 @@ void readImage(byte **buffer, Image **im) { } - - - - /*---------------------------------------------------------------------------*/ /*------------------------------ The Map stuff ------------------------------*/ /*---------------------------------------------------------------------------*/ - - extern RoomData *Rooms; extern const char *ViewPath; @@ -620,7 +614,7 @@ static void drawMap(uint16 CurRoom, uint16 CurMsg, uint16 Floor, bool fadeout, b } if ((Maps[CurRoom].PageNumber == Floor) /* Makes sure the X is drawn in corridors */ - && g_lab->_roomsFound->in(CurRoom) /* NOTE: this here on purpose just in case there's some wierd condition, like the surreal maze where there are no rooms */ + && g_lab->_roomsFound->in(CurRoom) /* NOTE: this here on purpose just in case there's some weird condition, like the surreal maze where there are no rooms */ && Maps[CurRoom].x) drawRoom(CurRoom, true); @@ -664,38 +658,28 @@ static void drawMap(uint16 CurRoom, uint16 CurMsg, uint16 Floor, bool fadeout, b } - /* LAB: Labyrinth specific code */ - sptr = NULL; - switch (Floor) { case LOWERFLOOR: sptr = LOWERFLOORS; break; - case MIDDLEFLOOR: sptr = MIDDLEFLOORS; break; - case UPPERFLOOR: sptr = UPPERFLOORS; break; - case MEDMAZEFLOOR: sptr = MEDMAZEFLOORS; break; - case HEDGEMAZEFLOOR: sptr = HEDGEMAZEFLOORS; break; - case SURMAZEFLOOR: sptr = SURMAZEFLOORS; break; - case CARNIVAL: sptr = CARNIVALFLOOR; break; - default: sptr = NULL; break; @@ -734,7 +718,7 @@ void processMap(uint16 CurRoom) { Msg = getMsg(); if (Msg == NULL) { - g_music->newCheckMusic(); + g_music->checkMusic(); if (place <= 14) { newcolor[0] = 14 << 2; @@ -888,17 +872,6 @@ void processMap(uint16 CurRoom) { } - -/*****************************************************************************/ -/* Cleans up behind itself. */ -/*****************************************************************************/ -void mapCleanUp() { - freeAllStolenMem(); -} - - - - /*****************************************************************************/ /* Does the map processing. */ /*****************************************************************************/ @@ -929,7 +902,7 @@ void doMap(uint16 CurRoom) { mouseHide(); setAPen(0); rectFill(0, 0, VGAScreenWidth - 1, VGAScreenHeight - 1); - mapCleanUp(); + freeAllStolenMem(); blackAllScreen(); mouseShow(); WSDL_UpdateScreen(); diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp index 7293b908ea..9d501e6b57 100644 --- a/engines/lab/processroom.cpp +++ b/engines/lab/processroom.cpp @@ -206,9 +206,6 @@ char *getPictName(CloseDataPtr *LCPtr) { /*****************************************************************************/ void drawDirection(CloseDataPtr LCPtr) { char Message[250]; - /* - char test[15]; - */ if (LCPtr != NULL) { if (LCPtr->Message) { @@ -378,7 +375,7 @@ static void doActions(ActionPtr APtr, CloseDataPtr *LCPtr) { uint32 StartSecs, StartMicros, CurSecs, CurMicros; while (APtr) { - g_music->newCheckMusic(); + g_music->checkMusic(); switch (APtr->ActionType) { case PLAYSOUND: @@ -547,7 +544,7 @@ static void doActions(ActionPtr APtr, CloseDataPtr *LCPtr) { WSDL_UpdateScreen(); while (1) { - g_music->newCheckMusic(); + g_music->checkMusic(); diffNextFrame(); getTime(&CurSecs, &CurMicros); diff --git a/engines/lab/readdiff.cpp b/engines/lab/readdiff.cpp index e1ecb3b6d0..f2a39b41aa 100644 --- a/engines/lab/readdiff.cpp +++ b/engines/lab/readdiff.cpp @@ -40,9 +40,6 @@ namespace Lab { extern BitMap *DispBitMap, *DrawBitMap; extern uint32 VGABytesPerPage; -/* - extern int32 ReadSoFar; - */ extern byte **startoffile; static bool PlayOnce = false, changedscreen; @@ -258,10 +255,6 @@ void diffNextFrame() { break; case 26L: - /* NYI: This don't work no more - memcpy((void *) DrawBitMap->Planes[CurBit], - (void *) DispBitMap->Planes[CurBit], (uint16) (diffheight*diffwidth)); - */ CurBit++; break; @@ -443,11 +436,6 @@ void stopDiff() { if (IsPlaying) { StopPlaying = true; - /* NYI: - while (IsPlaying) - waitTOF(); - */ - if (IsAnim) blackScreen(); } @@ -463,7 +451,7 @@ void stopDiffEnd() { StopPlayingEnd = true; while (IsPlaying) { - g_music->newCheckMusic(); + g_music->checkMusic(); diffNextFrame(); } } diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp index b8e66626d2..57f328451d 100644 --- a/engines/lab/special.cpp +++ b/engines/lab/special.cpp @@ -171,10 +171,6 @@ static void changeCombination(uint16 number) { display.Width = VGAScreenWidth; display.Height = VGAScreenHeight; - /* NYI: - readPict("Music:Thunk", true); - */ - for (counter = 1; counter <= (Images[combnum]->Height / 2); counter++) { if (IsHiRes) { if (counter & 1) @@ -725,7 +721,7 @@ static void drawJournalText() { char *CurText = journaltext; while (DrawingToPage < JPage) { - g_music->newCheckMusic(); + g_music->checkMusic(); CurText = (char *)(journaltext + CharsDrawn); CharsDrawn += flowText(BigMsgFont, -2, 2, 0, false, false, false, false, VGAScaleX(52), VGAScaleY(32), VGAScaleX(152), VGAScaleY(148), CurText); @@ -846,14 +842,12 @@ static void processJournal() { Msg = (IntuiMessage *) getMsg(); if (Msg == NULL) { - g_music->newCheckMusic(); + g_music->checkMusic(); } else { Class = Msg->Class; Qualifier = Msg->Qualifier; GadID = Msg->Code; - replyMsg((void *) Msg); - if (((Class == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) || ((Class == RAWKEY) && (GadID == 27))) return; @@ -1047,7 +1041,7 @@ static void drawMonText(char *text, uint16 x1, uint16 y1, uint16 x2, uint16 y2, } while (DrawingToPage < monpage) { - g_music->newCheckMusic(); + g_music->checkMusic(); CurText = (char *)(text + CharsDrawn); CharsDrawn += flowText(BigMsgFont, yspacing, 0, 0, false, false, false, false, x1, y1, x2, y2, CurText); lastpage = (*CurText == 0); @@ -1105,7 +1099,7 @@ static void processMonitor(char *ntext, bool isinteractive, uint16 x1, uint16 y1 Msg = getMsg(); if (Msg == NULL) { - g_music->newCheckMusic(); + g_music->checkMusic(); } else { Class = Msg->Class; Qualifier = Msg->Qualifier; @@ -1113,8 +1107,6 @@ static void processMonitor(char *ntext, bool isinteractive, uint16 x1, uint16 y1 MouseY = Msg->MouseY; Code = Msg->Code; - replyMsg(Msg); - if (((Class == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) || ((Class == RAWKEY) && (Code == 27))) return; @@ -1242,7 +1234,7 @@ void doTrialBlock() { Msg = getMsg(); if (Msg == NULL) { - g_music->newCheckMusic(); + g_music->checkMusic(); } else { Class = Msg->Class; Qualifier = Msg->Qualifier; @@ -1250,8 +1242,6 @@ void doTrialBlock() { MouseY = Msg->MouseY; Code = Msg->Code; - replyMsg(Msg); - if (((Class == MOUSEBUTTONS) && (IEQUALIFIER_RBUTTON & Qualifier)) || ((Class == RAWKEY) && (Code == 27))) return; diff --git a/engines/lab/vga.cpp b/engines/lab/vga.cpp index 388af2d4c7..31477a78e9 100644 --- a/engines/lab/vga.cpp +++ b/engines/lab/vga.cpp @@ -38,11 +38,8 @@ namespace Lab { -//static uint16 NotInRefresh = 0; - uint32 VGAScreenWidth = 320UL, VGAScreenHeight = 200UL, - VGAPages = 1UL, VGABytesPerPage = 65536UL; byte *VGABASEADDRESS = 0; @@ -76,7 +73,6 @@ bool createScreen(bool HiRes) { VGAScreenWidth = 320; VGAScreenHeight = 200; } - VGAPages = 1; VGABytesPerPage = VGAScreenWidth * VGAScreenHeight; g_DisplayBuffer = (byte *)malloc(VGABytesPerPage); |