mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
VOYEUR: Bugfixes for computer event display
This commit is contained in:
parent
7cd966bc80
commit
54c479c3d9
@ -88,8 +88,8 @@ void SVoy::synchronize(Common::Serializer &s) {
|
||||
s.syncAsSint16LE(_field4AC);
|
||||
s.syncAsSint16LE(_field4B8);
|
||||
s.syncAsSint16LE(_computerTextId);
|
||||
s.syncAsSint16LE(_field4EC);
|
||||
s.syncAsSint16LE(_field4EE);
|
||||
s.syncAsSint16LE(_computerTimeMin);
|
||||
s.syncAsSint16LE(_computerTimeMax);
|
||||
s.syncAsSint16LE(_field4F0);
|
||||
s.syncAsSint16LE(_field4F2);
|
||||
|
||||
|
@ -128,8 +128,8 @@ public:
|
||||
|
||||
int _computerTextId;
|
||||
Common::Rect _rect4E4;
|
||||
int _field4EC;
|
||||
int _field4EE;
|
||||
int _computerTimeMin;
|
||||
int _computerTimeMax;
|
||||
int _field4F0;
|
||||
int _field4F2;
|
||||
|
||||
|
@ -1398,6 +1398,23 @@ void ViewPortResource::drawIfaceTime() {
|
||||
Common::Point(215, 27));
|
||||
}
|
||||
|
||||
void ViewPortResource::drawPicPerm(PictureResource *pic, const Common::Point &pt) {
|
||||
Common::Rect bounds = pic->_bounds;
|
||||
bounds.translate(pt.x, pt.y);
|
||||
|
||||
bool saveBack = _state._vm->_graphicsManager._saveBack;
|
||||
_state._vm->_graphicsManager._saveBack = false;
|
||||
_state._vm->_graphicsManager.sDrawPic(pic, this, pt);
|
||||
clipRect(bounds);
|
||||
|
||||
for (int pageIndex = 0; pageIndex < _pageCount; ++pageIndex) {
|
||||
if (_pageIndex != pageIndex) {
|
||||
addSaveRect(pageIndex, bounds);
|
||||
}
|
||||
}
|
||||
|
||||
_state._vm->_graphicsManager._saveBack = saveBack;
|
||||
}
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
ViewPortListResource::ViewPortListResource(BoltFilesState &state, const byte *src) {
|
||||
|
@ -373,6 +373,7 @@ public:
|
||||
void addSaveRect(int pageIndex, const Common::Rect &r);
|
||||
void fillPic(byte onOff = 0);
|
||||
void drawIfaceTime();
|
||||
void drawPicPerm(PictureResource *pic, const Common::Point &pt);
|
||||
};
|
||||
|
||||
class ViewPortPalEntry {
|
||||
|
@ -629,8 +629,8 @@ void ThreadResource::parsePlayCommands() {
|
||||
|
||||
if (v2 == 0 || READ_LE_UINT16(_vm->_controlPtr->_ptr + 4) == 0) {
|
||||
_vm->_voy._computerTextId = READ_LE_UINT16(dataP + 2);
|
||||
_vm->_voy._field4EC = READ_LE_UINT16(dataP + 4);
|
||||
_vm->_voy._field4EE = READ_LE_UINT16(dataP + 6);
|
||||
_vm->_voy._computerTimeMin = READ_LE_UINT16(dataP + 4);
|
||||
_vm->_voy._computerTimeMax = READ_LE_UINT16(dataP + 6);
|
||||
|
||||
_vm->_voy._rect4E4.left = COMP_BUT_TABLE[_vm->_voy._computerTextId * 4];
|
||||
_vm->_voy._rect4E4.top = COMP_BUT_TABLE[_vm->_voy._computerTextId * 4 + 1];
|
||||
@ -1198,8 +1198,8 @@ void ThreadResource::doRoom() {
|
||||
if (hotspotId == -1) {
|
||||
vm._eventsManager.setCursorColor(128, 0);
|
||||
vm._eventsManager.setCursor(crosshairsCursor);
|
||||
} else if (hotspotId != 999 || voy._RTVNum < voy._field4EC ||
|
||||
(voy._field4EE - 2) < voy._RTVNum) {
|
||||
} else if (hotspotId != 999 || voy._RTVNum < voy._computerTimeMin ||
|
||||
(voy._computerTimeMax - 2) < voy._RTVNum) {
|
||||
vm._eventsManager.setCursorColor(128, 1);
|
||||
vm._eventsManager.setCursor(magnifierCursor);
|
||||
} else {
|
||||
@ -1241,9 +1241,9 @@ void ThreadResource::doRoom() {
|
||||
vm._eventsManager._mouseClicked = false;
|
||||
vm._eventsManager.startCursorBlink();
|
||||
|
||||
int v = vm.doComputerText(9999);
|
||||
if (v)
|
||||
vm._voy.addComputerEventEnd(v);
|
||||
int totalChars = vm.doComputerText(9999);
|
||||
if (totalChars)
|
||||
vm._voy.addComputerEventEnd(totalChars);
|
||||
|
||||
vm._bVoy->freeBoltGroup(0x4900);
|
||||
} else {
|
||||
@ -1262,6 +1262,7 @@ void ThreadResource::doRoom() {
|
||||
vm._graphicsManager._backgroundPage = vm._bVoy->boltEntry(
|
||||
vm._playStampGroupId)._picResource;
|
||||
|
||||
(*vm._graphicsManager._vPort)->setupViewPort();
|
||||
vm._graphicsManager._backColors->startFade();
|
||||
_vm->flipPageAndWait();
|
||||
|
||||
|
@ -238,7 +238,7 @@ public:
|
||||
void makeViewFinderP();
|
||||
void initIFace();
|
||||
void checkTransition();
|
||||
bool doComputerText(int maxLen);
|
||||
int doComputerText(int maxLen);
|
||||
void getComputerBrush();
|
||||
|
||||
/**
|
||||
|
@ -1160,7 +1160,7 @@ Common::String VoyeurEngine::getTimeOfDay() {
|
||||
return Common::String::format("%d:%02d%s", _gameHour, _gameMinute, _voy._isAM ? AM : PM);
|
||||
}
|
||||
|
||||
bool VoyeurEngine::doComputerText(int maxLen) {
|
||||
int VoyeurEngine::doComputerText(int maxLen) {
|
||||
FontInfoResource &font = *_graphicsManager._fontPtr;
|
||||
int totalChars = 0;
|
||||
|
||||
@ -1171,7 +1171,7 @@ bool VoyeurEngine::doComputerText(int maxLen) {
|
||||
if (_voy._vocSecondsOffset > 60)
|
||||
_voy._vocSecondsOffset = 0;
|
||||
|
||||
if (_voy._RTVNum > _voy._field4EE && maxLen == 9999) {
|
||||
if (_voy._RTVNum > _voy._computerTimeMax && maxLen == 9999) {
|
||||
if (_currentVocId != -1)
|
||||
_soundManager.startVOCPlay(_currentVocId);
|
||||
font._justify = ALIGN_LEFT;
|
||||
@ -1179,7 +1179,7 @@ bool VoyeurEngine::doComputerText(int maxLen) {
|
||||
font._justifyHeight = 100;
|
||||
font._pos = Common::Point(128, 100);
|
||||
(*_graphicsManager._vPort)->drawText(END_OF_MESSAGE);
|
||||
} else if (_voy._RTVNum < _voy._field4EC && maxLen == 9999) {
|
||||
} else if (_voy._RTVNum < _voy._computerTimeMin && maxLen == 9999) {
|
||||
if (_currentVocId != -1)
|
||||
_soundManager.startVOCPlay(_currentVocId);
|
||||
font._justify = ALIGN_LEFT;
|
||||
@ -1244,7 +1244,7 @@ bool VoyeurEngine::doComputerText(int maxLen) {
|
||||
|
||||
} while (!shouldQuit() && !_eventsManager._mouseClicked && totalChars < maxLen);
|
||||
|
||||
_voy._field4EE = 0;
|
||||
_voy._computerTimeMax = 0;
|
||||
}
|
||||
|
||||
flipPageAndWait();
|
||||
@ -1254,9 +1254,16 @@ bool VoyeurEngine::doComputerText(int maxLen) {
|
||||
}
|
||||
|
||||
void VoyeurEngine::getComputerBrush() {
|
||||
error("TODO: getComputerBrush");
|
||||
// if (_bVoy->getBoltGroup(0x4900)) {
|
||||
// }
|
||||
if (_bVoy->getBoltGroup(0x4900)) {
|
||||
PictureResource *pic = _bVoy->boltEntry(0x490E)._picResource;
|
||||
int xp = (384 - pic->_bounds.width()) / 2;
|
||||
int yp = (240 - pic->_bounds.height()) / 2 - 4;
|
||||
|
||||
(*_graphicsManager._vPort)->drawPicPerm(pic, Common::Point(xp, yp));
|
||||
|
||||
CMapResource *pal = _bVoy->boltEntry(0x490F)._cMapResource;
|
||||
pal->startFade();
|
||||
}
|
||||
}
|
||||
|
||||
void VoyeurEngine::doTimeBar(bool force) {
|
||||
|
Loading…
Reference in New Issue
Block a user