- Removed the unused hay_sb variable (originally, it was meant to check if the sound is active or not)
- mesa -> volumeControls - Cleanup of volumeControls() - fliplay -> playFLI, and removed openSSN() and EndSSN() - Some translations: button_izq -> leftMouseButton button_dch -> rightMouseButton animation_rayo -> animation_ray hueso -> bone vuela -> fly svn-id: r32552
This commit is contained in:
parent
5acc34fb77
commit
fe2fcbf2d5
4 changed files with 97 additions and 137 deletions
|
@ -58,7 +58,7 @@ void DrasculaEngine::animation_1_1() {
|
||||||
|
|
||||||
while (term_int == 0) {
|
while (term_int == 0) {
|
||||||
playMusic(29);
|
playMusic(29);
|
||||||
fliplay("logoddm.bin", 9);
|
playFLI("logoddm.bin", 9);
|
||||||
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
|
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
|
||||||
break;
|
break;
|
||||||
delay(600);
|
delay(600);
|
||||||
|
@ -72,7 +72,7 @@ void DrasculaEngine::animation_1_1() {
|
||||||
delay(500);
|
delay(500);
|
||||||
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
|
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
|
||||||
break;
|
break;
|
||||||
fliplay("logoalc.bin", 8);
|
playFLI("logoalc.bin", 8);
|
||||||
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
|
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
|
||||||
break;
|
break;
|
||||||
clearRoom();
|
clearRoom();
|
||||||
|
@ -97,7 +97,7 @@ void DrasculaEngine::animation_1_1() {
|
||||||
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
|
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
fliplay("scrollb.bin", 9);
|
playFLI("scrollb.bin", 9);
|
||||||
|
|
||||||
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
|
if ((term_int == 1) || (getScan() == Common::KEYCODE_ESCAPE))
|
||||||
break;
|
break;
|
||||||
|
@ -373,7 +373,7 @@ void DrasculaEngine::animation_1_1() {
|
||||||
|
|
||||||
playMusic(2);
|
playMusic(2);
|
||||||
pause(5);
|
pause(5);
|
||||||
fliplay("intro.bin", 12);
|
playFLI("intro.bin", 12);
|
||||||
term_int = 1;
|
term_int = 1;
|
||||||
}
|
}
|
||||||
clearRoom();
|
clearRoom();
|
||||||
|
@ -1419,7 +1419,7 @@ void DrasculaEngine::animation_6_3() {
|
||||||
updateScreen();
|
updateScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrasculaEngine::animation_rayo() {
|
void DrasculaEngine::animation_ray() {
|
||||||
loadPic("anr_1.alg", frontSurface, HALF_PAL);
|
loadPic("anr_1.alg", frontSurface, HALF_PAL);
|
||||||
loadPic("anr_2.alg", extraSurface);
|
loadPic("anr_2.alg", extraSurface);
|
||||||
loadPic("anr_3.alg", backSurface);
|
loadPic("anr_3.alg", backSurface);
|
||||||
|
@ -1556,9 +1556,9 @@ void DrasculaEngine::animation_4_5() {
|
||||||
void DrasculaEngine::animation_5_5(){
|
void DrasculaEngine::animation_5_5(){
|
||||||
int h;
|
int h;
|
||||||
int frame = 0;
|
int frame = 0;
|
||||||
int hueso_x[] = {1, 99, 197, 1, 99, 197, 1, 99, 197};
|
int boneX[] = {1, 99, 197, 1, 99, 197, 1, 99, 197};
|
||||||
int hueso_y[] = {1, 1, 1, 66, 66, 66, 131, 131, 131};
|
int boneY[] = {1, 1, 1, 66, 66, 66, 131, 131, 131};
|
||||||
int vuela_x[] = {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();
|
withoutVerb();
|
||||||
|
@ -1575,7 +1575,7 @@ void DrasculaEngine::animation_5_5(){
|
||||||
for (frame = 0; frame < 9; frame++) {
|
for (frame = 0; frame < 9; frame++) {
|
||||||
pause(3);
|
pause(3);
|
||||||
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
|
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
|
||||||
copyRect(hueso_x[frame], hueso_y[frame], pixelX, pixelY, 97, 64, backSurface, screenSurface);
|
copyRect(boneX[frame], boneY[frame], pixelX, pixelY, 97, 64, backSurface, screenSurface);
|
||||||
updateScreen(pixelX, pixelY, pixelX,pixelY, 97,64, screenSurface);
|
updateScreen(pixelX, pixelY, pixelX,pixelY, 97,64, screenSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1585,7 +1585,7 @@ void DrasculaEngine::animation_5_5(){
|
||||||
for (frame = 0; frame < 9; frame++) {
|
for (frame = 0; frame < 9; frame++) {
|
||||||
pause(3);
|
pause(3);
|
||||||
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
|
copyBackground(0, 0, 0, 0, 320, 200, drawSurface1, screenSurface);
|
||||||
copyRect(hueso_x[frame], hueso_y[frame], pixelX, pixelY, 97, 64, frontSurface, screenSurface);
|
copyRect(boneX[frame], boneY[frame], pixelX, pixelY, 97, 64, frontSurface, screenSurface);
|
||||||
updateScreen(pixelX, pixelY, pixelX,pixelY, 97, 64, screenSurface);
|
updateScreen(pixelX, pixelY, pixelX,pixelY, 97, 64, screenSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1607,12 +1607,12 @@ void DrasculaEngine::animation_5_5(){
|
||||||
pause(9);
|
pause(9);
|
||||||
for (frame = 0; frame < 5; frame++) {
|
for (frame = 0; frame < 5; frame++) {
|
||||||
pause(3);
|
pause(3);
|
||||||
copyBackground(vuela_x[frame], 1, 174, 79, 61, 109, backSurface, screenSurface);
|
copyBackground(flyX[frame], 1, 174, 79, 61, 109, backSurface, screenSurface);
|
||||||
updateScreen(174, 79, 174, 79, 61, 109, screenSurface);
|
updateScreen(174, 79, 174, 79, 61, 109, screenSurface);
|
||||||
}
|
}
|
||||||
for (frame = 0; frame < 5; frame++) {
|
for (frame = 0; frame < 5; frame++) {
|
||||||
pause(3);
|
pause(3);
|
||||||
copyBackground(vuela_x[frame], 1, 174, 79, 61, 109, extraSurface, screenSurface);
|
copyBackground(flyX[frame], 1, 174, 79, 61, 109, extraSurface, screenSurface);
|
||||||
updateScreen(174, 79, 174, 79, 61, 109, screenSurface);
|
updateScreen(174, 79, 174, 79, 61, 109, screenSurface);
|
||||||
}
|
}
|
||||||
updateScreen(0, 0, 0, 0, 320, 200, drawSurface1);
|
updateScreen(0, 0, 0, 0, 320, 200, drawSurface1);
|
||||||
|
@ -1682,7 +1682,6 @@ void DrasculaEngine::animation_12_5() {
|
||||||
const int rayX[] = {1, 46, 91, 136, 181, 226, 271, 181};
|
const int rayX[] = {1, 46, 91, 136, 181, 226, 271, 181};
|
||||||
const int frusky_x[] = {100, 139, 178, 217, 100, 178, 217, 139, 100, 139};
|
const int frusky_x[] = {100, 139, 178, 217, 100, 178, 217, 139, 100, 139};
|
||||||
const int elfrusky_x[] = {1, 68, 135, 1, 68, 135, 1, 68, 135, 68, 1, 135, 68, 135, 68};
|
const int elfrusky_x[] = {1, 68, 135, 1, 68, 135, 1, 68, 135, 68, 1, 135, 68, 135, 68};
|
||||||
//const int humo_x[] = {1, 29, 57, 85, 113, 141, 169, 197, 225};
|
|
||||||
int color, component;
|
int color, component;
|
||||||
char fade;
|
char fade;
|
||||||
|
|
||||||
|
@ -2076,13 +2075,13 @@ void DrasculaEngine::animation_9_6() {
|
||||||
playMusic(17);
|
playMusic(17);
|
||||||
fadeToBlack(1);
|
fadeToBlack(1);
|
||||||
clearRoom();
|
clearRoom();
|
||||||
fliplay("qpc.bin", 1);
|
playFLI("qpc.bin", 1);
|
||||||
MusicFadeout();
|
MusicFadeout();
|
||||||
stopMusic();
|
stopMusic();
|
||||||
clearRoom();
|
clearRoom();
|
||||||
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, v_cd * 16);
|
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, v_cd * 16);
|
||||||
playMusic(3);
|
playMusic(3);
|
||||||
fliplay("crd.bin", 1);
|
playFLI("crd.bin", 1);
|
||||||
stopMusic();
|
stopMusic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,6 @@ int DrasculaEngine::go() {
|
||||||
|
|
||||||
allocMemory();
|
allocMemory();
|
||||||
|
|
||||||
hay_sb = 1;
|
|
||||||
withVoices = 0;
|
withVoices = 0;
|
||||||
selectionMade = 0;
|
selectionMade = 0;
|
||||||
|
|
||||||
|
@ -169,7 +168,7 @@ int DrasculaEngine::go() {
|
||||||
} else if (currentChapter == 4) {
|
} else if (currentChapter == 4) {
|
||||||
loadPic(96, frontSurface, COMPLETE_PAL);
|
loadPic(96, frontSurface, COMPLETE_PAL);
|
||||||
if (hay_que_load == 0)
|
if (hay_que_load == 0)
|
||||||
animation_rayo();
|
animation_ray();
|
||||||
loadPic(96, frontSurface);
|
loadPic(96, frontSurface);
|
||||||
clearRoom();
|
clearRoom();
|
||||||
loadPic(99, backSurface);
|
loadPic(99, backSurface);
|
||||||
|
@ -212,8 +211,7 @@ int DrasculaEngine::go() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrasculaEngine::quitGame() {
|
void DrasculaEngine::quitGame() {
|
||||||
if (hay_sb == 1)
|
stopSound();
|
||||||
stopSound();
|
|
||||||
clearRoom();
|
clearRoom();
|
||||||
black();
|
black();
|
||||||
MusicFadeout();
|
MusicFadeout();
|
||||||
|
@ -569,7 +567,7 @@ bool DrasculaEngine::escoba() {
|
||||||
if (menuScreen == 0 && takeObject == 1)
|
if (menuScreen == 0 && takeObject == 1)
|
||||||
checkObjects();
|
checkObjects();
|
||||||
|
|
||||||
if (button_dch == 1 && menuScreen == 1) {
|
if (rightMouseButton == 1 && menuScreen == 1) {
|
||||||
delay(100);
|
delay(100);
|
||||||
if (currentChapter == 2)
|
if (currentChapter == 2)
|
||||||
loadPic(menuBackground, backSurface);
|
loadPic(menuBackground, backSurface);
|
||||||
|
@ -581,7 +579,7 @@ bool DrasculaEngine::escoba() {
|
||||||
if (currentChapter != 3)
|
if (currentChapter != 3)
|
||||||
cont_sv = 0;
|
cont_sv = 0;
|
||||||
}
|
}
|
||||||
if (button_dch == 1 && menuScreen == 0) {
|
if (rightMouseButton == 1 && menuScreen == 0) {
|
||||||
delay(100);
|
delay(100);
|
||||||
characterMoved = 0;
|
characterMoved = 0;
|
||||||
if (trackProtagonist == 2)
|
if (trackProtagonist == 2)
|
||||||
|
@ -601,18 +599,18 @@ bool DrasculaEngine::escoba() {
|
||||||
cont_sv = 0;
|
cont_sv = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (button_izq == 1 && menuBar == 1) {
|
if (leftMouseButton == 1 && menuBar == 1) {
|
||||||
delay(100);
|
delay(100);
|
||||||
selectVerbFromBar();
|
selectVerbFromBar();
|
||||||
if (currentChapter != 3)
|
if (currentChapter != 3)
|
||||||
cont_sv = 0;
|
cont_sv = 0;
|
||||||
} else if (button_izq == 1 && takeObject == 0) {
|
} else if (leftMouseButton == 1 && takeObject == 0) {
|
||||||
delay(100);
|
delay(100);
|
||||||
if (verify1())
|
if (verify1())
|
||||||
return true;
|
return true;
|
||||||
if (currentChapter != 3)
|
if (currentChapter != 3)
|
||||||
cont_sv = 0;
|
cont_sv = 0;
|
||||||
} else if (button_izq == 1 && takeObject == 1) {
|
} else if (leftMouseButton == 1 && takeObject == 1) {
|
||||||
if (verify2())
|
if (verify2())
|
||||||
return true;
|
return true;
|
||||||
if (currentChapter != 3)
|
if (currentChapter != 3)
|
||||||
|
@ -646,7 +644,7 @@ bool DrasculaEngine::escoba() {
|
||||||
if (currentChapter != 3)
|
if (currentChapter != 3)
|
||||||
cont_sv = 0;
|
cont_sv = 0;
|
||||||
} else if (key == Common::KEYCODE_F9) {
|
} else if (key == Common::KEYCODE_F9) {
|
||||||
mesa();
|
volumeControls();
|
||||||
if (currentChapter != 3)
|
if (currentChapter != 3)
|
||||||
cont_sv = 0;
|
cont_sv = 0;
|
||||||
} else if (key == Common::KEYCODE_F10) {
|
} else if (key == Common::KEYCODE_F10) {
|
||||||
|
@ -1092,16 +1090,9 @@ void DrasculaEngine::checkObjects() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentChapter == 2) {
|
if (mouseX > curX + 2 && mouseY > curY + 2
|
||||||
if (mouseX > curX + 2 && mouseY > curY + 2
|
&& mouseX < curX + curWidth - 2 && mouseY < curY + curHeight - 2) {
|
||||||
&& mouseX < curX + curWidth - 2 && mouseY < curY + curHeight - 2) {
|
if (currentChapter == 2 || veo == 0) {
|
||||||
strcpy(textName, "hacker");
|
|
||||||
hasName = 1;
|
|
||||||
veo = 1;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (mouseX > curX + 2 && mouseY > curY + 2
|
|
||||||
&& mouseX < curX + curWidth - 2 && mouseY < curY + curHeight - 2 && veo == 0) {
|
|
||||||
strcpy(textName, "hacker");
|
strcpy(textName, "hacker");
|
||||||
hasName = 1;
|
hasName = 1;
|
||||||
veo = 1;
|
veo = 1;
|
||||||
|
@ -1221,16 +1212,16 @@ void DrasculaEngine::updateEvents() {
|
||||||
mouseY = event.mouse.y;
|
mouseY = event.mouse.y;
|
||||||
break;
|
break;
|
||||||
case Common::EVENT_LBUTTONDOWN:
|
case Common::EVENT_LBUTTONDOWN:
|
||||||
button_izq = 1;
|
leftMouseButton = 1;
|
||||||
break;
|
break;
|
||||||
case Common::EVENT_LBUTTONUP:
|
case Common::EVENT_LBUTTONUP:
|
||||||
button_izq = 0;
|
leftMouseButton = 0;
|
||||||
break;
|
break;
|
||||||
case Common::EVENT_RBUTTONDOWN:
|
case Common::EVENT_RBUTTONDOWN:
|
||||||
button_dch = 1;
|
rightMouseButton = 1;
|
||||||
break;
|
break;
|
||||||
case Common::EVENT_RBUTTONUP:
|
case Common::EVENT_RBUTTONUP:
|
||||||
button_dch = 0;
|
rightMouseButton = 0;
|
||||||
break;
|
break;
|
||||||
case Common::EVENT_QUIT:
|
case Common::EVENT_QUIT:
|
||||||
// TODO
|
// TODO
|
||||||
|
@ -1244,10 +1235,8 @@ void DrasculaEngine::updateEvents() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrasculaEngine::selectVerb(int verbo) {
|
void DrasculaEngine::selectVerb(int verbo) {
|
||||||
int c = 171;
|
int c = (menuScreen == 1) ? 0 : 171;
|
||||||
|
|
||||||
if (menuScreen == 1)
|
|
||||||
c = 0;
|
|
||||||
if (currentChapter == 5) {
|
if (currentChapter == 5) {
|
||||||
if (takeObject == 1 && pickedObject != 16)
|
if (takeObject == 1 && pickedObject != 16)
|
||||||
addObject(pickedObject);
|
addObject(pickedObject);
|
||||||
|
@ -1262,24 +1251,33 @@ void DrasculaEngine::selectVerb(int verbo) {
|
||||||
pickedObject = verbo;
|
pickedObject = verbo;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrasculaEngine::mesa() {
|
void DrasculaEngine::updateVolume(Audio::Mixer::SoundType soundType, int prevVolume) {
|
||||||
int nivel_master, nivel_voc, nivel_cd;
|
int vol = _mixer->getVolumeForSoundType(soundType) / 16;
|
||||||
|
if (mouseY < prevVolume && vol < 15)
|
||||||
|
vol++;
|
||||||
|
if (mouseY > prevVolume && vol > 0)
|
||||||
|
vol--;
|
||||||
|
_mixer->setVolumeForSoundType(soundType, vol * 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DrasculaEngine::volumeControls() {
|
||||||
|
int masterVolume, voiceVolume, musicVolume;
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
for (;;) {
|
masterVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4);
|
||||||
nivel_master = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4);
|
voiceVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4);
|
||||||
nivel_voc = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4);
|
musicVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4);
|
||||||
nivel_cd = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4);
|
|
||||||
|
|
||||||
|
for (;;) {
|
||||||
updateRoom();
|
updateRoom();
|
||||||
|
|
||||||
copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface);
|
copyRect(1, 56, 73, 63, 177, 97, tableSurface, screenSurface);
|
||||||
|
|
||||||
copyBackground(183, 56, 82, nivel_master, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4), tableSurface, screenSurface);
|
copyBackground(183, 56, 82, masterVolume, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4), tableSurface, screenSurface);
|
||||||
copyBackground(183, 56, 138, nivel_voc, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4), tableSurface, screenSurface);
|
copyBackground(183, 56, 138, voiceVolume, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4), tableSurface, screenSurface);
|
||||||
copyBackground(183, 56, 194, nivel_cd, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4), tableSurface, screenSurface);
|
copyBackground(183, 56, 194, musicVolume, 39, 2 + ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4), tableSurface, screenSurface);
|
||||||
|
|
||||||
setCursorTable();
|
setCursorTable();
|
||||||
|
|
||||||
|
@ -1287,37 +1285,25 @@ void DrasculaEngine::mesa() {
|
||||||
|
|
||||||
updateEvents();
|
updateEvents();
|
||||||
|
|
||||||
if (button_dch == 1) {
|
if (rightMouseButton == 1) {
|
||||||
delay(100);
|
delay(100);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (button_izq == 1) {
|
if (leftMouseButton == 1) {
|
||||||
delay(100);
|
delay(100);
|
||||||
if (mouseX > 80 && mouseX < 121) {
|
if (mouseX > 80 && mouseX < 121) {
|
||||||
int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16;
|
updateVolume(Audio::Mixer::kPlainSoundType, mouseY);
|
||||||
if (mouseY < nivel_master && vol < 15)
|
masterVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kPlainSoundType) / 16) * 4);
|
||||||
vol++;
|
|
||||||
if (mouseY > nivel_master && vol > 0)
|
|
||||||
vol--;
|
|
||||||
_mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, vol * 16);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mouseX > 136 && mouseX < 178) {
|
if (mouseX > 136 && mouseX < 178) {
|
||||||
int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16;
|
updateVolume(Audio::Mixer::kSFXSoundType, mouseY);
|
||||||
if (mouseY < nivel_voc && vol < 15)
|
voiceVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 16) * 4);
|
||||||
vol++;
|
|
||||||
if (mouseY > nivel_voc && vol > 0)
|
|
||||||
vol--;
|
|
||||||
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, vol * 16);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mouseX > 192 && mouseX < 233) {
|
if (mouseX > 192 && mouseX < 233) {
|
||||||
int vol = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16;
|
updateVolume(Audio::Mixer::kMusicSoundType, mouseY);
|
||||||
if (mouseY < nivel_cd && vol < 15)
|
musicVolume = 72 + 61 - ((_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 16) * 4);
|
||||||
vol++;
|
|
||||||
if (mouseY > nivel_cd && vol > 0)
|
|
||||||
vol--;
|
|
||||||
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, vol * 16);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1372,7 +1358,7 @@ bool DrasculaEngine::saveLoadScreen() {
|
||||||
|
|
||||||
updateEvents();
|
updateEvents();
|
||||||
|
|
||||||
if (button_izq == 1) {
|
if (leftMouseButton == 1) {
|
||||||
delay(50);
|
delay(50);
|
||||||
for (n = 0; n < NUM_SAVES; n++) {
|
for (n = 0; n < NUM_SAVES; n++) {
|
||||||
if (mouseX > 115 && mouseY > y + (9 * n) && mouseX < 115 + 175 && mouseY < y + 10 + (9 * n)) {
|
if (mouseX > 115 && mouseY > y + (9 * n) && mouseX < 115 + 175 && mouseY < y + 10 + (9 * n)) {
|
||||||
|
@ -1662,7 +1648,7 @@ void DrasculaEngine::screenSaver() {
|
||||||
// end of efecto()
|
// end of efecto()
|
||||||
|
|
||||||
updateEvents();
|
updateEvents();
|
||||||
if (button_dch == 1 || button_izq == 1)
|
if (rightMouseButton == 1 || leftMouseButton == 1)
|
||||||
break;
|
break;
|
||||||
if (mouseX != xr)
|
if (mouseX != xr)
|
||||||
break;
|
break;
|
||||||
|
@ -1676,13 +1662,28 @@ void DrasculaEngine::screenSaver() {
|
||||||
loadPic(roomNumber, drawSurface1, HALF_PAL);
|
loadPic(roomNumber, drawSurface1, HALF_PAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrasculaEngine::fliplay(const char *filefli, int vel) {
|
void DrasculaEngine::playFLI(const char *filefli, int vel) {
|
||||||
openSSN(filefli, vel);
|
// Open file
|
||||||
|
MiVideoSSN = (byte *)malloc(64256);
|
||||||
|
globalSpeed = 1000 / vel;
|
||||||
|
FrameSSN = 0;
|
||||||
|
UsingMem = 0;
|
||||||
|
if (MiVideoSSN == NULL)
|
||||||
|
return;
|
||||||
|
_arj.open(filefli);
|
||||||
|
mSession = TryInMem();
|
||||||
|
LastFrame = _system->getMillis();
|
||||||
|
|
||||||
while (playFrameSSN() && (!term_int)) {
|
while (playFrameSSN() && (!term_int)) {
|
||||||
if (getScan() == Common::KEYCODE_ESCAPE)
|
if (getScan() == Common::KEYCODE_ESCAPE)
|
||||||
term_int = 1;
|
term_int = 1;
|
||||||
}
|
}
|
||||||
EndSSN();
|
|
||||||
|
free(MiVideoSSN);
|
||||||
|
if (UsingMem)
|
||||||
|
free(pointer);
|
||||||
|
else
|
||||||
|
_arj.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrasculaEngine::fadeFromBlack(int fadeSpeed) {
|
void DrasculaEngine::fadeFromBlack(int fadeSpeed) {
|
||||||
|
@ -1797,8 +1798,7 @@ void DrasculaEngine::playSound(int soundNum) {
|
||||||
char file[20];
|
char file[20];
|
||||||
sprintf(file, "s%i.als", soundNum);
|
sprintf(file, "s%i.als", soundNum);
|
||||||
|
|
||||||
if (hay_sb == 1)
|
playFile(file);
|
||||||
playFile(file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DrasculaEngine::animate(const char *animationFile, int FPS) {
|
bool DrasculaEngine::animate(const char *animationFile, int FPS) {
|
||||||
|
@ -1974,10 +1974,8 @@ void DrasculaEngine::hiccup(int counter) {
|
||||||
void DrasculaEngine::finishSound() {
|
void DrasculaEngine::finishSound() {
|
||||||
delay(1);
|
delay(1);
|
||||||
|
|
||||||
if (hay_sb == 1) {
|
while (soundIsActive())
|
||||||
while (soundIsActive())
|
_system->delayMillis(10);
|
||||||
_system->delayMillis(10);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrasculaEngine::playMusic(int p) {
|
void DrasculaEngine::playMusic(int p) {
|
||||||
|
@ -2636,18 +2634,6 @@ void DrasculaEngine::enterName() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrasculaEngine::openSSN(const char *Name, int Pause) {
|
|
||||||
MiVideoSSN = (byte *)malloc(64256);
|
|
||||||
globalSpeed = 1000 / Pause;
|
|
||||||
FrameSSN = 0;
|
|
||||||
UsingMem = 0;
|
|
||||||
if (MiVideoSSN == NULL)
|
|
||||||
return;
|
|
||||||
_arj.open(Name);
|
|
||||||
mSession = TryInMem();
|
|
||||||
LastFrame = _system->getMillis();
|
|
||||||
}
|
|
||||||
|
|
||||||
int DrasculaEngine::playFrameSSN() {
|
int DrasculaEngine::playFrameSSN() {
|
||||||
int Exit = 0;
|
int Exit = 0;
|
||||||
uint32 Lengt;
|
uint32 Lengt;
|
||||||
|
@ -2742,15 +2728,6 @@ int DrasculaEngine::playFrameSSN() {
|
||||||
return (!Exit);
|
return (!Exit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrasculaEngine::EndSSN() {
|
|
||||||
free(MiVideoSSN);
|
|
||||||
if (UsingMem)
|
|
||||||
free(pointer);
|
|
||||||
else {
|
|
||||||
_arj.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
byte *DrasculaEngine::TryInMem() {
|
byte *DrasculaEngine::TryInMem() {
|
||||||
int Lengt;
|
int Lengt;
|
||||||
|
|
||||||
|
@ -3201,7 +3178,7 @@ void DrasculaEngine::converse(const char *fileName) {
|
||||||
|
|
||||||
updateScreen();
|
updateScreen();
|
||||||
|
|
||||||
if ((button_izq == 1) && (game1 == 2)) {
|
if ((leftMouseButton == 1) && (game1 == 2)) {
|
||||||
delay(100);
|
delay(100);
|
||||||
used1 = 1;
|
used1 = 1;
|
||||||
talk(phrase1, sound1);
|
talk(phrase1, sound1);
|
||||||
|
@ -3209,7 +3186,7 @@ void DrasculaEngine::converse(const char *fileName) {
|
||||||
grr();
|
grr();
|
||||||
else
|
else
|
||||||
response(answer1);
|
response(answer1);
|
||||||
} else if ((button_izq == 1) && (game2 == 2)) {
|
} else if ((leftMouseButton == 1) && (game2 == 2)) {
|
||||||
delay(100);
|
delay(100);
|
||||||
used2 = 1;
|
used2 = 1;
|
||||||
talk(phrase2, sound2);
|
talk(phrase2, sound2);
|
||||||
|
@ -3217,7 +3194,7 @@ void DrasculaEngine::converse(const char *fileName) {
|
||||||
grr();
|
grr();
|
||||||
else
|
else
|
||||||
response(answer2);
|
response(answer2);
|
||||||
} else if ((button_izq == 1) && (game3 == 2)) {
|
} else if ((leftMouseButton == 1) && (game3 == 2)) {
|
||||||
delay(100);
|
delay(100);
|
||||||
used3 = 1;
|
used3 = 1;
|
||||||
talk(phrase3, sound3);
|
talk(phrase3, sound3);
|
||||||
|
@ -3225,13 +3202,13 @@ void DrasculaEngine::converse(const char *fileName) {
|
||||||
grr();
|
grr();
|
||||||
else
|
else
|
||||||
response(answer3);
|
response(answer3);
|
||||||
} else if ((button_izq == 1) && (game4 == 2)) {
|
} else if ((leftMouseButton == 1) && (game4 == 2)) {
|
||||||
delay(100);
|
delay(100);
|
||||||
talk(phrase4, sound4);
|
talk(phrase4, sound4);
|
||||||
breakOut = 1;
|
breakOut = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (button_izq == 1) {
|
if (leftMouseButton == 1) {
|
||||||
delay(100);
|
delay(100);
|
||||||
color_abc(kColorLightGreen);
|
color_abc(kColorLightGreen);
|
||||||
}
|
}
|
||||||
|
@ -3252,12 +3229,8 @@ void DrasculaEngine::converse(const char *fileName) {
|
||||||
|
|
||||||
void DrasculaEngine::response(int function) {
|
void DrasculaEngine::response(int function) {
|
||||||
if (currentChapter == 1) {
|
if (currentChapter == 1) {
|
||||||
if (function == 10)
|
if (function >= 10 && function <= 12)
|
||||||
talk_drunk(1);
|
talk_drunk(function - 9);
|
||||||
else if (function == 11)
|
|
||||||
talk_drunk(2);
|
|
||||||
else if (function == 12)
|
|
||||||
talk_drunk(3);
|
|
||||||
} else if (currentChapter == 2) {
|
} else if (currentChapter == 2) {
|
||||||
if (function == 8)
|
if (function == 8)
|
||||||
animation_8_2();
|
animation_8_2();
|
||||||
|
@ -3351,9 +3324,7 @@ void DrasculaEngine::addObject(int osj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrasculaEngine::stopSound() {
|
void DrasculaEngine::stopSound() {
|
||||||
if (hay_sb == 1) {
|
_mixer->stopHandle(_soundHandle);
|
||||||
_mixer->stopHandle(_soundHandle);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrasculaEngine::MusicFadeout() {
|
void DrasculaEngine::MusicFadeout() {
|
||||||
|
@ -3615,8 +3586,7 @@ void DrasculaEngine::grr() {
|
||||||
|
|
||||||
color_abc(kColorDarkGreen);
|
color_abc(kColorDarkGreen);
|
||||||
|
|
||||||
if (hay_sb == 1)
|
playFile("s10.als");
|
||||||
playFile("s10.als");
|
|
||||||
|
|
||||||
updateRoom();
|
updateRoom();
|
||||||
copyBackground(253, 110, 150, 65, 20, 30, drawSurface3, screenSurface);
|
copyBackground(253, 110, 150, 65, 20, 30, drawSurface3, screenSurface);
|
||||||
|
|
|
@ -234,7 +234,6 @@ public:
|
||||||
|
|
||||||
Common::ArjFile _arj;
|
Common::ArjFile _arj;
|
||||||
|
|
||||||
int hay_sb;
|
|
||||||
int previousMusic, roomMusic;
|
int previousMusic, roomMusic;
|
||||||
int roomNumber;
|
int roomNumber;
|
||||||
char roomDisk[20];
|
char roomDisk[20];
|
||||||
|
@ -302,8 +301,8 @@ public:
|
||||||
int mouseX;
|
int mouseX;
|
||||||
int mouseY;
|
int mouseY;
|
||||||
int mouseY_ant;
|
int mouseY_ant;
|
||||||
int button_izq;
|
int leftMouseButton;
|
||||||
int button_dch;
|
int rightMouseButton;
|
||||||
|
|
||||||
bool escoba();
|
bool escoba();
|
||||||
void black();
|
void black();
|
||||||
|
@ -329,7 +328,8 @@ public:
|
||||||
bool verify2();
|
bool verify2();
|
||||||
Common::KeyCode getScan();
|
Common::KeyCode getScan();
|
||||||
void selectVerb(int);
|
void selectVerb(int);
|
||||||
void mesa();
|
void updateVolume(Audio::Mixer::SoundType soundType, int prevVolume);
|
||||||
|
void volumeControls();
|
||||||
bool saveLoadScreen();
|
bool saveLoadScreen();
|
||||||
void print_abc(const char *, int, int);
|
void print_abc(const char *, int, int);
|
||||||
void delay(int ms);
|
void delay(int ms);
|
||||||
|
@ -338,7 +338,7 @@ public:
|
||||||
void chooseObject(int objeto);
|
void chooseObject(int objeto);
|
||||||
void addObject(int);
|
void addObject(int);
|
||||||
int removeObject(int osj);
|
int removeObject(int osj);
|
||||||
void fliplay(const char *filefli, int vel);
|
void playFLI(const char *filefli, int vel);
|
||||||
void fadeFromBlack(int fadeSpeed);
|
void fadeFromBlack(int fadeSpeed);
|
||||||
char adjustToVGA(char value);
|
char adjustToVGA(char value);
|
||||||
void color_abc(int cl);
|
void color_abc(int cl);
|
||||||
|
@ -404,13 +404,11 @@ public:
|
||||||
void setCursorTable();
|
void setCursorTable();
|
||||||
void enterName();
|
void enterName();
|
||||||
bool soundIsActive();
|
bool soundIsActive();
|
||||||
void openSSN(const char *Name, int Pause);
|
|
||||||
void WaitFrameSSN();
|
void WaitFrameSSN();
|
||||||
void MixVideo(byte *OldScreen, byte *NewScreen);
|
void MixVideo(byte *OldScreen, byte *NewScreen);
|
||||||
void Des_RLE(byte *BufferRLE, byte *MiVideoRLE);
|
void Des_RLE(byte *BufferRLE, byte *MiVideoRLE);
|
||||||
void Des_OFF(byte *BufferOFF, byte *MiVideoOFF, int Lenght);
|
void Des_OFF(byte *BufferOFF, byte *MiVideoOFF, int Lenght);
|
||||||
byte *TryInMem();
|
byte *TryInMem();
|
||||||
void EndSSN();
|
|
||||||
int playFrameSSN();
|
int playFrameSSN();
|
||||||
|
|
||||||
byte *AuxBuffOrg;
|
byte *AuxBuffOrg;
|
||||||
|
@ -553,7 +551,7 @@ public:
|
||||||
void animation_4_3();
|
void animation_4_3();
|
||||||
void animation_5_3();
|
void animation_5_3();
|
||||||
void animation_6_3();
|
void animation_6_3();
|
||||||
void animation_rayo();
|
void animation_ray();
|
||||||
//
|
//
|
||||||
void animation_1_4();
|
void animation_1_4();
|
||||||
void animation_2_4();
|
void animation_2_4();
|
||||||
|
|
|
@ -33,22 +33,15 @@ int x_talk_izq[6] = {145, 169, 193, 217, 241, 265};
|
||||||
void DrasculaEngine::talkInit(const char *filename) {
|
void DrasculaEngine::talkInit(const char *filename) {
|
||||||
_rnd->setSeed((unsigned int)_system->getMillis() / 2);
|
_rnd->setSeed((unsigned int)_system->getMillis() / 2);
|
||||||
|
|
||||||
if (hay_sb == 1)
|
playFile(filename);
|
||||||
playFile(filename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DrasculaEngine::isTalkFinished(int* length) {
|
bool DrasculaEngine::isTalkFinished(int* length) {
|
||||||
byte key = getScan();
|
byte key = getScan();
|
||||||
if (key != 0)
|
if (key != 0)
|
||||||
stopSound();
|
stopSound();
|
||||||
if (hay_sb == 1) {
|
if (soundIsActive())
|
||||||
if (soundIsActive())
|
return false;
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
length -= 2;
|
|
||||||
if (length > 0)
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue