aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/tony/gfxcore.cpp4
-rw-r--r--engines/tony/globals.cpp5
-rw-r--r--engines/tony/globals.h1
-rw-r--r--engines/tony/inventory.cpp18
-rw-r--r--engines/tony/loc.cpp16
5 files changed, 31 insertions, 13 deletions
diff --git a/engines/tony/gfxcore.cpp b/engines/tony/gfxcore.cpp
index 37fc947912..2f38f5d05d 100644
--- a/engines/tony/gfxcore.cpp
+++ b/engines/tony/gfxcore.cpp
@@ -548,6 +548,7 @@ void RMGfxSourceBuffer8::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimit
RMGfxSourceBuffer8::RMGfxSourceBuffer8(int dimx, int dimy, bool bUseDDraw)
: RMGfxBuffer(dimx, dimy, 8, bUseDDraw) {
setPriority(0);
+ _bTrasp0 = false;
}
RMGfxSourceBuffer8::RMGfxSourceBuffer8(bool bTrasp0) {
@@ -672,6 +673,8 @@ RMGfxSourceBuffer8RLE::RMGfxSourceBuffer8RLE() {
_alphaBlendColor = -1;
_bNeedRLECompress = true;
_buf = NULL;
+
+ _alphaR = _alphaG = _alphaB = 0;
}
RMGfxSourceBuffer8RLE::~RMGfxSourceBuffer8RLE() {
@@ -1879,6 +1882,7 @@ void RMGfxSourceBuffer16::prepareImage(void) {
RMGfxSourceBuffer16::RMGfxSourceBuffer16(int dimx, int dimy, bool bUseDDraw)
: RMGfxBuffer(dimx, dimy, 16, bUseDDraw) {
setPriority(0);
+ _bTrasp0 = false;
}
diff --git a/engines/tony/globals.cpp b/engines/tony/globals.cpp
index e3d36db11b..45ab5f8722 100644
--- a/engines/tony/globals.cpp
+++ b/engines/tony/globals.cpp
@@ -134,8 +134,11 @@ Globals::Globals() {
_nTonyNextTalkType = RMTony::TALK_NORMAL;
_saveTonyLoc = 0;
- for (int i = 0; i < 16; ++i)
+ for (int i = 0; i < 16; ++i) {
Common::fill((byte *)&_character[i], (byte *)&_character[i] + sizeof(CharacterStruct), 0);
+ _isMChar[i] = false;
+ }
+
for (int i = 0; i < 10; ++i)
Common::fill((byte *)&_mCharacter[i], (byte *)&_mCharacter[i] + sizeof(MCharacterStruct), 0);
for (int i = 0; i < 256; ++i)
diff --git a/engines/tony/globals.h b/engines/tony/globals.h
index 24825588e1..2301e621aa 100644
--- a/engines/tony/globals.h
+++ b/engines/tony/globals.h
@@ -240,7 +240,6 @@ public:
RMTony::TALKTYPE _nTonyNextTalkType;
RMPoint _startLocPos[256];
- OSystem::MutexRef _cs[10];
uint32 _mut[10];
bool _bSkipIdle;
diff --git a/engines/tony/inventory.cpp b/engines/tony/inventory.cpp
index 4109e5f371..4d824bb10a 100644
--- a/engines/tony/inventory.cpp
+++ b/engines/tony/inventory.cpp
@@ -391,13 +391,11 @@ bool RMInventory::leftClick(const RMPoint &mpos, int &nCombineObj) {
}
void RMInventory::rightClick(const RMPoint &mpos) {
- int n;
-
assert(checkPointInside(mpos));
if (_state == OPENED && !_bCombining) {
// Open the context interface
- n = mpos._x / 64;
+ int n = mpos._x / 64;
if (n > 0 && n < RM_SX / 64 - 1 && _inv[n - 1 + _curPos] != 0) {
_state = SELECTING;
@@ -456,13 +454,13 @@ bool RMInventory::rightRelease(const RMPoint &mpos, RMTonyAction &curAction) {
if (_state == SELECTING) {
_state = OPENED;
- if (_miniAction == 1) { // Esamina
+ if (_miniAction == 1) { // Examine
curAction = TA_EXAMINE;
return true;
- } else if (_miniAction == 2) { // Parla
+ } else if (_miniAction == 2) { // Talk
curAction = TA_TALK;
return true;
- } else if (_miniAction == 3) { // Usa
+ } else if (_miniAction == 3) { // Use
curAction = TA_USE;
return true;
}
@@ -474,7 +472,6 @@ bool RMInventory::rightRelease(const RMPoint &mpos, RMTonyAction &curAction) {
#define INVSPEED 20
void RMInventory::doFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpos, bool bCanOpen) {
- int i;
bool bNeedRedraw = false;
if (_state != CLOSED) {
@@ -484,9 +481,10 @@ void RMInventory::doFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
// DoFrame makes all the objects currently in the inventory be displayed
// @@@ Maybe we should do all takeable objects? Please does not help
- for (i = 0; i < _nInv; i++)
+ for (int i = 0; i < _nInv; i++) {
if (_items[_inv[i]]._icon.doFrame(this, false) && (i >= _curPos && i <= _curPos + 7))
bNeedRedraw = true;
+ }
if ((_state == CLOSING || _state == OPENING || _state == OPENED) && checkPointInside(mpos)) {
if (mpos._x > RM_SX - 64) {
@@ -672,11 +670,9 @@ bool RMInventory::itemInFocus(const RMPoint &mpt) {
}
RMItem *RMInventory::whichItemIsIn(const RMPoint &mpt) {
- int n;
-
if (_state == OPENED) {
if (checkPointInside(mpt)) {
- n = mpt._x / 64;
+ int n = mpt._x / 64;
if (n > 0 && n < RM_SX / 64 - 1 && _inv[n - 1 + _curPos] != 0 && (!_bCombining || _inv[n - 1 + _curPos] != _nCombine))
return &_items[_inv[n - 1 + _curPos]]._icon;
}
diff --git a/engines/tony/loc.cpp b/engines/tony/loc.cpp
index 0b8398c541..42c96076f9 100644
--- a/engines/tony/loc.cpp
+++ b/engines/tony/loc.cpp
@@ -785,6 +785,7 @@ RMItem::RMItem() {
_nCurSprite = 0;
_bIsActive = false;
+ memset(_pal._data, 0, sizeof(_pal._data));
_hEndPattern = CoroScheduler.createEvent(false, false);
}
@@ -841,6 +842,13 @@ void RMItem::pauseSound(bool bPause) {
RMWipe::RMWipe() {
_hUnregistered = CoroScheduler.createEvent(false, false);
_hEndOfFade = CoroScheduler.createEvent(false, false);
+
+ _bMustRegister = false;
+ _bUnregister = false;
+ _bEndFade = false;
+ _bFading = false;
+ _nFadeStep = 0;
+
}
RMWipe::~RMWipe() {
@@ -1681,6 +1689,8 @@ RMCharacter::RMCharacter() {
_bMovingWithoutMinpath = false;
_bDrawNow = false;
_bNeedToStop = false;
+
+ memset(_path, 0, sizeof(_path));
_pos.set(0, 0);
}
@@ -1748,6 +1758,7 @@ RMDataStream &operator>>(RMDataStream &ds, RMBox &box) {
RMBoxLoc::RMBoxLoc() {
_boxes = NULL;
+ _numbBox = 0;
}
RMBoxLoc::~RMBoxLoc() {
@@ -1936,6 +1947,8 @@ RMLocation::RMLocation() {
_nItems = 0;
_items = NULL;
_buf = NULL;
+ TEMPNumLoc = 0;
+ _cmode = CM_256;
}
@@ -2292,6 +2305,9 @@ RMMessage::RMMessage(uint32 dwId) {
RMMessage::RMMessage() {
_lpMessage = NULL;
+ _nPeriods = 0;
+ for (int i = 0; i < 256; i++)
+ _lpPeriods[i] = 0;
}
RMMessage::~RMMessage() {