DRASCULA: Simplify the drawing code in BJ's room

This commit is contained in:
Filippos Karapetis 2017-11-03 09:26:00 +02:00
parent 51cd9b4888
commit d81869af58
6 changed files with 12 additions and 35 deletions

View File

@ -55,17 +55,6 @@ void DrasculaEngine::placeDrascula() {
copyRect(drX, 122, drasculaX, drasculaY, 45, 77, backSurface, screenSurface);
}
void DrasculaEngine::placeBJ() {
int bX = 0;
if (trackBJ == 3)
bX = 10;
else if (trackBJ == 0)
bX = 37;
copyRect(bX, 99, bjX, bjY, 26, 76, drawSurface3, screenSurface);
}
void DrasculaEngine::hiccup(int counter) {
int y = 0, trackCharacter = 0;
if (currentChapter == 3)

View File

@ -430,9 +430,6 @@ void DrasculaEngine::animation_2_1() {
break;
for (l = 0; l < 200; l++)
factor_red[l] = 99;
bjX = 170;
bjY = 90;
trackBJ = 0;
curX = 91;
curY = 95;
trackProtagonist = 1;

View File

@ -70,9 +70,6 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam
_talkSequences = 0;
_currentSaveSlot = 0;
bjX = 0;
bjY = 0;
trackBJ = 0;
framesWithoutAction = 0;
term_int = 0;
currentChapter = 0;

View File

@ -456,7 +456,6 @@ public:
int blinking;
int igorX, igorY, trackIgor;
int drasculaX, drasculaY, trackDrascula;
int bjX, bjY, trackBJ;
int framesWithoutAction;
int term_int;
int currentChapter;
@ -526,7 +525,6 @@ public:
bool animate(const char *animation, int FPS);
void pause(int);
void placeIgor();
void placeBJ();
void placeDrascula();
void talkInit(const char *filename);

View File

@ -1153,9 +1153,6 @@ void DrasculaEngine::updateRefresh_pre() {
break;
}
}
if (currentChapter == 1 && _roomNumber == 16)
placeBJ();
}
void DrasculaEngine::update_1_pre() {
@ -1309,15 +1306,15 @@ void DrasculaEngine::update_14_pre() {
}
void DrasculaEngine::update_16_pre() {
if (currentChapter != 2) {
debug(4, "update_16_pre: Special case, current chapter is not 2, not performing update");
return;
if (currentChapter == 1) {
// Place BJ
copyRect(37, 99, 170, 90, 26, 76, drawSurface3, screenSurface);
} else if (currentChapter == 2) {
if (flags[17] == 0)
copyBackground(1, 103, 24, 72, 33, 95, drawSurface3, screenSurface);
if (flags[19] == 1)
copyBackground(37, 151, 224, 115, 56, 47, drawSurface3, screenSurface);
}
if (flags[17] == 0)
copyBackground(1, 103, 24, 72, 33, 95, drawSurface3, screenSurface);
if (flags[19] == 1)
copyBackground(37, 151, 224, 115, 56, 47, drawSurface3, screenSurface);
}
void DrasculaEngine::update_18_pre() {
@ -1678,9 +1675,8 @@ void DrasculaEngine::enterRoom(int roomIndex) {
strcpy(currentData, fileName);
Common::SeekableReadStream *stream = _archives.open(fileName);
if (!stream) {
if (!stream)
error("missing data file %s", fileName);
}
TextResourceParser p(stream, DisposeAfterUse::YES);

View File

@ -338,14 +338,14 @@ void DrasculaEngine::talk_bj(int index) {
updateRefresh_pre();
copyBackground(bjX + 2, bjY - 1, bjX + 2, bjY - 1, 27, 40, bgSurface, screenSurface);
copyBackground(170 + 2, 90 - 1, 170 + 2, 90 - 1, 27, 40, bgSurface, screenSurface);
copyRect(x_talk[face], 99, bjX + 2, bjY - 1, 27, 40, drawSurface3, screenSurface);
copyRect(x_talk[face], 99, 170 + 2, 90 - 1, 27, 40, drawSurface3, screenSurface);
moveCharacters();
updateRefresh();
if (!_subtitlesDisabled)
centerText(said, bjX + 7, bjY);
centerText(said, 170 + 7, 90);
updateScreen();