TONY: Explicitly initialise fields of various objects in their constructors
This fixes a crash when the pop-up inventory was displayed.
This commit is contained in:
parent
166980fa4f
commit
a153f9a2e6
4 changed files with 35 additions and 1 deletions
|
@ -287,6 +287,7 @@ RMGfxClearTask RMGfxTargetBuffer::taskClear;
|
||||||
|
|
||||||
RMGfxTargetBuffer::RMGfxTargetBuffer() {
|
RMGfxTargetBuffer::RMGfxTargetBuffer() {
|
||||||
otlist = NULL;
|
otlist = NULL;
|
||||||
|
m_otSize = 0;
|
||||||
csModifyingOT = g_system->createMutex();
|
csModifyingOT = g_system->createMutex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,18 @@ RMInventory::RMInventory() {
|
||||||
m_bCombining = false;
|
m_bCombining = false;
|
||||||
m_csModifyInterface = g_system->createMutex();
|
m_csModifyInterface = g_system->createMutex();
|
||||||
m_nItems = 0;
|
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() {
|
RMInventory::~RMInventory() {
|
||||||
|
@ -932,6 +944,7 @@ void RMInterface::Init(void) {
|
||||||
*/
|
*/
|
||||||
m_bActive = false;
|
m_bActive = false;
|
||||||
m_bPalesati = false;
|
m_bPalesati = false;
|
||||||
|
m_lastHotZone = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RMInterface::Close(void) {
|
void RMInterface::Close(void) {
|
||||||
|
|
|
@ -59,6 +59,24 @@ namespace Tony {
|
||||||
|
|
||||||
bool RMTony::m_bAction = false;
|
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) {
|
void RMTony::WaitEndOfAction(CORO_PARAM, const void *param) {
|
||||||
CORO_BEGIN_CONTEXT;
|
CORO_BEGIN_CONTEXT;
|
||||||
CORO_END_CONTEXT(_ctx);
|
CORO_END_CONTEXT(_ctx);
|
||||||
|
|
|
@ -127,7 +127,7 @@ private:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Overload dell'allocazione degli sprites per cambiare il tipo
|
// 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
|
// Thread which waits for the end of an action
|
||||||
static void WaitEndOfAction(CORO_PARAM, const void *param);
|
static void WaitEndOfAction(CORO_PARAM, const void *param);
|
||||||
|
@ -378,6 +378,8 @@ public: // per farlo rialzare, altrimenti private
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
RMTony();
|
||||||
|
|
||||||
// Inizializza Tony
|
// Inizializza Tony
|
||||||
void Init(void);
|
void Init(void);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue