aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2012-05-12 10:34:52 +1000
committerPaul Gilbert2012-05-12 10:34:52 +1000
commita153f9a2e633c788edd00b1c71c75377a3319e66 (patch)
treefbdc45d8727e0f2f8e9b4568798c4b0fd3f9dcfa /engines
parent166980fa4f7aa29ef604307662ed04d21b26a211 (diff)
downloadscummvm-rg350-a153f9a2e633c788edd00b1c71c75377a3319e66.tar.gz
scummvm-rg350-a153f9a2e633c788edd00b1c71c75377a3319e66.tar.bz2
scummvm-rg350-a153f9a2e633c788edd00b1c71c75377a3319e66.zip
TONY: Explicitly initialise fields of various objects in their constructors
This fixes a crash when the pop-up inventory was displayed.
Diffstat (limited to 'engines')
-rw-r--r--engines/tony/gfxcore.cpp1
-rw-r--r--engines/tony/inventory.cpp13
-rw-r--r--engines/tony/tonychar.cpp18
-rw-r--r--engines/tony/tonychar.h4
4 files changed, 35 insertions, 1 deletions
diff --git a/engines/tony/gfxcore.cpp b/engines/tony/gfxcore.cpp
index de78b51a4e..344542b801 100644
--- a/engines/tony/gfxcore.cpp
+++ b/engines/tony/gfxcore.cpp
@@ -287,6 +287,7 @@ RMGfxClearTask RMGfxTargetBuffer::taskClear;
RMGfxTargetBuffer::RMGfxTargetBuffer() {
otlist = NULL;
+ m_otSize = 0;
csModifyingOT = g_system->createMutex();
}
diff --git a/engines/tony/inventory.cpp b/engines/tony/inventory.cpp
index 50e4dd9411..9d673459c5 100644
--- a/engines/tony/inventory.cpp
+++ b/engines/tony/inventory.cpp
@@ -64,6 +64,18 @@ RMInventory::RMInventory() {
m_bCombining = false;
m_csModifyInterface = g_system->createMutex();
m_nItems = 0;
+
+ Common::fill(m_inv, m_inv + 256, 0);
+ m_nInv = 0;
+ m_curPutY = 0;
+ m_curPutTime = 0;
+ m_curPos = 0;
+ m_bHasFocus = false;
+ m_nSelectObj = 0;
+ m_nCombine = 0;
+ m_bBlinkingRight = false;
+ m_bBlinkingLeft = false;
+ miniAction = 0;
}
RMInventory::~RMInventory() {
@@ -932,6 +944,7 @@ void RMInterface::Init(void) {
*/
m_bActive = false;
m_bPalesati = false;
+ m_lastHotZone = 0;
}
void RMInterface::Close(void) {
diff --git a/engines/tony/tonychar.cpp b/engines/tony/tonychar.cpp
index 6a5d80f51e..982949870c 100644
--- a/engines/tony/tonychar.cpp
+++ b/engines/tony/tonychar.cpp
@@ -59,6 +59,24 @@ namespace Tony {
bool RMTony::m_bAction = false;
+RMTony::RMTony() {
+ m_bShow = false;
+ m_bShowOmbra = false;
+ m_bCorpoDavanti = false;
+ m_bActionPending = false;
+ m_ActionItem = NULL;
+ m_Action = 0;
+ m_ActionParm = 0;
+ m_bPastorella = false;
+ m_bIsStaticTalk = false;
+ m_bIsTalking = false;
+ m_nPatB4Talking = 0;
+ m_nTalkType = TALK_NORMAL;
+ m_TalkDirection = UP;
+ m_nTimeLastStep = 0;
+ hActionThread = CORO_INVALID_PID_VALUE;
+}
+
void RMTony::WaitEndOfAction(CORO_PARAM, const void *param) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
diff --git a/engines/tony/tonychar.h b/engines/tony/tonychar.h
index cf67db4df5..bbb1667c9b 100644
--- a/engines/tony/tonychar.h
+++ b/engines/tony/tonychar.h
@@ -127,7 +127,7 @@ private:
protected:
// Overload dell'allocazione degli sprites per cambiare il tipo
- virtual RMGfxSourceBuffer* NewItemSpriteBuffer(int dimx, int dimy, bool bPreRLE);
+ virtual RMGfxSourceBuffer *NewItemSpriteBuffer(int dimx, int dimy, bool bPreRLE);
// Thread which waits for the end of an action
static void WaitEndOfAction(CORO_PARAM, const void *param);
@@ -378,6 +378,8 @@ public: // per farlo rialzare, altrimenti private
};
public:
+ RMTony();
+
// Inizializza Tony
void Init(void);