diff options
-rw-r--r-- | engines/drascula/actors.cpp | 21 | ||||
-rw-r--r-- | engines/drascula/animation.cpp | 9 | ||||
-rw-r--r-- | engines/drascula/graphics.cpp | 67 | ||||
-rw-r--r-- | engines/drascula/talk.cpp | 8 |
4 files changed, 20 insertions, 85 deletions
diff --git a/engines/drascula/actors.cpp b/engines/drascula/actors.cpp index 166ba49930..d831104fac 100644 --- a/engines/drascula/actors.cpp +++ b/engines/drascula/actors.cpp @@ -28,9 +28,8 @@ namespace Drascula { void DrasculaEngine::placeIgor() { - int pos_igor[6]; + int pos_igor[6] = { 1, 0, igorX, igorY, 54, 61 }; - pos_igor[0] = 1; if (currentChapter == 4) { pos_igor[1] = 138; } else { @@ -39,16 +38,12 @@ void DrasculaEngine::placeIgor() { else if (trackIgor == 1) pos_igor[1] = 76; } - pos_igor[2] = igorX; - pos_igor[3] = igorY; - pos_igor[4] = 54; - pos_igor[5] = 61; copyRectClip(pos_igor, frontSurface, screenSurface); } void DrasculaEngine::placeDrascula() { - int pos_dr[6]; + int pos_dr[6] = { 0, 122, drasculaX, drasculaY, 45, 77 }; if (trackDrascula == 1) pos_dr[0] = 47; @@ -56,11 +51,6 @@ void DrasculaEngine::placeDrascula() { pos_dr[0] = 1; else if (trackDrascula == 3 && currentChapter == 1) pos_dr[0] = 93; - pos_dr[1] = 122; - pos_dr[2] = drasculaX; - pos_dr[3] = drasculaY; - pos_dr[4] = 45; - pos_dr[5] = 77; if (currentChapter == 6) copyRectClip(pos_dr, drawSurface2, screenSurface); @@ -69,17 +59,12 @@ void DrasculaEngine::placeDrascula() { } void DrasculaEngine::placeBJ() { - int pos_bj[6]; + int pos_bj[6] = { 0, 99, bjX, bjY, 26, 76 }; if (trackBJ == 3) pos_bj[0] = 10; else if (trackBJ == 0) pos_bj[0] = 37; - pos_bj[1] = 99; - pos_bj[2] = bjX; - pos_bj[3] = bjY; - pos_bj[4] = 26; - pos_bj[5] = 76; copyRectClip(pos_bj, drawSurface3, screenSurface); } diff --git a/engines/drascula/animation.cpp b/engines/drascula/animation.cpp index 1c0cc5967d..66f903e3e3 100644 --- a/engines/drascula/animation.cpp +++ b/engines/drascula/animation.cpp @@ -812,18 +812,11 @@ void DrasculaEngine::animation_10_2() { } void DrasculaEngine::animation_14_2() { - int cabinPos[6]; + int cabinPos[6] = { 150, 6, 69, -160, 158, 161 }; int l = 0; loadPic("an14_2.alg", backSurface); - cabinPos[0] = 150; - cabinPos[1] = 6; - cabinPos[2] = 69; - cabinPos[3] = -160; - cabinPos[4] = 158; - cabinPos[5] = 161; - for (int n = -160; n <= 0; n = n + 5 + l) { copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface); updateRefresh_pre(); diff --git a/engines/drascula/graphics.cpp b/engines/drascula/graphics.cpp index 38a324fff7..a2b4527015 100644 --- a/engines/drascula/graphics.cpp +++ b/engines/drascula/graphics.cpp @@ -58,8 +58,6 @@ void DrasculaEngine::freeMemory() { } void DrasculaEngine::moveCursor() { - int cursorPos[8]; - copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface); updateRefresh_pre(); @@ -78,25 +76,12 @@ void DrasculaEngine::moveCursor() { else if (menuBar == 1) clearMenu(); - cursorPos[0] = 0; - cursorPos[1] = 0; - cursorPos[2] = mouseX - 20; - cursorPos[3] = mouseY - 17; - cursorPos[4] = OBJWIDTH; - cursorPos[5] = OBJHEIGHT; + int cursorPos[6] = { 0, 0, mouseX - 20, mouseY - 17, OBJWIDTH, OBJHEIGHT }; copyRectClip(cursorPos, drawSurface3, screenSurface); } void DrasculaEngine::setCursorTable() { - int cursorPos[8]; - - cursorPos[0] = 225; - cursorPos[1] = 56; - cursorPos[2] = mouseX - 20; - cursorPos[3] = mouseY - 12; - cursorPos[4] = 40; - cursorPos[5] = 25; - + int cursorPos[6] = { 225, 56, mouseX - 20, mouseY - 12, 40, 25 }; copyRectClip(cursorPos, tableSurface, screenSurface); } @@ -233,7 +218,6 @@ void DrasculaEngine::updateScreen(int xorg, int yorg, int xdes, int ydes, int wi } void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) { - int textPos[8]; int letterY = 0, letterX = 0, i; uint len = strlen(said); byte c; @@ -260,13 +244,7 @@ void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) { } // if } // for - textPos[0] = letterX; - textPos[1] = letterY; - textPos[2] = screenX; - textPos[3] = screenY; - textPos[4] = CHAR_WIDTH; - textPos[5] = CHAR_HEIGHT; - + int textPos[6] = { letterX, letterY, screenX, screenY, CHAR_WIDTH, CHAR_HEIGHT }; copyRectClip(textPos, textSurface, screenSurface); screenX = screenX + CHAR_WIDTH; @@ -278,7 +256,6 @@ void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) { } void DrasculaEngine::print_abc_opc(const char *said, int screenX, int screenY, int game) { - int textPos[6]; int signY, letterY, letterX = 0; uint len = strlen(said); @@ -317,13 +294,7 @@ void DrasculaEngine::print_abc_opc(const char *said, int screenX, int screenY, i } // if } // for - textPos[0] = letterX; - textPos[1] = letterY; - textPos[2] = screenX; - textPos[3] = screenY; - textPos[4] = CHAR_WIDTH_OPC; - textPos[5] = CHAR_HEIGHT_OPC; - + int textPos[6] = { letterX, letterY, screenX, screenY, CHAR_WIDTH_OPC, CHAR_HEIGHT_OPC }; copyRectClip(textPos, backSurface, screenSurface); screenX = screenX + CHAR_WIDTH_OPC; @@ -555,48 +526,40 @@ int DrasculaEngine::playFrameSSN() { mSession += 4; } if (CMP == kFrameCmpRle) { + BufferSSN = (byte *)malloc(Lengt); if (!UsingMem) { - BufferSSN = (byte *)malloc(Lengt); _arj.read(BufferSSN, Lengt); } else { - BufferSSN = (byte *)malloc(Lengt); memcpy(BufferSSN, mSession, Lengt); mSession += Lengt; } Des_RLE(BufferSSN, MiVideoSSN); free(BufferSSN); - if (FrameSSN) { - WaitFrameSSN(); - MixVideo(VGA, MiVideoSSN); - _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); - } else { - WaitFrameSSN(); + WaitFrameSSN(); + if (FrameSSN) + MixVideo(VGA, MiVideoSSN); + else memcpy(VGA, MiVideoSSN, 64000); - _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); - } + _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); _system->updateScreen(); FrameSSN++; } else { if (CMP == kFrameCmpOff) { + BufferSSN = (byte *)malloc(Lengt); if (!UsingMem) { - BufferSSN = (byte *)malloc(Lengt); _arj.read(BufferSSN, Lengt); } else { - BufferSSN = (byte *)malloc(Lengt); memcpy(BufferSSN, mSession, Lengt); mSession += Lengt; } Des_OFF(BufferSSN, MiVideoSSN, Lengt); free(BufferSSN); - if (FrameSSN) { - WaitFrameSSN(); + WaitFrameSSN(); + if (FrameSSN) MixVideo(VGA, MiVideoSSN); - _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); - } else { - WaitFrameSSN(); + else memcpy(VGA, MiVideoSSN, 64000); - _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); - } + _system->copyRectToScreen((const byte *)VGA, 320, 0, 0, 320, 200); _system->updateScreen(); FrameSSN++; } diff --git a/engines/drascula/talk.cpp b/engines/drascula/talk.cpp index 95765fe867..6aa09b2505 100644 --- a/engines/drascula/talk.cpp +++ b/engines/drascula/talk.cpp @@ -575,7 +575,7 @@ void DrasculaEngine::talk_blind(int index) { byte *faceBuffer; int p = 0; - int pos_blind[6]; + int pos_blind[6] = { 0, 2, 73, 1, 126, 149 }; int length = strlen(said); color_abc(kColorBrown); @@ -585,12 +585,6 @@ void DrasculaEngine::talk_blind(int index) { talkInit(filename); - pos_blind[1] = 2; - pos_blind[2] = 73; - pos_blind[3] = 1; - pos_blind[4] = 126; - pos_blind[5] = 149; - do { copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface); pos_blind[5] = 149; |