Skip to content

Commit

Permalink
AGI: PREAGI: Fix MICKEY object placement
Browse files Browse the repository at this point in the history
Fixes all objects being drawn 10 pixels to the left

Regression from: 1ef27b3
  • Loading branch information
sluicebox committed Dec 13, 2024
1 parent 429b7c3 commit bdf451b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions engines/agi/preagi/mickey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,10 +752,10 @@ void MickeyEngine::drawObj(ENUM_MSA_OBJECT iObj, int x0, int y0) {
}

_picture->setMaxStep(maxStep);
_picture->setOffset(x0, y0);
_picture->setOffset(IDI_MSA_PIC_X0 + x0, IDI_MSA_PIC_Y0 + y0);
_picture->decodePictureFromBuffer(buffer, size, false, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT);
_picture->setOffset(0, 0);
_picture->showPic(10, 0, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT);
_picture->showPic(IDI_MSA_PIC_X0, IDI_MSA_PIC_Y0, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT);
}

void MickeyEngine::drawPic(int iPic) {
Expand All @@ -773,10 +773,10 @@ void MickeyEngine::drawPic(int iPic) {

// Note that decodePicture clears the screen
_picture->setMaxStep(0);
_picture->setOffset(10, 0);
_picture->setOffset(IDI_MSA_PIC_X0, IDI_MSA_PIC_Y0);
_picture->decodePictureFromBuffer(buffer, size, true, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT);
_picture->setOffset(0, 0);
_picture->showPic(10, 0, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT);
_picture->showPic(IDI_MSA_PIC_X0, IDI_MSA_PIC_Y0, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT);
}

void MickeyEngine::drawRoomAnimation() {
Expand Down Expand Up @@ -819,10 +819,10 @@ void MickeyEngine::drawRoomAnimation() {
_picture->setPictureData(objLight);
_picture->setPictureFlags(kPicFCircle);
_picture->setMaxStep(0);
_picture->setOffset(IDI_MSA_PIC_X0, IDI_MSA_PIC_Y0);
_picture->drawPicture();
}
_picture->showPic(10, 0, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT);

_picture->showPic(IDI_MSA_PIC_X0, IDI_MSA_PIC_Y0, IDI_MSA_PIC_WIDTH, IDI_MSA_PIC_HEIGHT);

_gameStateMickey.nFrame--;
if (_gameStateMickey.nFrame < 0)
Expand Down
2 changes: 2 additions & 0 deletions engines/agi/preagi/mickey.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ const char IDS_MSA_INSERT_DISK[][40] = {

#define IDI_MSA_PIC_WIDTH 140
#define IDI_MSA_PIC_HEIGHT 159
#define IDI_MSA_PIC_X0 10
#define IDI_MSA_PIC_Y0 0

// pictures

Expand Down

0 comments on commit bdf451b

Please sign in to comment.