- The game's cursor is now handled via ScummVM's cursor manager, instead of the game itself (this means that there might be regressions where the cursor is visible when it shouldn't be)

- Removed the textSurface pointer, which was used in the Spanish version. Non-Spanish versions of the game hold the font data in the tableSurface buffer (which contains picture 96). The font data for Spanish versions is in picture 974. Now both versions load their font data from the tableSurface buffer
- hay_que_load -> loadedDifferentChapter
- Merged withoutVerb() and selectVerb()
This is a big change, it might lead to regressions!

svn-id: r34488
This commit is contained in:
Filippos Karapetis 2008-09-11 09:31:45 +00:00
parent 19dd03dfa8
commit fa3d3e3643
10 changed files with 140 additions and 170 deletions

View file

@ -402,9 +402,6 @@ void DrasculaEngine::animation_2_1() {
if (animate("ag.bin", 14)) if (animate("ag.bin", 14))
break; break;
if (_lang == kSpanish)
textSurface = frontSurface;
loadPic("an11y13.alg", extraSurface); loadPic("an11y13.alg", extraSurface);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break; break;
@ -413,9 +410,6 @@ void DrasculaEngine::animation_2_1() {
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break; break;
if (_lang == kSpanish)
textSurface = extraSurface;
loadPic(97, extraSurface); loadPic(97, extraSurface);
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE)) if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
break; break;
@ -598,9 +592,6 @@ void DrasculaEngine::animation_2_1() {
// John Hacker talks with the bartender to book a room // John Hacker talks with the bartender to book a room
void DrasculaEngine::animation_3_1() { void DrasculaEngine::animation_3_1() {
if (_lang == kSpanish)
textSurface = frontSurface;
loadPic("an11y13.alg", extraSurface); loadPic("an11y13.alg", extraSurface);
talk(192); talk(192);
@ -626,17 +617,11 @@ void DrasculaEngine::animation_3_1() {
flags[0] = 1; flags[0] = 1;
if (_lang == kSpanish)
textSurface = extraSurface;
loadPic(97, extraSurface); loadPic(97, extraSurface);
} }
// John Hacker talks with the pianist // John Hacker talks with the pianist
void DrasculaEngine::animation_4_1() { void DrasculaEngine::animation_4_1() {
if (_lang == kSpanish)
textSurface = frontSurface;
loadPic("an12.alg", extraSurface); loadPic("an12.alg", extraSurface);
talk(205); talk(205);
@ -668,9 +653,6 @@ void DrasculaEngine::animation_4_1() {
talk_pianist(4); talk_pianist(4);
talk(209); talk(209);
if (_lang == kSpanish)
textSurface = extraSurface;
flags[11] = 0; flags[11] = 0;
loadPic(97, extraSurface); loadPic(97, extraSurface);
} }
@ -725,9 +707,6 @@ void DrasculaEngine::animation_4_2() {
loadPic("ciego4.alg", backSurface); loadPic("ciego4.alg", backSurface);
loadPic("ciego5.alg", frontSurface); loadPic("ciego5.alg", frontSurface);
if (_lang == kSpanish)
textSurface = frontSurface;
copyBackground(); copyBackground();
updateScreen(); updateScreen();
@ -771,10 +750,7 @@ void DrasculaEngine::animation_4_2() {
loadPic(96, frontSurface); loadPic(96, frontSurface);
loadPic(97, extraSurface); loadPic(97, extraSurface);
loadPic(99, backSurface); loadPic(99, backSurface);
withoutVerb(); selectVerb(0);
if (_lang == kSpanish)
textSurface = extraSurface;
flags[9] = 0; flags[9] = 0;
flags[4] = 1; flags[4] = 1;
@ -825,24 +801,16 @@ void DrasculaEngine::animation_16_2() {
if (key != 0) if (key != 0)
goto asco; goto asco;
if (_lang != kSpanish)
color_abc(kColorDarkGreen); color_abc(kColorDarkGreen);
loadPic("his1.alg", bgSurface, HALF_PAL); loadPic("his1.alg", bgSurface, HALF_PAL);
if (_lang == kSpanish)
black();
copyBackground(); copyBackground();
if (_lang != kSpanish)
centerText(_texthis[1], 180, 180); centerText(_texthis[1], 180, 180);
updateScreen(); updateScreen();
if (_lang == kSpanish)
fadeFromBlack(1);
key = getScan(); key = getScan();
if (key != 0) if (key != 0)
goto asco; goto asco;
@ -865,7 +833,6 @@ void DrasculaEngine::animation_16_2() {
loadPic("his2.alg", bgSurface, HALF_PAL); loadPic("his2.alg", bgSurface, HALF_PAL);
copyBackground(); copyBackground();
if (_lang != kSpanish)
centerText(_texthis[2], 180, 180); centerText(_texthis[2], 180, 180);
updateScreen(); updateScreen();
@ -891,7 +858,6 @@ void DrasculaEngine::animation_16_2() {
loadPic("his3.alg", bgSurface, HALF_PAL); loadPic("his3.alg", bgSurface, HALF_PAL);
copyBackground(); copyBackground();
if (_lang != kSpanish)
centerText(_texthis[3], 180, 180); centerText(_texthis[3], 180, 180);
updateScreen(); updateScreen();
@ -916,7 +882,6 @@ void DrasculaEngine::animation_16_2() {
copyBackground(0, 0, 0, 0, 320, 200, drawSurface3, screenSurface); copyBackground(0, 0, 0, 0, 320, 200, drawSurface3, screenSurface);
if (_lang != kSpanish)
centerText(_texthis[1], 180, 180); centerText(_texthis[1], 180, 180);
updateScreen(); updateScreen();
@ -1117,7 +1082,7 @@ void DrasculaEngine::animation_25_2() {
void DrasculaEngine::animation_27_2() { void DrasculaEngine::animation_27_2() {
flags[22] = 1; flags[22] = 1;
withoutVerb(); selectVerb(0);
removeObject(kItemEarWithEarPlug); removeObject(kItemEarWithEarPlug);
addObject(kItemEarplugs); addObject(kItemEarplugs);
@ -1202,7 +1167,7 @@ void DrasculaEngine::animation_31_2() {
flags[38] = 0; flags[38] = 0;
flags[36] = 1; flags[36] = 1;
withoutVerb(); selectVerb(0);
removeObject(kItemLeaves); removeObject(kItemLeaves);
removeObject(kItemBubbleGum); removeObject(kItemBubbleGum);
removeObject(kItemTissues); removeObject(kItemTissues);
@ -1423,7 +1388,7 @@ void DrasculaEngine::animation_5_5(){
int flyX[] = {1, 63, 125, 187, 249}; int flyX[] = {1, 63, 125, 187, 249};
int pixelX = curX - 53, pixelY = curY - 9; int pixelX = curX - 53, pixelY = curY - 9;
withoutVerb(); selectVerb(0);
removeObject(8); removeObject(8);
gotoObject(curX - 19, curY + curHeight); gotoObject(curX - 19, curY + curHeight);
@ -1602,7 +1567,7 @@ void DrasculaEngine::animation_12_5() {
characterMoved = 0; characterMoved = 0;
curX = -1; curX = -1;
objExit = 104; objExit = 104;
withoutVerb(); selectVerb(0);
enterRoom(57); enterRoom(57);
} }
@ -1730,9 +1695,6 @@ void DrasculaEngine::animation_1_6() {
trackDrascula = 0; trackDrascula = 0;
talk_drascula(35); talk_drascula(35);
if (_lang == kSpanish)
textSurface = extraSurface;
clearRoom(); clearRoom();
enterRoom(102); enterRoom(102);
activatePendulum(); activatePendulum();
@ -1761,7 +1723,7 @@ void DrasculaEngine::animation_5_6() {
void DrasculaEngine::animation_6_6() { void DrasculaEngine::animation_6_6() {
animate("rct.bin", 11); animate("rct.bin", 11);
clearRoom(); clearRoom();
withoutVerb(); selectVerb(0);
removeObject(20); removeObject(20);
loadPic(96, frontSurface); loadPic(96, frontSurface);
loadPic(97, frontSurface); loadPic(97, frontSurface);
@ -1770,7 +1732,7 @@ void DrasculaEngine::animation_6_6() {
doBreak = 1; doBreak = 1;
objExit = 104; objExit = 104;
curX = -1; curX = -1;
withoutVerb(); selectVerb(0);
enterRoom(58); enterRoom(58);
hare_se_ve = 1; hare_se_ve = 1;
trackProtagonist = 1; trackProtagonist = 1;
@ -1874,9 +1836,6 @@ void DrasculaEngine::animation_19_6() {
} }
void DrasculaEngine::animation_12_2() { void DrasculaEngine::animation_12_2() {
if (_lang == kSpanish)
textSurface = frontSurface;
loadPic("an12.alg", extraSurface); loadPic("an12.alg", extraSurface);
talk(356); talk(356);
@ -1902,17 +1861,11 @@ void DrasculaEngine::animation_12_2() {
talk_pianist(5); talk_pianist(5);
converse(1); converse(1);
if (_lang == kSpanish)
textSurface = extraSurface;
flags[11] = 0; flags[11] = 0;
loadPic(974, extraSurface); loadPic(974, extraSurface);
} }
void DrasculaEngine::animation_26_2() { void DrasculaEngine::animation_26_2() {
if (_lang == kSpanish)
textSurface = frontSurface;
loadPic("an12.alg", extraSurface); loadPic("an12.alg", extraSurface);
talk(392); talk(392);
@ -1963,9 +1916,6 @@ void DrasculaEngine::animation_26_2() {
pickObject(11); pickObject(11);
removeObject(kItemBook); removeObject(kItemBook);
if (_lang == kSpanish)
textSurface = extraSurface;
flags[11] = 0; flags[11] = 0;
flags[39] = 1; flags[39] = 1;
loadPic(974, extraSurface); loadPic(974, extraSurface);
@ -1973,9 +1923,6 @@ void DrasculaEngine::animation_26_2() {
} }
void DrasculaEngine::animation_11_2() { void DrasculaEngine::animation_11_2() {
if (_lang == kSpanish)
textSurface = frontSurface;
loadPic("an11y13.alg", extraSurface); loadPic("an11y13.alg", extraSurface);
talk(352); talk(352);
@ -1988,9 +1935,6 @@ void DrasculaEngine::animation_11_2() {
pause(40); pause(40);
talk_bartender(82); talk_bartender(82);
if (_lang == kSpanish)
textSurface = extraSurface;
loadPic(974, extraSurface); loadPic(974, extraSurface);
} }
@ -2112,9 +2056,6 @@ void DrasculaEngine::animation_34_2() {
} }
void DrasculaEngine::animation_36_2() { void DrasculaEngine::animation_36_2() {
if (_lang == kSpanish)
textSurface = frontSurface;
loadPic("an11y13.alg", extraSurface); loadPic("an11y13.alg", extraSurface);
talk(404); talk(404);
@ -2125,9 +2066,6 @@ void DrasculaEngine::animation_36_2() {
pause(40); pause(40);
talk_bartender(82); talk_bartender(82);
if (_lang == kSpanish)
textSurface = extraSurface;
loadPic(974, extraSurface); loadPic(974, extraSurface);
} }
@ -2220,16 +2158,13 @@ void DrasculaEngine::animation_5_2() {
flags[8] = 1; flags[8] = 1;
curX = curX - 4; curX = curX - 4;
talk_sync(_text[46], "46.als", "4442444244244"); talk_sync(_text[46], "46.als", "4442444244244");
withoutVerb(); selectVerb(0);
} }
void DrasculaEngine::animation_6_2() { void DrasculaEngine::animation_6_2() {
stopMusic(); stopMusic();
flags[9] = 1; flags[9] = 1;
if (_lang == kSpanish)
textSurface = frontSurface;
clearRoom(); clearRoom();
loadPic("ciego1.alg", bgSurface, HALF_PAL); // ciego = blind loadPic("ciego1.alg", bgSurface, HALF_PAL); // ciego = blind
loadPic("ciego2.alg", drawSurface3); loadPic("ciego2.alg", drawSurface3);
@ -2262,10 +2197,7 @@ void DrasculaEngine::animation_6_2() {
loadPic(96, frontSurface); loadPic(96, frontSurface);
loadPic(97, extraSurface); loadPic(97, extraSurface);
loadPic(99, backSurface); loadPic(99, backSurface);
withoutVerb(); selectVerb(0);
if (_lang == kSpanish)
textSurface = extraSurface;
flags[9] = 0; flags[9] = 0;
} }
@ -2285,9 +2217,6 @@ void DrasculaEngine::animation_33_2() {
loadPic("ciego4.alg", backSurface); loadPic("ciego4.alg", backSurface);
loadPic("ciego5.alg", frontSurface); loadPic("ciego5.alg", frontSurface);
if (_lang == kSpanish)
textSurface = frontSurface;
copyBackground(); copyBackground();
updateScreen(); updateScreen();
@ -2314,10 +2243,7 @@ void DrasculaEngine::animation_33_2() {
loadPic(96, frontSurface); loadPic(96, frontSurface);
loadPic(97, extraSurface); loadPic(97, extraSurface);
loadPic(99, backSurface); loadPic(99, backSurface);
withoutVerb(); selectVerb(0);
if (_lang == kSpanish)
textSurface = extraSurface;
flags[33] = 1; flags[33] = 1;
flags[9] = 0; flags[9] = 0;
@ -2428,7 +2354,7 @@ void DrasculaEngine::animation_6_4() {
loadPic(96, frontSurface); loadPic(96, frontSurface);
loadPic(roomDisk, drawSurface3); loadPic(roomDisk, drawSurface3);
loadPic(roomNumber, bgSurface, HALF_PAL); loadPic(roomNumber, bgSurface, HALF_PAL);
withoutVerb(); selectVerb(0);
updateRoom(); updateRoom();
} }

View file

@ -122,7 +122,7 @@ void DrasculaEngine::converse(int index) {
breakOut = 0; breakOut = 0;
withoutVerb(); selectVerb(0);
getStringFromLine(buffer, size, phrase1); getStringFromLine(buffer, size, phrase1);
getStringFromLine(buffer, size, phrase2); getStringFromLine(buffer, size, phrase2);

View file

@ -180,7 +180,7 @@ int DrasculaEngine::init() {
int DrasculaEngine::go() { int DrasculaEngine::go() {
currentChapter = 1; // values from 1 to 6 will start each part of game currentChapter = 1; // values from 1 to 6 will start each part of game
hay_que_load = 0; loadedDifferentChapter = 0;
checkCD(); checkCD();
@ -223,9 +223,6 @@ int DrasculaEngine::go() {
withVoices = 0; withVoices = 0;
selectionMade = 0; selectionMade = 0;
if (currentChapter != 6)
loadPic(95, tableSurface);
if (currentChapter != 3) if (currentChapter != 3)
loadPic(96, frontSurface, COMPLETE_PAL); loadPic(96, frontSurface, COMPLETE_PAL);
@ -236,7 +233,7 @@ int DrasculaEngine::go() {
loadPic("aux13.alg", bgSurface, COMPLETE_PAL); loadPic("aux13.alg", bgSurface, COMPLETE_PAL);
loadPic(96, frontSurface); loadPic(96, frontSurface);
} else if (currentChapter == 4) { } else if (currentChapter == 4) {
if (hay_que_load == 0) if (loadedDifferentChapter == 0)
animation_ray(); animation_ray();
loadPic(96, frontSurface); loadPic(96, frontSurface);
clearRoom(); clearRoom();
@ -246,9 +243,14 @@ int DrasculaEngine::go() {
drasculaX = 62, drasculaY = 99, trackDrascula = 1; drasculaX = 62, drasculaY = 99, trackDrascula = 1;
actorFrames[kFramePendulum] = 0; actorFrames[kFramePendulum] = 0;
flag_tv = 0; flag_tv = 0;
}
loadPic(95, tableSurface); loadPic(95, tableSurface);
} for (i = 0; i < 25; i++)
memcpy(crosshairCursor + i * 40, tableSurface + 225 + (56 + i) * 320, 40);
if (_lang == kSpanish)
loadPic(974, tableSurface);
if (currentChapter != 2) { if (currentChapter != 2) {
loadPic(99, backSurface); loadPic(99, backSurface);
@ -290,11 +292,6 @@ bool DrasculaEngine::runCurrentChapter() {
rightMouseButton = 0; rightMouseButton = 0;
if (_lang == kSpanish)
textSurface = extraSurface;
else
textSurface = tableSurface;
previousMusic = -1; previousMusic = -1;
if (currentChapter != 2) { if (currentChapter != 2) {
@ -323,14 +320,14 @@ bool DrasculaEngine::runCurrentChapter() {
if (currentChapter == 1) { if (currentChapter == 1) {
pickObject(28); pickObject(28);
if (hay_que_load == 0) if (loadedDifferentChapter == 0)
animation_1_1(); animation_1_1();
withoutVerb(); selectVerb(0);
loadPic("2aux62.alg", drawSurface2); loadPic("2aux62.alg", drawSurface2);
trackProtagonist = 1; trackProtagonist = 1;
objExit = 104; objExit = 104;
if (hay_que_load != 0) { if (loadedDifferentChapter != 0) {
if (!loadGame(saveName)) { if (!loadGame(saveName)) {
return true; return true;
} }
@ -344,7 +341,7 @@ bool DrasculaEngine::runCurrentChapter() {
addObject(kItemPhone); addObject(kItemPhone);
trackProtagonist = 3; trackProtagonist = 3;
objExit = 162; objExit = 162;
if (hay_que_load == 0) if (loadedDifferentChapter == 0)
enterRoom(14); enterRoom(14);
else { else {
if (!loadGame(saveName)) { if (!loadGame(saveName)) {
@ -362,7 +359,7 @@ bool DrasculaEngine::runCurrentChapter() {
flags[1] = 1; flags[1] = 1;
trackProtagonist = 1; trackProtagonist = 1;
objExit = 99; objExit = 99;
if (hay_que_load == 0) if (loadedDifferentChapter == 0)
enterRoom(20); enterRoom(20);
else { else {
if (!loadGame(saveName)) { if (!loadGame(saveName)) {
@ -376,7 +373,7 @@ bool DrasculaEngine::runCurrentChapter() {
addObject(kItemReefer2); addObject(kItemReefer2);
addObject(kItemOneCoin2); addObject(kItemOneCoin2);
objExit = 100; objExit = 100;
if (hay_que_load == 0) { if (loadedDifferentChapter == 0) {
enterRoom(21); enterRoom(21);
trackProtagonist = 0; trackProtagonist = 0;
curX = 235; curX = 235;
@ -398,7 +395,7 @@ bool DrasculaEngine::runCurrentChapter() {
addObject(20); addObject(20);
trackProtagonist = 1; trackProtagonist = 1;
objExit = 100; objExit = 100;
if (hay_que_load == 0) { if (loadedDifferentChapter == 0) {
enterRoom(45); enterRoom(45);
} else { } else {
if (!loadGame(saveName)) { if (!loadGame(saveName)) {
@ -411,7 +408,7 @@ bool DrasculaEngine::runCurrentChapter() {
trackProtagonist = 1; trackProtagonist = 1;
objExit = 104; objExit = 104;
if (hay_que_load == 0) { if (loadedDifferentChapter == 0) {
enterRoom(58); enterRoom(58);
animation_1_6(); animation_1_6();
} else { } else {
@ -422,6 +419,8 @@ bool DrasculaEngine::runCurrentChapter() {
} }
} }
showCursor();
while (1) { while (1) {
if (characterMoved == 0) { if (characterMoved == 0) {
stepX = STEP_X; stepX = STEP_X;
@ -523,7 +522,7 @@ bool DrasculaEngine::runCurrentChapter() {
#ifndef _WIN32_WCE #ifndef _WIN32_WCE
updateEvents(); updateEvents();
#endif #endif
withoutVerb(); selectVerb(0);
} }
if (leftMouseButton == 1 && menuBar == 1) { if (leftMouseButton == 1 && menuBar == 1) {
@ -559,7 +558,7 @@ bool DrasculaEngine::runCurrentChapter() {
if (!saveLoadScreen()) if (!saveLoadScreen())
return true; return true;
} else if (key == Common::KEYCODE_F8) { } else if (key == Common::KEYCODE_F8) {
withoutVerb(); selectVerb(0);
} else if (key == Common::KEYCODE_v) { } else if (key == Common::KEYCODE_v) {
withVoices = 1; withVoices = 1;
print_abc(_textsys[2], 96, 86); print_abc(_textsys[2], 96, 86);

View file

@ -177,6 +177,11 @@ enum TalkSequenceCommands {
kTalkerBartender = 16 kTalkerBartender = 16
}; };
enum MouseCursors {
kCursorCrosshair = 0,
kCursorCurrentItem = 1
};
struct TalkSequenceCommand { struct TalkSequenceCommand {
int chapter; int chapter;
int sequence; int sequence;
@ -319,6 +324,9 @@ public:
DacPalette256 brightPalette; DacPalette256 brightPalette;
DacPalette256 darkPalette; DacPalette256 darkPalette;
byte *crosshairCursor;
byte *mouseCursor;
// Graphics buffers/pointers // Graphics buffers/pointers
byte *VGA; byte *VGA;
byte *bgSurface; byte *bgSurface;
@ -365,7 +373,8 @@ public:
int flags[NUM_FLAGS]; int flags[NUM_FLAGS];
int frame_y; int frame_y;
int curX, curY, characterMoved, curDirection, trackProtagonist, num_frame, hare_se_ve; int curX, curY, characterMoved, curDirection, trackProtagonist, num_frame;
int hare_se_ve; // TODO: what is this for?
int roomX, roomY, checkFlags; int roomX, roomY, checkFlags;
int doBreak; int doBreak;
int stepX, stepY; int stepX, stepY;
@ -390,7 +399,7 @@ public:
int framesWithoutAction; int framesWithoutAction;
int term_int; int term_int;
int currentChapter; int currentChapter;
int hay_que_load; int loadedDifferentChapter;
char saveName[13]; char saveName[13];
int _color; int _color;
int musicStopped; int musicStopped;
@ -414,7 +423,6 @@ public:
void openDoor(int nflag, int doorNum); void openDoor(int nflag, int doorNum);
void showMap(); void showMap();
void withoutVerb();
void enterRoom(int); void enterRoom(int);
void clearRoom(); void clearRoom();
void gotoObject(int, int); void gotoObject(int, int);
@ -494,7 +502,9 @@ public:
bool exitRoom(int); bool exitRoom(int);
bool pickupObject(); bool pickupObject();
bool checkAction(int); bool checkAction(int);
void setCursorTable(); void setCursor(int cursor);
void showCursor();
void hideCursor();
void enterName(); void enterName();
bool soundIsActive(); bool soundIsActive();
void waitFrameSSN(); void waitFrameSSN();

View file

@ -24,6 +24,7 @@
*/ */
#include "drascula/drascula.h" #include "drascula/drascula.h"
#include "graphics/cursorman.h"
namespace Drascula { namespace Drascula {
@ -47,6 +48,10 @@ void DrasculaEngine::allocMemory() {
assert(tableSurface); assert(tableSurface);
extraSurface = (byte *)malloc(64000); extraSurface = (byte *)malloc(64000);
assert(extraSurface); assert(extraSurface);
crosshairCursor = (byte *)malloc(40 * 25);
assert(crosshairCursor);
mouseCursor = (byte *)malloc(OBJWIDTH * OBJHEIGHT);
assert(mouseCursor);
} }
void DrasculaEngine::freeMemory() { void DrasculaEngine::freeMemory() {
@ -58,6 +63,8 @@ void DrasculaEngine::freeMemory() {
free(drawSurface3); free(drawSurface3);
free(extraSurface); free(extraSurface);
free(frontSurface); free(frontSurface);
free(crosshairCursor);
free(mouseCursor);
} }
void DrasculaEngine::moveCursor() { void DrasculaEngine::moveCursor() {
@ -78,14 +85,26 @@ void DrasculaEngine::moveCursor() {
showMenu(); showMenu();
else if (menuBar == 1) else if (menuBar == 1)
clearMenu(); clearMenu();
int cursorPos[6] = { 0, 0, mouseX - 20, mouseY - 17, OBJWIDTH, OBJHEIGHT };
copyRectClip(cursorPos, drawSurface3, screenSurface);
} }
void DrasculaEngine::setCursorTable() { void DrasculaEngine::setCursor(int cursor) {
int cursorPos[6] = { 225, 56, mouseX - 20, mouseY - 12, 40, 25 }; switch (cursor) {
copyRectClip(cursorPos, tableSurface, screenSurface); case kCursorCrosshair:
CursorMan.replaceCursor((const byte *)crosshairCursor, 40, 25, 0, 0);
break;
case kCursorCurrentItem:
CursorMan.replaceCursor((const byte *)mouseCursor, OBJWIDTH, OBJHEIGHT, 20, 17);
default:
break;
}
}
void DrasculaEngine::showCursor() {
CursorMan.showMouse(true);
}
void DrasculaEngine::hideCursor() {
CursorMan.showMouse(false);
} }
void DrasculaEngine::loadPic(const char *NamePcc, byte *targetSurface, int colorCount) { void DrasculaEngine::loadPic(const char *NamePcc, byte *targetSurface, int colorCount) {
@ -244,7 +263,7 @@ void DrasculaEngine::print_abc(const char *said, int screenX, int screenY) {
} // for } // for
int textPos[6] = { letterX, letterY, screenX, screenY, CHAR_WIDTH, CHAR_HEIGHT }; int textPos[6] = { letterX, letterY, screenX, screenY, CHAR_WIDTH, CHAR_HEIGHT };
copyRectClip(textPos, textSurface, screenSurface); copyRectClip(textPos, tableSurface, screenSurface);
screenX = screenX + CHAR_WIDTH; screenX = screenX + CHAR_WIDTH;
if (screenX > 317) { if (screenX > 317) {

View file

@ -36,7 +36,7 @@ void DrasculaEngine::selectVerbFromBar() {
} }
// no verb selected // no verb selected
withoutVerb(); selectVerb(0);
} }
void DrasculaEngine::selectVerb(int verb) { void DrasculaEngine::selectVerb(int verb) {
@ -50,10 +50,17 @@ void DrasculaEngine::selectVerb(int verb) {
addObject(pickedObject); addObject(pickedObject);
} }
copyBackground(OBJWIDTH * verb, c, 0, 0, OBJWIDTH, OBJHEIGHT, backSurface, drawSurface3); for (int i = 0; i < OBJHEIGHT; i++)
memcpy(mouseCursor + i * OBJWIDTH, backSurface + OBJWIDTH * verb + (c + i) * 320, OBJWIDTH);
setCursor(kCursorCurrentItem);
if (verb > 0) {
takeObject = 1; takeObject = 1;
pickedObject = verb; pickedObject = verb;
} else {
takeObject = 0;
hasName = 0;
}
} }
bool DrasculaEngine::confirmExit() { bool DrasculaEngine::confirmExit() {

View file

@ -51,7 +51,9 @@ void DrasculaEngine::chooseObject(int object) {
if (takeObject == 1 && menuScreen == 0) if (takeObject == 1 && menuScreen == 0)
addObject(pickedObject); addObject(pickedObject);
} }
copyBackground(_x1d_menu[object], _y1d_menu[object], 0, 0, OBJWIDTH,OBJHEIGHT, backSurface, drawSurface3); for (int i = 0; i < OBJHEIGHT; i++)
memcpy(mouseCursor + i * OBJWIDTH, backSurface + _x1d_menu[object] + (_y1d_menu[object] + i) * 320, OBJWIDTH);
setCursor(kCursorCurrentItem);
takeObject = 1; takeObject = 1;
pickedObject = object; pickedObject = object;
} }
@ -70,22 +72,6 @@ int DrasculaEngine::removeObject(int obj) {
return result; return result;
} }
void DrasculaEngine::withoutVerb() {
int c = (menuScreen == 1) ? 0 : 171;
if (currentChapter == 5) {
if (takeObject == 1 && pickedObject != 16)
addObject(pickedObject);
} else {
if (takeObject == 1)
addObject(pickedObject);
}
copyBackground(0, c, 0, 0, OBJWIDTH,OBJHEIGHT, backSurface, drawSurface3);
takeObject = 0;
hasName = 0;
}
void DrasculaEngine::gotoObject(int pointX, int pointY) { void DrasculaEngine::gotoObject(int pointX, int pointY) {
if (currentChapter == 5 || currentChapter == 6) { if (currentChapter == 5 || currentChapter == 6) {
if (hare_se_ve == 0) { if (hare_se_ve == 0) {
@ -186,7 +172,7 @@ bool DrasculaEngine::pickupObject() {
} }
updateEvents(); updateEvents();
if (takeObject == 0) if (takeObject == 0)
withoutVerb(); selectVerb(0);
return false; return false;
} }

View file

@ -554,7 +554,7 @@ bool DrasculaEngine::room_21(int fl) {
} else if(pickedObject == 7 && fl == 101) { } else if(pickedObject == 7 && fl == 101) {
flags[28] = 1; flags[28] = 1;
openDoor(0, 1); openDoor(0, 1);
withoutVerb(); selectVerb(0);
} else if (pickedObject == 21 && fl == 179) { } else if (pickedObject == 21 && fl == 179) {
animate("st.bin", 14); animate("st.bin", 14);
fadeToBlack(1); fadeToBlack(1);
@ -576,7 +576,7 @@ bool DrasculaEngine::room_22(int fl) {
playSound(1); playSound(1);
hiccup(14); hiccup(14);
finishSound(); finishSound();
withoutVerb(); selectVerb(0);
removeObject(22); removeObject(22);
updateVisible(); updateVisible();
trackProtagonist = 3; trackProtagonist = 3;
@ -687,7 +687,7 @@ bool DrasculaEngine::room_27(int fl) {
else if (pickedObject == 17 && fl == 116) { else if (pickedObject == 17 && fl == 116) {
flags[23] = 1; flags[23] = 1;
openDoor(5,3); openDoor(5,3);
withoutVerb(); selectVerb(0);
} else if (fl == 150) } else if (fl == 150)
talk(460); talk(460);
else else
@ -816,16 +816,16 @@ bool DrasculaEngine::room_53(int fl) {
} else if (pickedObject == 12 && fl == 52) { } else if (pickedObject == 12 && fl == 52) {
flags[3] = 1; flags[3] = 1;
talk(401); talk(401);
withoutVerb(); selectVerb(0);
removeObject(12); removeObject(12);
} else if (pickedObject == 15 && fl == 52) { } else if (pickedObject == 15 && fl == 52) {
flags[4] = 1; flags[4] = 1;
talk(401); talk(401);
withoutVerb(); selectVerb(0);
removeObject(15); removeObject(15);
} else if (pickedObject == 16 && fl == 121) { } else if (pickedObject == 16 && fl == 121) {
flags[2] = 1; flags[2] = 1;
withoutVerb(); selectVerb(0);
updateVisible(); updateVisible();
pickedObject = kVerbMove; pickedObject = kVerbMove;
} else if (pickedObject == 16) { } else if (pickedObject == 16) {
@ -864,7 +864,7 @@ bool DrasculaEngine::room_54(int fl) {
} else if (pickedObject == 10 && fl == 119) { } else if (pickedObject == 10 && fl == 119) {
pause(4); pause(4);
talk(436); talk(436);
withoutVerb(); selectVerb(0);
removeObject(10); removeObject(10);
} else } else
hasAnswer = 0; hasAnswer = 0;
@ -968,7 +968,7 @@ bool DrasculaEngine::room_59(int fl) {
loadPic(59, bgSurface, HALF_PAL); loadPic(59, bgSurface, HALF_PAL);
trackProtagonist = 3; trackProtagonist = 3;
talk(245); talk(245);
withoutVerb(); selectVerb(0);
flags[11] = 1; flags[11] = 1;
} }
} else } else
@ -991,11 +991,11 @@ bool DrasculaEngine::room_60(int fl) {
talk(266); talk(266);
talk_bartender(1, 1); talk_bartender(1, 1);
converse(12); converse(12);
withoutVerb(); selectVerb(0);
pickedObject = 0; pickedObject = 0;
} else if (pickedObject == 21 && fl == 56) { } else if (pickedObject == 21 && fl == 56) {
flags[6] = 1; flags[6] = 1;
withoutVerb(); selectVerb(0);
removeObject(21); removeObject(21);
animate("beb.bin", 10); animate("beb.bin", 10);
} else if (pickedObject == 9 && fl == 56 && flags[6] == 1) { } else if (pickedObject == 9 && fl == 56 && flags[6] == 1) {
@ -1482,6 +1482,7 @@ void DrasculaEngine::update_102() {
} }
bool DrasculaEngine::checkAction(int fl) { bool DrasculaEngine::checkAction(int fl) {
hideCursor();
characterMoved = 0; characterMoved = 0;
updateRoom(); updateRoom();
updateScreen(); updateScreen();
@ -1500,7 +1501,7 @@ bool DrasculaEngine::checkAction(int fl) {
|| (pickedObject == kVerbOpen && fl == 22 && flags[23] == 0)) { || (pickedObject == kVerbOpen && fl == 22 && flags[23] == 0)) {
talk(164); talk(164);
flags[23] = 1; flags[23] = 1;
withoutVerb(); selectVerb(0);
addObject(kItemMoney); addObject(kItemMoney);
addObject(kItemTwoCoins); addObject(kItemTwoCoins);
} else if (pickedObject == kVerbLook && fl == 22 && flags[23] == 1) } else if (pickedObject == kVerbLook && fl == 22 && flags[23] == 1)
@ -1511,7 +1512,7 @@ bool DrasculaEngine::checkAction(int fl) {
hasAnswer = 0; hasAnswer = 0;
} else if (currentChapter == 4) { } else if (currentChapter == 4) {
if ((pickedObject == 18 && fl == 19) || (pickedObject == 19 && fl == 18)) { if ((pickedObject == 18 && fl == 19) || (pickedObject == 19 && fl == 18)) {
withoutVerb(); selectVerb(0);
chooseObject(21); chooseObject(21);
removeObject(18); removeObject(18);
removeObject(19); removeObject(19);
@ -1547,8 +1548,10 @@ bool DrasculaEngine::checkAction(int fl) {
hasAnswer = 0; hasAnswer = 0;
} else if (currentChapter == 3) { } else if (currentChapter == 3) {
if (roomNumber == 13) { if (roomNumber == 13) {
if (room(13, fl)) if (room(13, fl)) {
showCursor();
return true; return true;
}
} else } else
hasAnswer = 0; hasAnswer = 0;
} else if (currentChapter == 4) { } else if (currentChapter == 4) {
@ -1559,14 +1562,18 @@ bool DrasculaEngine::checkAction(int fl) {
else if (pickedObject == 12 && fl == 50 && flags[18] == 0) else if (pickedObject == 12 && fl == 50 && flags[18] == 0)
talk(487); talk(487);
else if (roomNumber == 21) { else if (roomNumber == 21) {
if (room(21, fl)) if (room(21, fl)) {
showCursor();
return true; return true;
}
} else } else
hasAnswer = 0; hasAnswer = 0;
} else if (currentChapter == 5) { } else if (currentChapter == 5) {
if (roomNumber == 56) { if (roomNumber == 56) {
if (room(56, fl)) if (room(56, fl)) {
showCursor();
return true; return true;
}
} else } else
hasAnswer = 0; hasAnswer = 0;
} else if (currentChapter == 6) { } else if (currentChapter == 6) {
@ -1577,9 +1584,11 @@ bool DrasculaEngine::checkAction(int fl) {
else if (roomNumber == 102) else if (roomNumber == 102)
room(102, fl); room(102, fl);
else if (roomNumber == 60) { else if (roomNumber == 60) {
if (room(60, fl)) if (room(60, fl)) {
showCursor();
return true; return true;
} }
}
else else
hasAnswer = 0; hasAnswer = 0;
} }
@ -1594,6 +1603,7 @@ bool DrasculaEngine::checkAction(int fl) {
if (hasAnswer == 0 && (hasName == 1 || menuScreen == 1)) if (hasAnswer == 0 && (hasName == 1 || menuScreen == 1))
room(0, -1); room(0, -1);
showCursor();
return false; return false;
} }
@ -1619,6 +1629,7 @@ bool DrasculaEngine::room(int rN, int fl) {
void DrasculaEngine::enterRoom(int roomIndex) { void DrasculaEngine::enterRoom(int roomIndex) {
debug(2, "Entering room %d", roomIndex); debug(2, "Entering room %d", roomIndex);
showCursor();
char fileName[20]; char fileName[20];
sprintf(fileName, "%d.ald", roomIndex); sprintf(fileName, "%d.ald", roomIndex);
@ -1872,6 +1883,7 @@ void DrasculaEngine::clearRoom() {
bool DrasculaEngine::exitRoom(int l) { bool DrasculaEngine::exitRoom(int l) {
debug(2, "Exiting room from door %d", l); debug(2, "Exiting room from door %d", l);
hideCursor();
int roomNum = 0; int roomNum = 0;
@ -2022,7 +2034,7 @@ void DrasculaEngine::openDoor(int nflag, int doorNum) {
updateRoom(); updateRoom();
updateScreen(); updateScreen();
finishSound(); finishSound();
withoutVerb(); selectVerb(0);
} }
} }
@ -2035,7 +2047,7 @@ void DrasculaEngine::closeDoor(int nflag, int doorNum) {
updateRoom(); updateRoom();
updateScreen(); updateScreen();
finishSound(); finishSound();
withoutVerb(); selectVerb(0);
} }
} }

View file

@ -60,6 +60,7 @@ bool DrasculaEngine::saveLoadScreen() {
select[0] = 0; select[0] = 0;
_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true); _system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
setCursor(kCursorCrosshair);
for (;;) { for (;;) {
y = 27; y = 27;
@ -69,7 +70,6 @@ bool DrasculaEngine::saveLoadScreen() {
y = y + 9; y = y + 9;
} }
print_abc(select, 117, 15); print_abc(select, 117, 15);
setCursorTable();
updateScreen(); updateScreen();
y = 27; y = 27;
@ -172,6 +172,8 @@ bool DrasculaEngine::saveLoadScreen() {
delay(5); delay(5);
} }
selectVerb(0);
clearRoom(); clearRoom();
loadPic(roomNumber, bgSurface, HALF_PAL); loadPic(roomNumber, bgSurface, HALF_PAL);
selectionMade = 0; selectionMade = 0;
@ -198,7 +200,7 @@ bool DrasculaEngine::loadGame(const char *gameName) {
if (savedChapter != currentChapter) { if (savedChapter != currentChapter) {
strcpy(saveName, gameName); strcpy(saveName, gameName);
currentChapter = savedChapter - 1; currentChapter = savedChapter - 1;
hay_que_load = 1; loadedDifferentChapter = 1;
return false; return false;
} }
sav->read(currentData, 20); sav->read(currentData, 20);
@ -216,10 +218,10 @@ bool DrasculaEngine::loadGame(const char *gameName) {
takeObject = sav->readSint32LE(); takeObject = sav->readSint32LE();
pickedObject = sav->readSint32LE(); pickedObject = sav->readSint32LE();
hay_que_load = 0; loadedDifferentChapter = 0;
sscanf(currentData, "%d.ald", &roomNum); sscanf(currentData, "%d.ald", &roomNum);
enterRoom(roomNum); enterRoom(roomNum);
withoutVerb(); selectVerb(0);
return true; return true;
} }

View file

@ -37,9 +37,15 @@ void DrasculaEngine::updateVolume(Audio::Mixer::SoundType soundType, int prevVol
} }
void DrasculaEngine::volumeControls() { void DrasculaEngine::volumeControls() {
if (_lang == kSpanish)
loadPic(95, tableSurface);
copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface); copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface);
updateScreen(73, 63, 73, 63, 177, 97, screenSurface); updateScreen(73, 63, 73, 63, 177, 97, screenSurface);
setCursor(kCursorCrosshair);
showCursor();
for (;;) { for (;;) {
int masterVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16), 0, 15); int masterVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16), 0, 15);
int voiceVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16), 0, 15); int voiceVolume = CLIP((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16), 0, 15);
@ -57,8 +63,6 @@ void DrasculaEngine::volumeControls() {
copyBackground(183, 56, 138, voiceVolumeY, 39, 2 + voiceVolume * 4, tableSurface, screenSurface); copyBackground(183, 56, 138, voiceVolumeY, 39, 2 + voiceVolume * 4, tableSurface, screenSurface);
copyBackground(183, 56, 194, musicVolumeY, 39, 2 + musicVolume * 4, tableSurface, screenSurface); copyBackground(183, 56, 194, musicVolumeY, 39, 2 + musicVolume * 4, tableSurface, screenSurface);
setCursorTable();
updateScreen(); updateScreen();
updateEvents(); updateEvents();
@ -84,6 +88,11 @@ void DrasculaEngine::volumeControls() {
} }
if (_lang == kSpanish)
loadPic(974, tableSurface);
selectVerb(0);
updateEvents(); updateEvents();
} }