aboutsummaryrefslogtreecommitdiff
path: root/engines/drascula/drascula.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/drascula/drascula.cpp')
-rw-r--r--engines/drascula/drascula.cpp114
1 files changed, 58 insertions, 56 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 6f84badfd9..b9e3354dec 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -165,33 +165,33 @@ int DrasculaEngine::go() {
hay_seleccion = 0;
if (currentChapter != 6) {
- loadAndDecompressPic("95.alg", tableSurface, 1);
+ loadPic("95.alg", tableSurface, 1);
}
if (currentChapter == 1) {
- loadAndDecompressPic("96.alg", frontSurface, COMPLETE_PAL);
- loadAndDecompressPic("99.alg", backSurface, 1);
- loadAndDecompressPic("97.alg", extraSurface, 1);
+ loadPic("96.alg", frontSurface, COMPLETE_PAL);
+ loadPic("99.alg", backSurface, 1);
+ loadPic("97.alg", extraSurface, 1);
} else if (currentChapter == 2) {
- loadAndDecompressPic("96.alg", frontSurface, COMPLETE_PAL);
- loadAndDecompressPic("pts.alg", drawSurface2, 1);
+ loadPic("96.alg", frontSurface, COMPLETE_PAL);
+ loadPic("pts.alg", drawSurface2, 1);
} else if (currentChapter == 3) {
- loadAndDecompressPic("aux13.alg", drawSurface1, COMPLETE_PAL);
- loadAndDecompressPic("96.alg", frontSurface, 1);
- loadAndDecompressPic("97.alg", extraSurface, 1);
- loadAndDecompressPic("99.alg", backSurface, 1);
+ loadPic("aux13.alg", drawSurface1, COMPLETE_PAL);
+ loadPic("96.alg", frontSurface, 1);
+ loadPic("97.alg", extraSurface, 1);
+ loadPic("99.alg", backSurface, 1);
} else if (currentChapter == 4) {
- loadAndDecompressPic("96.alg", frontSurface, COMPLETE_PAL);
+ loadPic("96.alg", frontSurface, COMPLETE_PAL);
if (hay_que_load == 0)
animation_rayo();
- loadAndDecompressPic("96.alg", frontSurface, 1);
+ loadPic("96.alg", frontSurface, 1);
clearRoom();
- loadAndDecompressPic("99.alg", backSurface, 1);
- loadAndDecompressPic("97.alg", extraSurface, 1);
+ loadPic("99.alg", backSurface, 1);
+ loadPic("97.alg", extraSurface, 1);
} else if (currentChapter == 5) {
- loadAndDecompressPic("96.alg", frontSurface, COMPLETE_PAL);
- loadAndDecompressPic("97.alg", extraSurface, 1);
- loadAndDecompressPic("99.alg", backSurface, 1);
+ loadPic("96.alg", frontSurface, COMPLETE_PAL);
+ loadPic("97.alg", extraSurface, 1);
+ loadPic("99.alg", backSurface, 1);
} else if (currentChapter == 6) {
igorX = 105, igorY = 85, sentido_igor = 1;
x_dr = 62, y_dr = 99, sentido_dr = 1;
@@ -200,10 +200,10 @@ int DrasculaEngine::go() {
pendulumSurface = drawSurface3;
- loadAndDecompressPic("96.alg", frontSurface, COMPLETE_PAL);
- loadAndDecompressPic("99.alg", backSurface, 1);
- loadAndDecompressPic("97.alg", extraSurface, 1);
- loadAndDecompressPic("95.alg", tableSurface, 1);
+ loadPic("96.alg", frontSurface, COMPLETE_PAL);
+ loadPic("99.alg", backSurface, 1);
+ loadPic("97.alg", extraSurface, 1);
+ loadPic("95.alg", tableSurface, 1);
}
memset(iconName, 0, sizeof(iconName));
@@ -266,7 +266,7 @@ void DrasculaEngine::freeMemory() {
free(frontSurface);
}
-void DrasculaEngine::loadPic(const char *NamePcc) {
+void DrasculaEngine::loadPic(const char *NamePcc, byte *targetSurface, int colorCount) {
unsigned int con, x = 0;
unsigned int fExit = 0;
byte ch, rep;
@@ -296,6 +296,8 @@ void DrasculaEngine::loadPic(const char *NamePcc) {
_arj.read(cPal, 768);
_arj.close();
+
+ decompressPic(targetSurface, colorCount);
}
void DrasculaEngine::decompressPic(byte *targetSurface, int colorCount) {
@@ -478,7 +480,7 @@ bool DrasculaEngine::escoba() {
animation_1_1();
withoutVerb();
- loadAndDecompressPic("2aux62.alg", drawSurface2, 1);
+ loadPic("2aux62.alg", drawSurface2, 1);
sentido_hare = 1;
objExit = 104;
if (hay_que_load != 0) {
@@ -568,7 +570,7 @@ bool DrasculaEngine::escoba() {
if (!para_cargar(saveName)) {
return true;
}
- loadAndDecompressPic("auxdr.alg", drawSurface2, 1);
+ loadPic("auxdr.alg", drawSurface2, 1);
}
}
@@ -610,9 +612,9 @@ bool DrasculaEngine::escoba() {
if (button_dch == 1 && menuScreen == 1) {
delay(100);
if (currentChapter == 2)
- loadAndDecompressPic(menuBackground, backSurface, 1);
+ loadPic(menuBackground, backSurface, 1);
else
- loadAndDecompressPic("99.alg", backSurface, 1);
+ loadPic("99.alg", backSurface, 1);
setPalette((byte *)&gamePalette);
menuScreen = 0;
updateEvents();
@@ -625,13 +627,13 @@ bool DrasculaEngine::escoba() {
if (sentido_hare == 2)
sentido_hare = 1;
if (currentChapter == 4)
- loadAndDecompressPic("icons2.alg", backSurface, 1);
+ loadPic("icons2.alg", backSurface, 1);
else if (currentChapter == 5)
- loadAndDecompressPic("icons3.alg", backSurface, 1);
+ loadPic("icons3.alg", backSurface, 1);
else if (currentChapter == 6)
- loadAndDecompressPic("iconsp.alg", backSurface, 1);
+ loadPic("iconsp.alg", backSurface, 1);
else
- loadAndDecompressPic("icons.alg", backSurface, 1);
+ loadPic("icons.alg", backSurface, 1);
menuScreen = 1;
updateEvents();
withoutVerb();
@@ -716,7 +718,7 @@ bool DrasculaEngine::escoba() {
if (currentChapter != 3)
cont_sv = 0;
} else if (currentChapter == 6 && key == Common::KEYCODE_0 && roomNumber == 61) {
- loadAndDecompressPic("alcbar.alg", drawSurface1, 255);
+ loadPic("alcbar.alg", drawSurface1, 255);
} else if (cont_sv == 15000) {
screenSaver();
if (currentChapter != 3)
@@ -730,18 +732,18 @@ bool DrasculaEngine::escoba() {
void DrasculaEngine::pickObject(int objeto) {
if (currentChapter == 6)
- loadAndDecompressPic("iconsp.alg", backSurface, 1);
+ loadPic("iconsp.alg", backSurface, 1);
else if (currentChapter == 4)
- loadAndDecompressPic("icons2.alg", backSurface, 1);
+ loadPic("icons2.alg", backSurface, 1);
else if (currentChapter == 5)
- loadAndDecompressPic("icons3.alg", backSurface, 1);
+ loadPic("icons3.alg", backSurface, 1);
else
- loadAndDecompressPic("icons.alg", backSurface, 1);
+ loadPic("icons.alg", backSurface, 1);
chooseObject(objeto);
if (currentChapter == 2)
- loadAndDecompressPic(menuBackground, backSurface, 1);
+ loadPic(menuBackground, backSurface, 1);
else
- loadAndDecompressPic("99.alg", backSurface, 1);
+ loadPic("99.alg", backSurface, 1);
}
void DrasculaEngine::chooseObject(int objeto) {
@@ -914,9 +916,9 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {
_arj.close();
if (currentChapter == 2 && martin != 0) {
- loadAndDecompressPic(pant2, extraSurface, 1);
- loadAndDecompressPic(pant1, frontSurface, 1);
- loadAndDecompressPic(pant4, backSurface, 1);
+ loadPic(pant2, extraSurface, 1);
+ loadPic(pant1, frontSurface, 1);
+ loadPic(pant4, backSurface, 1);
}
if (currentChapter == 2) {
@@ -926,9 +928,9 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {
alto_hare = CHARACTER_HEIGHT;
ancho_hare = CHARACTER_WIDTH;
feetHeight = PIES_HARE;
- loadAndDecompressPic("97.alg", extraSurface, 1);
- loadAndDecompressPic("96.alg", frontSurface, 1);
- loadAndDecompressPic("99.alg", backSurface, 1);
+ loadPic("97.alg", extraSurface, 1);
+ loadPic("96.alg", frontSurface, 1);
+ loadPic("99.alg", backSurface, 1);
strcpy(menuBackground, "99.alg");
}
@@ -946,11 +948,11 @@ void DrasculaEngine::carga_escoba(const char *nom_fich) {
}
characterMoved = 0;
}
- loadAndDecompressPic(roomDisk, drawSurface3, 1);
+ loadPic(roomDisk, drawSurface3, 1);
char rm[20];
sprintf(rm, "%i.alg", roomNumber);
- loadAndDecompressPic(rm, drawSurface1, HALF_PAL);
+ loadPic(rm, drawSurface1, HALF_PAL);
copyBackground(0, 171, 0, 0, OBJWIDTH, OBJHEIGHT, backSurface, drawSurface3);
@@ -1405,7 +1407,7 @@ bool DrasculaEngine::saves() {
sav->readLine(names[n], 23);
delete sav;
- loadAndDecompressPic("savescr.alg", drawSurface1, HALF_PAL);
+ loadPic("savescr.alg", drawSurface1, HALF_PAL);
color_abc(kColorLightGreen);
@@ -1506,7 +1508,7 @@ bool DrasculaEngine::saves() {
clearRoom();
char rm[20];
sprintf(rm, "%i.alg", roomNumber);
- loadAndDecompressPic(rm, drawSurface1, HALF_PAL);
+ loadPic(rm, drawSurface1, HALF_PAL);
hay_seleccion = 0;
return true;
@@ -1641,7 +1643,7 @@ void DrasculaEngine::screenSaver() {
clearRoom();
- loadAndDecompressPic("sv.alg", drawSurface1, HALF_PAL);
+ loadPic("sv.alg", drawSurface1, HALF_PAL);
// inicio_ghost();
copia = (byte *)malloc(64000);
@@ -1728,7 +1730,7 @@ void DrasculaEngine::screenSaver() {
char rm[20];
sprintf(rm, "%i.alg", roomNumber);
- loadAndDecompressPic(rm, drawSurface1, HALF_PAL);
+ loadPic(rm, drawSurface1, HALF_PAL);
}
void DrasculaEngine::fliplay(const char *filefli, int vel) {
@@ -3191,7 +3193,7 @@ void DrasculaEngine::converse(const char *nom_fich) {
if (phrase4[h] == (char)0xa7)
phrase4[h] = ' ';
- loadAndDecompressPic("car.alg", backSurface, 1);
+ loadPic("car.alg", backSurface, 1);
// TODO code here should limit y position for mouse in dialog menu,
// but we can't implement this due lack backend functionality
// from 1(top) to 31
@@ -3289,9 +3291,9 @@ void DrasculaEngine::converse(const char *nom_fich) {
} // while (breakOut == 0)
if (currentChapter == 2)
- loadAndDecompressPic(menuBackground, backSurface, 1);
+ loadPic(menuBackground, backSurface, 1);
else
- loadAndDecompressPic("99.alg", backSurface, 1);
+ loadPic("99.alg", backSurface, 1);
if (currentChapter != 5)
withoutVerb();
}
@@ -3682,10 +3684,10 @@ void DrasculaEngine::activatePendulum() {
flags[1] = 2;
hare_se_ve = 0;
roomNumber = 102;
- loadAndDecompressPic("102.alg", drawSurface1, HALF_PAL);
- loadAndDecompressPic("an_p1.alg", drawSurface3, 1);
- loadAndDecompressPic("an_p2.alg", extraSurface, 1);
- loadAndDecompressPic("an_p3.alg", frontSurface, 1);
+ loadPic("102.alg", drawSurface1, HALF_PAL);
+ loadPic("an_p1.alg", drawSurface3, 1);
+ loadPic("an_p2.alg", extraSurface, 1);
+ loadPic("an_p3.alg", frontSurface, 1);
copyBackground(0, 171, 0, 0, OBJWIDTH, OBJHEIGHT, backSurface, drawSurface3);