aboutsummaryrefslogtreecommitdiff
path: root/engines/tony
diff options
context:
space:
mode:
authorStrangerke2012-06-06 08:31:06 +0200
committerStrangerke2012-06-06 08:31:06 +0200
commit53e38106b73e6ad9e6f725857483bfd35e961326 (patch)
tree050863c3abfbeff77e661a8cdc8109dec767a712 /engines/tony
parentf1ac5d5acdbc0349850377619d8056be22871b42 (diff)
downloadscummvm-rg350-53e38106b73e6ad9e6f725857483bfd35e961326.tar.gz
scummvm-rg350-53e38106b73e6ad9e6f725857483bfd35e961326.tar.bz2
scummvm-rg350-53e38106b73e6ad9e6f725857483bfd35e961326.zip
TONY: Rename variables and functions in inventory.h
That fixes the regression in the credits
Diffstat (limited to 'engines/tony')
-rw-r--r--engines/tony/custom.cpp6
-rw-r--r--engines/tony/font.cpp9
-rw-r--r--engines/tony/font.h4
-rw-r--r--engines/tony/gfxengine.cpp46
-rw-r--r--engines/tony/gfxengine.h2
-rw-r--r--engines/tony/inventory.cpp639
-rw-r--r--engines/tony/inventory.h104
7 files changed, 407 insertions, 403 deletions
diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp
index 84bafc2cd1..2725f2565e 100644
--- a/engines/tony/custom.cpp
+++ b/engines/tony/custom.cpp
@@ -1559,15 +1559,15 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess
}
DECLARE_CUSTOM_FUNCTION(AddInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) {
- GLOBALS.Inventory->AddItem(dwCode);
+ GLOBALS.Inventory->addItem(dwCode);
}
DECLARE_CUSTOM_FUNCTION(RemoveInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) {
- GLOBALS.Inventory->RemoveItem(dwCode);
+ GLOBALS.Inventory->removeItem(dwCode);
}
DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32 dwStatus, uint32, uint32) {
- GLOBALS.Inventory->ChangeItemStatus(dwCode, dwStatus);
+ GLOBALS.Inventory->changeItemStatus(dwCode, dwStatus);
}
diff --git a/engines/tony/font.cpp b/engines/tony/font.cpp
index e967f38199..bc32939061 100644
--- a/engines/tony/font.cpp
+++ b/engines/tony/font.cpp
@@ -157,10 +157,9 @@ RMFontColor::RMFontColor() : RMFont() {
}
RMFontColor::~RMFontColor() {
-
}
-void RMFontColor::SetBaseColor(byte r1, byte g1, byte b1) {
+void RMFontColor::setBaseColor(byte r1, byte g1, byte b1) {
int r = (int)r1 << 16;
int g = (int)g1 << 16;
int b = (int)b1 << 16;
@@ -1832,7 +1831,7 @@ void RMText::writeText(const RMString &text, RMFontColor *font, int *time) {
int numlines;
// Set the base colour
- font->SetBaseColor(m_r, m_g, m_b);
+ font->setBaseColor(m_r, m_g, m_b);
// Destroy the buffer before starting
destroy();
@@ -2244,8 +2243,8 @@ void RMTextItemName::doFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation &
_curscroll = loc.ScrollPosition();
// Check if we are on the inventory
- if (inv.ItemInFocus(_mpos))
- _item = inv.WhichItemIsIn(_mpos);
+ if (inv.itemInFocus(_mpos))
+ _item = inv.whichItemIsIn(_mpos);
else
_item = loc.WhichItemIsIn(_mpos);
diff --git a/engines/tony/font.h b/engines/tony/font.h
index d39b9752a7..2e2b1724a9 100644
--- a/engines/tony/font.h
+++ b/engines/tony/font.h
@@ -60,7 +60,7 @@ private:
RMFontPrimitive() : RMGfxPrimitive() {}
RMFontPrimitive(RMGfxTask *task) : RMGfxPrimitive(task) {}
virtual ~RMFontPrimitive() { }
- virtual RMGfxPrimitive *Duplicate() {
+ virtual RMGfxPrimitive *duplicate() {
return new RMFontPrimitive(*this);
}
@@ -112,7 +112,7 @@ private:
public:
RMFontColor();
virtual ~RMFontColor();
- virtual void SetBaseColor(byte r, byte g, byte b);
+ virtual void setBaseColor(byte r, byte g, byte b);
};
diff --git a/engines/tony/gfxengine.cpp b/engines/tony/gfxengine.cpp
index 08976e6092..a80552b1d1 100644
--- a/engines/tony/gfxengine.cpp
+++ b/engines/tony/gfxengine.cpp
@@ -112,7 +112,7 @@ void RMGfxEngine::openOptionScreen(CORO_PARAM, int type) {
_vm->pauseSound(true);
disableInput();
- _inv.EndCombine();
+ _inv.endCombine();
_curActionObj = 0;
_curAction = TA_GOTO;
_point.setAction(_curAction);
@@ -172,12 +172,12 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) {
// Check the mouse input
if (_bInput && !_tony.InAction()) {
// If we are on the inventory, it is it who controls all input
- if (_inv.HaveFocus(_input.mousePos()) && !_inter.Active()) {
+ if (_inv.haveFocus(_input.mousePos()) && !_inter.active()) {
// Left Click
// **********
if (_input.mouseLeftClicked()/* && m_itemName.IsItemSelected()*/) {
// Left click activates the combine, if we are on an object
- if (_inv.LeftClick(_input.mousePos(), _curActionObj)) {
+ if (_inv.leftClick(_input.mousePos(), _curActionObj)) {
_curAction = TA_COMBINE;
_point.setAction(_curAction);
}
@@ -188,15 +188,15 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) {
if (_input.mouseRightClicked()) {
if (_itemName.isItemSelected()) {
_curActionObj = 0;
- _inv.RightClick(_input.mousePos());
+ _inv.rightClick(_input.mousePos());
} else
- _inv.RightClick(_input.mousePos());
+ _inv.rightClick(_input.mousePos());
} else
// Right Release
// *************
if (_input.mouseRightReleased()) {
- if (_inv.RightRelease(_input.mousePos(), _curAction)) {
+ if (_inv.rightRelease(_input.mousePos(), _curAction)) {
CORO_INVOKE_3(_tony.MoveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), _curAction);
_curAction = TA_GOTO;
@@ -226,7 +226,7 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) {
// Left Click
// **************
- if (_input.mouseLeftClicked() && !_inter.Active()) {
+ if (_input.mouseLeftClicked() && !_inter.active()) {
if (_curAction != TA_COMBINE)
CORO_INVOKE_3(_tony.MoveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), _point.curAction());
@@ -234,7 +234,7 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) {
CORO_INVOKE_4(_tony.MoveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), TA_COMBINE, _curActionObj);
if (_curAction == TA_COMBINE) {
- _inv.EndCombine();
+ _inv.endCombine();
_point.setSpecialPointer(RMPointer::PTR_NONE);
}
@@ -248,7 +248,7 @@ SKIPCLICKSINISTRO:
if (_curAction == TA_COMBINE) {
// During a combine, it cancels it
if (_input.mouseRightClicked()) {
- _inv.EndCombine();
+ _inv.endCombine();
_curActionObj = 0;
_curAction = TA_GOTO;
_point.setAction(_curAction);
@@ -260,7 +260,7 @@ SKIPCLICKSINISTRO:
_curAction = TA_GOTO;
_curActionObj = 0;
_point.setAction(_curAction);
- _inter.Clicked(_input.mousePos());
+ _inter.clicked(_input.mousePos());
}
}
@@ -269,7 +269,7 @@ SKIPCLICKSINISTRO:
// *************
if (_input.mouseRightReleased()) {
if (_bGUIInterface) {
- if (_inter.Released(_input.mousePos(), _curAction)) {
+ if (_inter.released(_input.mousePos(), _curAction)) {
_point.setAction(_curAction);
CORO_INVOKE_3(_tony.MoveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), _curAction);
@@ -282,13 +282,13 @@ SKIPCLICKSINISTRO:
// Update the name under the mouse pointer
_itemName.setMouseCoord(_input.mousePos());
- if (!_inter.Active() && !_inv.MiniActive())
+ if (!_inter.active() && !_inv.miniActive())
CORO_INVOKE_4(_itemName.doFrame, _bigBuf, _loc, _point, _inv);
}
// Interface & Inventory
- _inter.DoFrame(_bigBuf, _input.mousePos());
- _inv.doFrame(_bigBuf, _point, _input.mousePos(), (!_tony.InAction() && !_inter.Active() && _bGUIInventory));
+ _inter.doFrame(_bigBuf, _input.mousePos());
+ _inv.doFrame(_bigBuf, _point, _input.mousePos(), (!_tony.InAction() && !_inter.active() && _bGUIInventory));
}
// Animate Tony
@@ -396,7 +396,7 @@ void RMGfxEngine::initForNewLocation(int nLoc, RMPoint ptTonyStart, RMPoint star
_point.setCustomPointer(NULL);
_point.setSpecialPointer(RMPointer::PTR_NONE);
_point.setAction(_curAction);
- _inter.Reset();
+ _inter.reset();
_inv.reset();
mpalStartIdlePoll(_nCurLoc);
@@ -507,7 +507,7 @@ void RMGfxEngine::init() {
// Initialise the inventory and the interface
_inv.init();
- _inter.Init();
+ _inter.init();
// Download the location and set priorities @@@@@
_bLocationLoaded = false;
@@ -521,7 +521,7 @@ void RMGfxEngine::init() {
void RMGfxEngine::close(void) {
_bigBuf.clearOT();
- _inter.Close();
+ _inter.close();
_inv.close();
_tony.Close();
_point.close();
@@ -540,7 +540,7 @@ void RMGfxEngine::enableInput(void) {
void RMGfxEngine::disableInput(void) {
_bInput = false;
- _inter.Reset();
+ _inter.reset();
}
void RMGfxEngine::enableMouse(void) {
@@ -619,9 +619,9 @@ void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Comm
delete[] state;
// Inventory
- size = _inv.GetSaveStateSize();
+ size = _inv.getSaveStateSize();
state = new byte[size];
- _inv.SaveState(state);
+ _inv.saveState(state);
f->writeUint32LE(size);
f->write(state, size);
delete[] state;
@@ -640,7 +640,7 @@ void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Comm
// Saves the state of the shepherdess and show yourself
bStat = _tony.GetPastorella();
f->writeByte(bStat);
- bStat = _inter.GetPalesati();
+ bStat = _inter.getPalesati();
f->writeByte(bStat);
// Save the chars
@@ -758,7 +758,7 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
_ctx->size = _ctx->f->readUint32LE();
_ctx->state = new byte[_ctx->size];
_ctx->f->read(_ctx->state, _ctx->size);
- _inv.LoadState(_ctx->state);
+ _inv.loadState(_ctx->state);
delete[] _ctx->state;
if (_ctx->ver >= 0x2) { // Versione 2: box please
@@ -776,7 +776,7 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
bStat = _ctx->f->readByte();
_tony.SetPastorella(bStat);
bStat = _ctx->f->readByte();
- _inter.SetPalesati(bStat);
+ _inter.setPalesati(bStat);
CharsLoadAll(_ctx->f);
}
diff --git a/engines/tony/gfxengine.h b/engines/tony/gfxengine.h
index 69d36cbbc0..8d9648c454 100644
--- a/engines/tony/gfxengine.h
+++ b/engines/tony/gfxengine.h
@@ -145,7 +145,7 @@ public:
void waitWipeEnd(CORO_PARAM);
void setPalesati(bool bpal) {
- _inter.SetPalesati(bpal);
+ _inter.setPalesati(bpal);
}
bool canLoadSave();
};
diff --git a/engines/tony/inventory.cpp b/engines/tony/inventory.cpp
index 360e53803e..595a1ba0f2 100644
--- a/engines/tony/inventory.cpp
+++ b/engines/tony/inventory.cpp
@@ -40,31 +40,31 @@ namespace Tony {
\****************************************************************************/
RMInventory::RMInventory() {
- m_items = NULL;
- m_state = CLOSED;
- 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;
+ _items = NULL;
+ _state = CLOSED;
+ _bCombining = false;
+ _csModifyInterface = g_system->createMutex();
+ _nItems = 0;
+
+ Common::fill(_inv, _inv + 256, 0);
+ _nInv = 0;
+ _curPutY = 0;
+ _curPutTime = 0;
+ _curPos = 0;
+ _bHasFocus = false;
+ _nSelectObj = 0;
+ _nCombine = 0;
+ _bBlinkingRight = false;
+ _bBlinkingLeft = false;
miniAction = 0;
}
RMInventory::~RMInventory() {
close();
- g_system->deleteMutex(m_csModifyInterface);
+ g_system->deleteMutex(_csModifyInterface);
}
-bool RMInventory::CheckPointInside(const RMPoint &pt) {
+bool RMInventory::checkPointInside(const RMPoint &pt) {
if (!GLOBALS.bCfgInvUp)
return pt.y > RM_SY - 70;
else
@@ -81,18 +81,18 @@ void RMInventory::init(void) {
setPriority(185);
// Setup the inventory
- m_nInv = 0;
- m_curPos = 0;
- m_bCombining = false;
+ _nInv = 0;
+ _curPos = 0;
+ _bCombining = false;
// New items
- m_nItems = 78; // @@@ Number of takeable items
- m_items = new RMInventoryItem[m_nItems + 1];
+ _nItems = 78; // @@@ Number of takeable items
+ _items = new RMInventoryItem[_nItems + 1];
curres = 10500;
// Loop through the items
- for (i = 0; i <= m_nItems; i++) {
+ for (i = 0; i <= _nItems; i++) {
// Load the items from the resource
RMRes res(curres);
RMDataStream ds;
@@ -100,34 +100,35 @@ void RMInventory::init(void) {
assert(res.IsValid());
// Initialise the MPAL inventory item by reading it in.
- m_items[i].icon.SetInitCurPattern(false);
+ _items[i].icon.SetInitCurPattern(false);
ds.OpenBuffer(res);
- ds >> m_items[i].icon;
+ ds >> _items[i].icon;
ds.Close();
// Puts in the default pattern 1
- m_items[i].pointer = NULL;
- m_items[i].status = 1;
- m_items[i].icon.SetPattern(1);
- m_items[i].icon.doFrame(this, false);
+ _items[i].pointer = NULL;
+ _items[i].status = 1;
+ _items[i].icon.SetPattern(1);
+ _items[i].icon.doFrame(this, false);
curres++;
- if (i == 0 || i == 28 || i == 29) continue;
+ if (i == 0 || i == 28 || i == 29)
+ continue;
- m_items[i].pointer = new RMGfxSourceBuffer8RLEByteAA[m_items[i].icon.NumPattern()];
+ _items[i].pointer = new RMGfxSourceBuffer8RLEByteAA[_items[i].icon.NumPattern()];
- for (j = 0; j < m_items[i].icon.NumPattern(); j++) {
+ for (j = 0; j < _items[i].icon.NumPattern(); j++) {
RMResRaw raw(curres);
assert(raw.IsValid());
- m_items[i].pointer[j].init((const byte *)raw, raw.Width(), raw.Height(), true);
+ _items[i].pointer[j].init((const byte *)raw, raw.Width(), raw.Height(), true);
curres++;
}
}
- m_items[28].icon.SetPattern(1);
- m_items[29].icon.SetPattern(1);
+ _items[28].icon.SetPattern(1);
+ _items[29].icon.SetPattern(1);
// Download interface
RMDataStream ds;
@@ -139,18 +140,18 @@ void RMInventory::init(void) {
ds.Close();
// Create the text for hints on the mini interface
- m_hints[0].setAlignType(RMText::HCENTER, RMText::VTOP);
- m_hints[1].setAlignType(RMText::HCENTER, RMText::VTOP);
- m_hints[2].setAlignType(RMText::HCENTER, RMText::VTOP);
+ _hints[0].setAlignType(RMText::HCENTER, RMText::VTOP);
+ _hints[1].setAlignType(RMText::HCENTER, RMText::VTOP);
+ _hints[2].setAlignType(RMText::HCENTER, RMText::VTOP);
// The text is taken from MPAL for translation
RMMessage msg1(15);
RMMessage msg2(13);
RMMessage msg3(14);
- m_hints[0].writeText(msg1[0], 1); // Examine
- m_hints[1].writeText(msg2[0], 1); // Take
- m_hints[2].writeText(msg3[0], 1); // Use
+ _hints[0].writeText(msg1[0], 1); // Examine
+ _hints[1].writeText(msg2[0], 1); // Take
+ _hints[2].writeText(msg3[0], 1); // Use
// Prepare initial inventory
@@ -161,22 +162,22 @@ void RMInventory::init(void) {
void RMInventory::close(void) {
// Has memory
- if (m_items != NULL) {
+ if (_items != NULL) {
// Delete the item pointers
- for (int i = 0; i <= m_nItems; i++)
- delete[] m_items[i].pointer;
+ for (int i = 0; i <= _nItems; i++)
+ delete[] _items[i].pointer;
// Delete the items array
- delete[] m_items;
- m_items = NULL;
+ delete[] _items;
+ _items = NULL;
}
destroy();
}
void RMInventory::reset(void) {
- m_state = CLOSED;
- EndCombine();
+ _state = CLOSED;
+ endCombine();
}
void RMInventory::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) {
@@ -189,23 +190,23 @@ void RMInventory::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
CORO_BEGIN_CODE(_ctx);
- if (m_state == OPENING || m_state == CLOSING)
- prim->setDst(RMPoint(0, m_curPutY));
+ if (_state == OPENING || _state == CLOSING)
+ prim->setDst(RMPoint(0, _curPutY));
else
- prim->setDst(RMPoint(0, m_curPutY));
+ prim->setDst(RMPoint(0, _curPutY));
- g_system->lockMutex(m_csModifyInterface);
+ g_system->lockMutex(_csModifyInterface);
CORO_INVOKE_2(RMGfxWoodyBuffer::draw, bigBuf, prim);
- g_system->unlockMutex(m_csModifyInterface);
+ g_system->unlockMutex(_csModifyInterface);
- if (m_state == SELECTING) {
+ if (_state == SELECTING) {
if (!GLOBALS.bCfgInvUp) {
- _ctx->pos.Set((m_nSelectObj + 1) * 64 - 20, RM_SY - 113);
- _ctx->pos2.Set((m_nSelectObj + 1) * 64 + 34, RM_SY - 150);
+ _ctx->pos.Set((_nSelectObj + 1) * 64 - 20, RM_SY - 113);
+ _ctx->pos2.Set((_nSelectObj + 1) * 64 + 34, RM_SY - 150);
} else {
- _ctx->pos.Set((m_nSelectObj + 1) * 64 - 20, 72 - 4); // The brown part is at the top :(
- _ctx->pos2.Set((m_nSelectObj + 1) * 64 + 34, 119 - 4);
+ _ctx->pos.Set((_nSelectObj + 1) * 64 - 20, 72 - 4); // The brown part is at the top :(
+ _ctx->pos2.Set((_nSelectObj + 1) * 64 + 34, 119 - 4);
}
_ctx->p = new RMGfxPrimitive(prim->_task, _ctx->pos);
@@ -216,11 +217,11 @@ void RMInventory::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
if (GLOBALS.bCfgInterTips) {
if (miniAction == 1) // Examine
- CORO_INVOKE_2(m_hints[0].draw, bigBuf, _ctx->p2);
+ CORO_INVOKE_2(_hints[0].draw, bigBuf, _ctx->p2);
else if (miniAction == 2) // Talk
- CORO_INVOKE_2(m_hints[1].draw, bigBuf, _ctx->p2);
+ CORO_INVOKE_2(_hints[1].draw, bigBuf, _ctx->p2);
else if (miniAction == 3) // Use
- CORO_INVOKE_2(m_hints[2].draw, bigBuf, _ctx->p2);
+ CORO_INVOKE_2(_hints[2].draw, bigBuf, _ctx->p2);
}
delete _ctx->p;
@@ -231,62 +232,62 @@ void RMInventory::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
}
void RMInventory::removeThis(CORO_PARAM, bool &result) {
- if (m_state == CLOSED)
+ if (_state == CLOSED)
result = true;
else
result = false;
}
-void RMInventory::RemoveItem(int code) {
+void RMInventory::removeItem(int code) {
int i;
- for (i = 0; i < m_nInv; i++)
- if (m_inv[i] == code - 10000) {
- g_system->lockMutex(m_csModifyInterface);
+ for (i = 0; i < _nInv; i++)
+ if (_inv[i] == code - 10000) {
+ g_system->lockMutex(_csModifyInterface);
- Common::copy(&m_inv[i + 1], &m_inv[i + 1] + (m_nInv - i), &m_inv[i]);
- m_nInv--;
+ Common::copy(&_inv[i + 1], &_inv[i + 1] + (_nInv - i), &_inv[i]);
+ _nInv--;
prepare();
drawOT(Common::nullContext);
clearOT();
- g_system->unlockMutex(m_csModifyInterface);
+ g_system->unlockMutex(_csModifyInterface);
return;
}
}
-void RMInventory::AddItem(int code) {
+void RMInventory::addItem(int code) {
if (code <= 10000 && code >= 10101) {
// If we are here, it means that we are adding an item that should not be in the inventory
warning("Cannot find a valid icon for this item, and then it will not be added to the inventory");
} else {
- g_system->lockMutex(m_csModifyInterface);
- if (m_curPos + 8 == m_nInv) {
+ g_system->lockMutex(_csModifyInterface);
+ if (_curPos + 8 == _nInv) {
// Break through the inventory! On the flashing pattern
- m_items[28].icon.SetPattern(2);
+ _items[28].icon.SetPattern(2);
}
- m_inv[m_nInv++] = code - 10000;
+ _inv[_nInv++] = code - 10000;
prepare();
drawOT(Common::nullContext);
clearOT();
- g_system->unlockMutex(m_csModifyInterface);
+ g_system->unlockMutex(_csModifyInterface);
}
}
-void RMInventory::ChangeItemStatus(uint32 code, uint32 dwStatus) {
+void RMInventory::changeItemStatus(uint32 code, uint32 dwStatus) {
if (code <= 10000 && code >= 10101) {
error("Specified object code is not valid");
} else {
- g_system->lockMutex(m_csModifyInterface);
- m_items[code - 10000].icon.SetPattern(dwStatus);
- m_items[code - 10000].status = dwStatus;
+ g_system->lockMutex(_csModifyInterface);
+ _items[code - 10000].icon.SetPattern(dwStatus);
+ _items[code - 10000].status = dwStatus;
prepare();
drawOT(Common::nullContext);
clearOT();
- g_system->unlockMutex(m_csModifyInterface);
+ g_system->unlockMutex(_csModifyInterface);
}
}
@@ -295,52 +296,52 @@ void RMInventory::prepare(void) {
int i;
for (i = 1; i < RM_SX / 64 - 1; i++) {
- if (i - 1 + m_curPos < m_nInv)
- addPrim(new RMGfxPrimitive(&m_items[m_inv[i - 1 + m_curPos]].icon, RMPoint(i * 64, 0)));
+ if (i - 1 + _curPos < _nInv)
+ addPrim(new RMGfxPrimitive(&_items[_inv[i - 1 + _curPos]].icon, RMPoint(i * 64, 0)));
else
- addPrim(new RMGfxPrimitive(&m_items[0].icon, RMPoint(i * 64, 0)));
+ addPrim(new RMGfxPrimitive(&_items[0].icon, RMPoint(i * 64, 0)));
}
// Frecce
- addPrim(new RMGfxPrimitive(&m_items[29].icon, RMPoint(0, 0)));
- addPrim(new RMGfxPrimitive(&m_items[28].icon, RMPoint(640 - 64, 0)));
+ addPrim(new RMGfxPrimitive(&_items[29].icon, RMPoint(0, 0)));
+ addPrim(new RMGfxPrimitive(&_items[28].icon, RMPoint(640 - 64, 0)));
}
-bool RMInventory::MiniActive(void) {
- return m_state == SELECTING;
+bool RMInventory::miniActive(void) {
+ return _state == SELECTING;
}
-bool RMInventory::HaveFocus(const RMPoint &mpos) {
+bool RMInventory::haveFocus(const RMPoint &mpos) {
// When we combine, have the focus only if we are on an arrow (to scroll)
- if (m_state == OPENED && m_bCombining && CheckPointInside(mpos) && (mpos.x < 64 || mpos.x > RM_SX - 64))
+ if (_state == OPENED && _bCombining && checkPointInside(mpos) && (mpos.x < 64 || mpos.x > RM_SX - 64))
return true;
// If the inventory is open, focus we we go over it
- if (m_state == OPENED && !m_bCombining && CheckPointInside(mpos))
+ if (_state == OPENED && !_bCombining && checkPointInside(mpos))
return true;
// If we are selecting a verb (and then right down), we always focus
- if (m_state == SELECTING)
+ if (_state == SELECTING)
return true;
return false;
}
-void RMInventory::EndCombine(void) {
- m_bCombining = false;
+void RMInventory::endCombine(void) {
+ _bCombining = false;
}
-bool RMInventory::LeftClick(const RMPoint &mpos, int &nCombineObj) {
+bool RMInventory::leftClick(const RMPoint &mpos, int &nCombineObj) {
int n;
// The left click picks an item from your inventory to use it with the background
n = mpos.x / 64;
- if (m_state == OPENED) {
- if (n > 0 && n < RM_SX / 64 - 1 && m_inv[n - 1 + m_curPos] != 0) {
- m_bCombining = true; //m_state = COMBINING;
- m_nCombine = m_inv[n - 1 + m_curPos];
- nCombineObj = m_nCombine + 10000;
+ if (_state == OPENED) {
+ if (n > 0 && n < RM_SX / 64 - 1 && _inv[n - 1 + _curPos] != 0) {
+ _bCombining = true; //m_state = COMBINING;
+ _nCombine = _inv[n - 1 + _curPos];
+ nCombineObj = _nCombine + 10000;
_vm->playUtilSFX(1);
return true;
@@ -348,116 +349,116 @@ bool RMInventory::LeftClick(const RMPoint &mpos, int &nCombineObj) {
}
// Click the right arrow
- if ((m_state == OPENED) && m_bBlinkingRight) {
- g_system->lockMutex(m_csModifyInterface);
- m_curPos++;
+ if ((_state == OPENED) && _bBlinkingRight) {
+ g_system->lockMutex(_csModifyInterface);
+ _curPos++;
- if (m_curPos + 8 >= m_nInv) {
- m_bBlinkingRight = false;
- m_items[28].icon.SetPattern(1);
+ if (_curPos + 8 >= _nInv) {
+ _bBlinkingRight = false;
+ _items[28].icon.SetPattern(1);
}
- if (m_curPos > 0) {
- m_bBlinkingLeft = true;
- m_items[29].icon.SetPattern(2);
+ if (_curPos > 0) {
+ _bBlinkingLeft = true;
+ _items[29].icon.SetPattern(2);
}
prepare();
drawOT(Common::nullContext);
clearOT();
- g_system->unlockMutex(m_csModifyInterface);
+ g_system->unlockMutex(_csModifyInterface);
}
// Click the left arrow
- else if ((m_state == OPENED) && m_bBlinkingLeft) {
- assert(m_curPos > 0);
- g_system->lockMutex(m_csModifyInterface);
- m_curPos--;
-
- if (m_curPos == 0) {
- m_bBlinkingLeft = false;
- m_items[29].icon.SetPattern(1);
+ else if ((_state == OPENED) && _bBlinkingLeft) {
+ assert(_curPos > 0);
+ g_system->lockMutex(_csModifyInterface);
+ _curPos--;
+
+ if (_curPos == 0) {
+ _bBlinkingLeft = false;
+ _items[29].icon.SetPattern(1);
}
- if (m_curPos + 8 < m_nInv) {
- m_bBlinkingRight = true;
- m_items[28].icon.SetPattern(2);
+ if (_curPos + 8 < _nInv) {
+ _bBlinkingRight = true;
+ _items[28].icon.SetPattern(2);
}
prepare();
drawOT(Common::nullContext);
clearOT();
- g_system->unlockMutex(m_csModifyInterface);
+ g_system->unlockMutex(_csModifyInterface);
}
return false;
}
-
-void RMInventory::RightClick(const RMPoint &mpos) {
+void RMInventory::rightClick(const RMPoint &mpos) {
int n;
- assert(CheckPointInside(mpos));
+ assert(checkPointInside(mpos));
- if (m_state == OPENED && !m_bCombining) {
+ if (_state == OPENED && !_bCombining) {
// Open the context interface
n = mpos.x / 64;
- if (n > 0 && n < RM_SX / 64 - 1 && m_inv[n - 1 + m_curPos] != 0) {
- m_state = SELECTING;
+ if (n > 0 && n < RM_SX / 64 - 1 && _inv[n - 1 + _curPos] != 0) {
+ _state = SELECTING;
miniAction = 0;
- m_nSelectObj = n - 1;
+ _nSelectObj = n - 1;
_vm->playUtilSFX(0);
}
}
- if ((m_state == OPENED) && m_bBlinkingRight) {
- g_system->lockMutex(m_csModifyInterface);
- m_curPos += 7;
- if (m_curPos + 8 > m_nInv)
- m_curPos = m_nInv - 8;
+ if ((_state == OPENED) && _bBlinkingRight) {
+ g_system->lockMutex(_csModifyInterface);
+ _curPos += 7;
+ if (_curPos + 8 > _nInv)
+ _curPos = _nInv - 8;
- if (m_curPos + 8 <= m_nInv) {
- m_bBlinkingRight = false;
- m_items[28].icon.SetPattern(1);
+ if (_curPos + 8 <= _nInv) {
+ _bBlinkingRight = false;
+ _items[28].icon.SetPattern(1);
}
- if (m_curPos > 0) {
- m_bBlinkingLeft = true;
- m_items[29].icon.SetPattern(2);
+ if (_curPos > 0) {
+ _bBlinkingLeft = true;
+ _items[29].icon.SetPattern(2);
}
prepare();
drawOT(Common::nullContext);
clearOT();
- g_system->unlockMutex(m_csModifyInterface);
- } else if ((m_state == OPENED) && m_bBlinkingLeft) {
- assert(m_curPos > 0);
- g_system->lockMutex(m_csModifyInterface);
- m_curPos -= 7;
- if (m_curPos < 0) m_curPos = 0;
-
- if (m_curPos == 0) {
- m_bBlinkingLeft = false;
- m_items[29].icon.SetPattern(1);
+ g_system->unlockMutex(_csModifyInterface);
+ } else if ((_state == OPENED) && _bBlinkingLeft) {
+ assert(_curPos > 0);
+ g_system->lockMutex(_csModifyInterface);
+ _curPos -= 7;
+ if (_curPos < 0)
+ _curPos = 0;
+
+ if (_curPos == 0) {
+ _bBlinkingLeft = false;
+ _items[29].icon.SetPattern(1);
}
- if (m_curPos + 8 < m_nInv) {
- m_bBlinkingRight = true;
- m_items[28].icon.SetPattern(2);
+ if (_curPos + 8 < _nInv) {
+ _bBlinkingRight = true;
+ _items[28].icon.SetPattern(2);
}
prepare();
drawOT(Common::nullContext);
clearOT();
- g_system->unlockMutex(m_csModifyInterface);
+ g_system->unlockMutex(_csModifyInterface);
}
}
-bool RMInventory::RightRelease(const RMPoint &mpos, RMTonyAction &curAction) {
- if (m_state == SELECTING) {
- m_state = OPENED;
+bool RMInventory::rightRelease(const RMPoint &mpos, RMTonyAction &curAction) {
+ if (_state == SELECTING) {
+ _state = OPENED;
if (miniAction == 1) { // Esamina
curAction = TA_EXAMINE;
@@ -480,147 +481,147 @@ void RMInventory::doFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
int i;
bool bNeedRedraw = false;
- if (m_state != CLOSED) {
+ if (_state != CLOSED) {
// Clean up the OT list
- g_system->lockMutex(m_csModifyInterface);
+ g_system->lockMutex(_csModifyInterface);
clearOT();
// 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 < m_nInv; i++)
- if (m_items[m_inv[i]].icon.doFrame(this, false) && (i >= m_curPos && i <= m_curPos + 7))
+ for (i = 0; i < _nInv; i++)
+ if (_items[_inv[i]].icon.doFrame(this, false) && (i >= _curPos && i <= _curPos + 7))
bNeedRedraw = true;
- if ((m_state == CLOSING || m_state == OPENING || m_state == OPENED) && CheckPointInside(mpos)) {
+ if ((_state == CLOSING || _state == OPENING || _state == OPENED) && checkPointInside(mpos)) {
if (mpos.x > RM_SX - 64) {
- if (m_curPos + 8 < m_nInv && !m_bBlinkingRight) {
- m_items[28].icon.SetPattern(3);
- m_bBlinkingRight = true;
+ if (_curPos + 8 < _nInv && !_bBlinkingRight) {
+ _items[28].icon.SetPattern(3);
+ _bBlinkingRight = true;
bNeedRedraw = true;
}
- } else if (m_bBlinkingRight) {
- m_items[28].icon.SetPattern(2);
- m_bBlinkingRight = false;
+ } else if (_bBlinkingRight) {
+ _items[28].icon.SetPattern(2);
+ _bBlinkingRight = false;
bNeedRedraw = true;
}
if (mpos.x < 64) {
- if (m_curPos > 0 && !m_bBlinkingLeft) {
- m_items[29].icon.SetPattern(3);
- m_bBlinkingLeft = true;
+ if (_curPos > 0 && !_bBlinkingLeft) {
+ _items[29].icon.SetPattern(3);
+ _bBlinkingLeft = true;
bNeedRedraw = true;
}
- } else if (m_bBlinkingLeft) {
- m_items[29].icon.SetPattern(2);
- m_bBlinkingLeft = false;
+ } else if (_bBlinkingLeft) {
+ _items[29].icon.SetPattern(2);
+ _bBlinkingLeft = false;
bNeedRedraw = true;
}
}
- if (m_items[28].icon.doFrame(this, false))
+ if (_items[28].icon.doFrame(this, false))
bNeedRedraw = true;
- if (m_items[29].icon.doFrame(this, false))
+ if (_items[29].icon.doFrame(this, false))
bNeedRedraw = true;
if (bNeedRedraw)
prepare();
- g_system->unlockMutex(m_csModifyInterface);
+ g_system->unlockMutex(_csModifyInterface);
}
if (_vm->getEngine()->getInput().getAsyncKeyState(Common::KEYCODE_i)) {
GLOBALS.bCfgInvLocked = !GLOBALS.bCfgInvLocked;
}
- if (m_bCombining) {//m_state == COMBINING)
- ptr.setCustomPointer(&m_items[m_nCombine].pointer[m_items[m_nCombine].status - 1]);
+ if (_bCombining) {//m_state == COMBINING)
+ ptr.setCustomPointer(&_items[_nCombine].pointer[_items[_nCombine].status - 1]);
ptr.setSpecialPointer(RMPointer::PTR_CUSTOM);
}
if (!GLOBALS.bCfgInvUp) {
- if ((m_state == CLOSED) && (mpos.y > RM_SY - 10 || GLOBALS.bCfgInvLocked) && bCanOpen) {
+ if ((_state == CLOSED) && (mpos.y > RM_SY - 10 || GLOBALS.bCfgInvLocked) && bCanOpen) {
if (!GLOBALS.bCfgInvNoScroll) {
- m_state = OPENING;
- m_curPutY = RM_SY - 1;
- m_curPutTime = _vm->getTime();
+ _state = OPENING;
+ _curPutY = RM_SY - 1;
+ _curPutTime = _vm->getTime();
} else {
- m_state = OPENED;
- m_curPutY = RM_SY - 68;
+ _state = OPENED;
+ _curPutY = RM_SY - 68;
}
- } else if (m_state == OPENED) {
+ } else if (_state == OPENED) {
if ((mpos.y < RM_SY - 70 && !GLOBALS.bCfgInvLocked) || !bCanOpen) {
if (!GLOBALS.bCfgInvNoScroll) {
- m_state = CLOSING;
- m_curPutY = RM_SY - 68;
- m_curPutTime = _vm->getTime();
+ _state = CLOSING;
+ _curPutY = RM_SY - 68;
+ _curPutTime = _vm->getTime();
} else {
- m_state = CLOSED;
+ _state = CLOSED;
}
}
- } else if (m_state == OPENING) {
- while (m_curPutTime + INVSPEED < _vm->getTime()) {
- m_curPutY -= 3;
- m_curPutTime += INVSPEED;
+ } else if (_state == OPENING) {
+ while (_curPutTime + INVSPEED < _vm->getTime()) {
+ _curPutY -= 3;
+ _curPutTime += INVSPEED;
}
- if (m_curPutY <= RM_SY - 68) {
- m_state = OPENED;
- m_curPutY = RM_SY - 68;
+ if (_curPutY <= RM_SY - 68) {
+ _state = OPENED;
+ _curPutY = RM_SY - 68;
}
- } else if (m_state == CLOSING) {
- while (m_curPutTime + INVSPEED < _vm->getTime()) {
- m_curPutY += 3;
- m_curPutTime += INVSPEED;
+ } else if (_state == CLOSING) {
+ while (_curPutTime + INVSPEED < _vm->getTime()) {
+ _curPutY += 3;
+ _curPutTime += INVSPEED;
}
- if (m_curPutY > 480)
- m_state = CLOSED;
+ if (_curPutY > 480)
+ _state = CLOSED;
}
} else {
- if ((m_state == CLOSED) && (mpos.y < 10 || GLOBALS.bCfgInvLocked) && bCanOpen) {
+ if ((_state == CLOSED) && (mpos.y < 10 || GLOBALS.bCfgInvLocked) && bCanOpen) {
if (!GLOBALS.bCfgInvNoScroll) {
- m_state = OPENING;
- m_curPutY = - 68;
- m_curPutTime = _vm->getTime();
+ _state = OPENING;
+ _curPutY = - 68;
+ _curPutTime = _vm->getTime();
} else {
- m_state = OPENED;
- m_curPutY = 0;
+ _state = OPENED;
+ _curPutY = 0;
}
- } else if (m_state == OPENED) {
+ } else if (_state == OPENED) {
if ((mpos.y > 70 && !GLOBALS.bCfgInvLocked) || !bCanOpen) {
if (!GLOBALS.bCfgInvNoScroll) {
- m_state = CLOSING;
- m_curPutY = -2;
- m_curPutTime = _vm->getTime();
+ _state = CLOSING;
+ _curPutY = -2;
+ _curPutTime = _vm->getTime();
} else {
- m_state = CLOSED;
+ _state = CLOSED;
}
}
- } else if (m_state == OPENING) {
- while (m_curPutTime + INVSPEED < _vm->getTime()) {
- m_curPutY += 3;
- m_curPutTime += INVSPEED;
+ } else if (_state == OPENING) {
+ while (_curPutTime + INVSPEED < _vm->getTime()) {
+ _curPutY += 3;
+ _curPutTime += INVSPEED;
}
- if (m_curPutY >= 0) {
- m_state = OPENED;
- m_curPutY = 0;
+ if (_curPutY >= 0) {
+ _state = OPENED;
+ _curPutY = 0;
}
- } else if (m_state == CLOSING) {
- while (m_curPutTime + INVSPEED < _vm->getTime()) {
- m_curPutY -= 3;
- m_curPutTime += INVSPEED;
+ } else if (_state == CLOSING) {
+ while (_curPutTime + INVSPEED < _vm->getTime()) {
+ _curPutY -= 3;
+ _curPutTime += INVSPEED;
}
- if (m_curPutY < -68)
- m_state = CLOSED;
+ if (_curPutY < -68)
+ _state = CLOSED;
}
}
- if (m_state == SELECTING) {
- int startx = (m_nSelectObj + 1) * 64 - 20;
+ if (_state == SELECTING) {
+ int startx = (_nSelectObj + 1) * 64 - 20;
int starty;
if (!GLOBALS.bCfgInvUp)
@@ -661,27 +662,27 @@ void RMInventory::doFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo
miniInterface.doFrame(&bigBuf, false);
}
- if ((m_state != CLOSED) && !_nInList) {
+ if ((_state != CLOSED) && !_nInList) {
bigBuf.addPrim(new RMGfxPrimitive(this));
}
}
-bool RMInventory::ItemInFocus(const RMPoint &mpt) {
- if ((m_state == OPENED || m_state == OPENING) && CheckPointInside(mpt))
+bool RMInventory::itemInFocus(const RMPoint &mpt) {
+ if ((_state == OPENED || _state == OPENING) && checkPointInside(mpt))
return true;
else
return false;
}
-RMItem *RMInventory::WhichItemIsIn(const RMPoint &mpt) {
+RMItem *RMInventory::whichItemIsIn(const RMPoint &mpt) {
int n;
- if (m_state == OPENED) {
- if (CheckPointInside(mpt)) {
+ if (_state == OPENED) {
+ if (checkPointInside(mpt)) {
n = mpt.x / 64;
- if (n > 0 && n < RM_SX / 64 - 1 && m_inv[n - 1 + m_curPos] != 0 && (!m_bCombining || m_inv[n - 1 + m_curPos] != m_nCombine))
- return &m_items[m_inv[n - 1 + m_curPos]].icon;
+ 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;
}
}
@@ -690,22 +691,22 @@ RMItem *RMInventory::WhichItemIsIn(const RMPoint &mpt) {
-int RMInventory::GetSaveStateSize(void) {
+int RMInventory::getSaveStateSize(void) {
// m_inv pattern m_nInv
return 256 * 4 + 256 * 4 + 4 ;
}
-void RMInventory::SaveState(byte *state) {
+void RMInventory::saveState(byte *state) {
int i, x;
- WRITE_LE_UINT32(state, m_nInv);
+ WRITE_LE_UINT32(state, _nInv);
state += 4;
- Common::copy(m_inv, m_inv + 256, (uint32 *)state);
+ Common::copy(_inv, _inv + 256, (uint32 *)state);
state += 256 * 4;
for (i = 0; i < 256; i++) {
- if (i < m_nItems)
- x = m_items[i].status;
+ if (i < _nItems)
+ x = _items[i].status;
else
x = 0;
@@ -714,39 +715,39 @@ void RMInventory::SaveState(byte *state) {
}
}
-int RMInventory::LoadState(byte *state) {
+int RMInventory::loadState(byte *state) {
int i, x;
- m_nInv = READ_LE_UINT32(state);
+ _nInv = READ_LE_UINT32(state);
state += 4;
- Common::copy((uint32 *)state, (uint32 *)state + 256, m_inv);
+ Common::copy((uint32 *)state, (uint32 *)state + 256, _inv);
state += 256 * 4;
for (i = 0; i < 256; i++) {
x = READ_LE_UINT32(state);
state += 4;
- if (i < m_nItems) {
- m_items[i].status = x;
- m_items[i].icon.SetPattern(x);
+ if (i < _nItems) {
+ _items[i].status = x;
+ _items[i].icon.SetPattern(x);
}
}
- m_curPos = 0;
- m_bCombining = false;
-
- m_items[29].icon.SetPattern(1);
+ _curPos = 0;
+ _bCombining = false;
+
+ _items[29].icon.SetPattern(1);
- if (m_nInv > 8)
- m_items[28].icon.SetPattern(2);
+ if (_nInv > 8)
+ _items[28].icon.SetPattern(2);
else
- m_items[28].icon.SetPattern(1);
+ _items[28].icon.SetPattern(1);
prepare();
drawOT(Common::nullContext);
clearOT();
- return GetSaveStateSize();
+ return getSaveStateSize();
}
@@ -758,22 +759,22 @@ RMInterface::~RMInterface() {
}
-bool RMInterface::Active() {
- return m_bActive;
+bool RMInterface::active() {
+ return _bActive;
}
-int RMInterface::OnWhichBox(RMPoint pt) {
+int RMInterface::onWhichBox(RMPoint pt) {
int max, i;
- pt -= m_openStart;
+ pt -= _openStart;
// Check how many verbs you have to consider
max = 4;
- if (m_bPalesati) max = 5;
+ if (_bPalesati) max = 5;
// Find the verb
for (i = 0; i < max; i++)
- if (m_hotbbox[i].PtInRect(pt))
+ if (_hotbbox[i].PtInRect(pt))
return i;
// Found no verb
@@ -787,64 +788,68 @@ void RMInterface::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr
CORO_BEGIN_CODE(_ctx);
- prim->Dst().TopLeft() = m_openStart;
+ prim->Dst().TopLeft() = _openStart;
CORO_INVOKE_2(RMGfxSourceBuffer8RLEByte::draw, bigBuf, prim);
// Check if there is a draw hot zone
- _ctx->h = OnWhichBox(m_mpos);
+ _ctx->h = onWhichBox(_mpos);
if (_ctx->h != -1) {
- prim->Dst().TopLeft() = m_openStart;
- CORO_INVOKE_2(m_hotzone[_ctx->h].draw, bigBuf, prim);
+ prim->Dst().TopLeft() = _openStart;
+ CORO_INVOKE_2(_hotzone[_ctx->h].draw, bigBuf, prim);
- if (m_lastHotZone != _ctx->h) {
- m_lastHotZone = _ctx->h;
+ if (_lastHotZone != _ctx->h) {
+ _lastHotZone = _ctx->h;
_vm->playUtilSFX(1);
}
if (GLOBALS.bCfgInterTips) {
- prim->Dst().TopLeft() = m_openStart + RMPoint(70, 177);
- CORO_INVOKE_2(m_hints[_ctx->h].draw, bigBuf, prim);
+ prim->Dst().TopLeft() = _openStart + RMPoint(70, 177);
+ CORO_INVOKE_2(_hints[_ctx->h].draw, bigBuf, prim);
}
} else
- m_lastHotZone = -1;
+ _lastHotZone = -1;
CORO_END_CODE;
}
-void RMInterface::DoFrame(RMGfxTargetBuffer &bigBuf, RMPoint mousepos) {
+void RMInterface::doFrame(RMGfxTargetBuffer &bigBuf, RMPoint mousepos) {
// If needed, add to the OT schedule list
- if (!_nInList && m_bActive)
+ if (!_nInList && _bActive)
bigBuf.addPrim(new RMGfxPrimitive(this));
- m_mpos = mousepos;
+ _mpos = mousepos;
}
-void RMInterface::Clicked(const RMPoint &mousepos) {
- m_bActive = true;
- m_openPos = mousepos;
+void RMInterface::clicked(const RMPoint &mousepos) {
+ _bActive = true;
+ _openPos = mousepos;
// Calculate the top left corner of the interface
- m_openStart = m_openPos - RMPoint(_dimx / 2, _dimy / 2);
- m_lastHotZone = -1;
+ _openStart = _openPos - RMPoint(_dimx / 2, _dimy / 2);
+ _lastHotZone = -1;
// Keep it inside the screen
- if (m_openStart.x < 0) m_openStart.x = 0;
- if (m_openStart.y < 0) m_openStart.y = 0;
- if (m_openStart.x + _dimx > RM_SX) m_openStart.x = RM_SX - _dimx;
- if (m_openStart.y + _dimy > RM_SY) m_openStart.y = RM_SY - _dimy;
+ if (_openStart.x < 0)
+ _openStart.x = 0;
+ if (_openStart.y < 0)
+ _openStart.y = 0;
+ if (_openStart.x + _dimx > RM_SX)
+ _openStart.x = RM_SX - _dimx;
+ if (_openStart.y + _dimy > RM_SY)
+ _openStart.y = RM_SY - _dimy;
// Play the sound effect
_vm->playUtilSFX(0);
}
-bool RMInterface::Released(const RMPoint &mousepos, RMTonyAction &action) {
- if (!m_bActive)
+bool RMInterface::released(const RMPoint &mousepos, RMTonyAction &action) {
+ if (!_bActive)
return false;
- m_bActive = false;
+ _bActive = false;
- switch (OnWhichBox(mousepos)) {
+ switch (onWhichBox(mousepos)) {
case 0:
action = TA_TAKE;
break;
@@ -872,19 +877,19 @@ bool RMInterface::Released(const RMPoint &mousepos, RMTonyAction &action) {
return true;
}
-void RMInterface::Reset(void) {
- m_bActive = false;
+void RMInterface::reset(void) {
+ _bActive = false;
}
-void RMInterface::SetPalesati(bool bOn) {
- m_bPalesati = bOn;
+void RMInterface::setPalesati(bool bOn) {
+ _bPalesati = bOn;
}
-bool RMInterface::GetPalesati(void) {
- return m_bPalesati;
+bool RMInterface::getPalesati(void) {
+ return _bPalesati;
}
-void RMInterface::Init(void) {
+void RMInterface::init(void) {
int i;
RMResRaw inter(RES_I_INTERFACE);
RMRes pal(RES_I_INTERPPAL);
@@ -897,21 +902,21 @@ void RMInterface::Init(void) {
for (i = 0; i < 5; i++) {
RMResRaw part(RES_I_INTERP1 + i);
- m_hotzone[i].init(part, part.Width(), part.Height());
- m_hotzone[i].loadPaletteWA(pal);
+ _hotzone[i].init(part, part.Width(), part.Height());
+ _hotzone[i].loadPaletteWA(pal);
}
- m_hotbbox[0].SetRect(126, 123, 159, 208); // Take
- m_hotbbox[1].SetRect(90, 130, 125, 186); // About
- m_hotbbox[2].SetRect(110, 60, 152, 125);
- m_hotbbox[3].SetRect(56, 51, 93, 99);
- m_hotbbox[4].SetRect(51, 105, 82, 172);
+ _hotbbox[0].SetRect(126, 123, 159, 208); // Take
+ _hotbbox[1].SetRect(90, 130, 125, 186); // About
+ _hotbbox[2].SetRect(110, 60, 152, 125);
+ _hotbbox[3].SetRect(56, 51, 93, 99);
+ _hotbbox[4].SetRect(51, 105, 82, 172);
- m_hints[0].setAlignType(RMText::HRIGHT, RMText::VTOP);
- m_hints[1].setAlignType(RMText::HRIGHT, RMText::VTOP);
- m_hints[2].setAlignType(RMText::HRIGHT, RMText::VTOP);
- m_hints[3].setAlignType(RMText::HRIGHT, RMText::VTOP);
- m_hints[4].setAlignType(RMText::HRIGHT, RMText::VTOP);
+ _hints[0].setAlignType(RMText::HRIGHT, RMText::VTOP);
+ _hints[1].setAlignType(RMText::HRIGHT, RMText::VTOP);
+ _hints[2].setAlignType(RMText::HRIGHT, RMText::VTOP);
+ _hints[3].setAlignType(RMText::HRIGHT, RMText::VTOP);
+ _hints[4].setAlignType(RMText::HRIGHT, RMText::VTOP);
// The text is taken from MPAL for translation
RMMessage msg0(12);
@@ -920,24 +925,24 @@ void RMInterface::Init(void) {
RMMessage msg3(15);
RMMessage msg4(16);
- m_hints[0].writeText(msg0[0], 1); // Take
- m_hints[1].writeText(msg1[0], 1); // Talk
- m_hints[2].writeText(msg2[0], 1); // Use
- m_hints[3].writeText(msg3[0], 1); // Examine
- m_hints[4].writeText(msg4[0], 1); // Show Yourself
+ _hints[0].writeText(msg0[0], 1); // Take
+ _hints[1].writeText(msg1[0], 1); // Talk
+ _hints[2].writeText(msg2[0], 1); // Use
+ _hints[3].writeText(msg3[0], 1); // Examine
+ _hints[4].writeText(msg4[0], 1); // Show Yourself
- m_bActive = false;
- m_bPalesati = false;
- m_lastHotZone = 0;
+ _bActive = false;
+ _bPalesati = false;
+ _lastHotZone = 0;
}
-void RMInterface::Close(void) {
+void RMInterface::close(void) {
int i;
destroy();
for (i = 0; i < 5; i++)
- m_hotzone[i].destroy();
+ _hotzone[i].destroy();
}
} // End of namespace Tony
diff --git a/engines/tony/inventory.h b/engines/tony/inventory.h
index 3548317dcc..6ffb33dd21 100644
--- a/engines/tony/inventory.h
+++ b/engines/tony/inventory.h
@@ -55,35 +55,35 @@ private:
};
protected:
- int m_nItems;
- RMInventoryItem *m_items;
+ int _nItems;
+ RMInventoryItem *_items;
- int m_inv[256];
- int m_nInv;
- int m_curPutY;
- uint32 m_curPutTime;
+ int _inv[256];
+ int _nInv;
+ int _curPutY;
+ uint32 _curPutTime;
- int m_curPos;
- STATE m_state;
- bool m_bHasFocus;
- int m_nSelectObj;
- int m_nCombine;
- bool m_bCombining;
+ int _curPos;
+ STATE _state;
+ bool _bHasFocus;
+ int _nSelectObj;
+ int _nCombine;
+ bool _bCombining;
- bool m_bBlinkingRight, m_bBlinkingLeft;
+ bool _bBlinkingRight, _bBlinkingLeft;
int miniAction;
RMItem miniInterface;
- RMText m_hints[3];
+ RMText _hints[3];
- OSystem::MutexRef m_csModifyInterface;
+ OSystem::MutexRef _csModifyInterface;
protected:
// Prepare the image inventory. It should be recalled whenever the inventory changes
void prepare(void);
// Check if the mouse Y position is conrrect, even under the inventory portion of the screen
- bool CheckPointInside(const RMPoint &pt);
+ bool checkPointInside(const RMPoint &pt);
public:
RMInventory();
@@ -104,93 +104,93 @@ public:
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);
// Method for determining whether the inventory currently has the focus
- bool HaveFocus(const RMPoint &mpos);
+ bool haveFocus(const RMPoint &mpos);
// Method for determining if the mini interface is active
- bool MiniActive(void);
+ bool miniActive(void);
// Handle the left mouse click (only when the inventory has the focus)
- bool LeftClick(const RMPoint &mpos, int &nCombineObj);
+ bool leftClick(const RMPoint &mpos, int &nCombineObj);
// Handle the right mouse button (only when the inventory has the focus)
- void RightClick(const RMPoint &mpos);
- bool RightRelease(const RMPoint &mpos, RMTonyAction &curAction);
+ void rightClick(const RMPoint &mpos);
+ bool rightRelease(const RMPoint &mpos, RMTonyAction &curAction);
// Warn that an item combine is over
- void EndCombine(void);
+ void endCombine(void);
public:
// Add an item to the inventory
- void AddItem(int code);
+ void addItem(int code);
RMInventory &operator+=(RMItem *item) {
- AddItem(item->MpalCode());
+ addItem(item->MpalCode());
return *this;
}
RMInventory &operator+=(RMItem &item) {
- AddItem(item.MpalCode());
+ addItem(item.MpalCode());
return *this;
}
RMInventory &operator+=(int code) {
- AddItem(code);
+ addItem(code);
return *this;
}
// Removes an item
- void RemoveItem(int code);
+ void removeItem(int code);
// We are on an object?
- RMItem *WhichItemIsIn(const RMPoint &mpt);
- bool ItemInFocus(const RMPoint &mpt);
+ RMItem *whichItemIsIn(const RMPoint &mpt);
+ bool itemInFocus(const RMPoint &mpt);
// Change the icon of an item
- void ChangeItemStatus(uint32 dwCode, uint32 dwStatus);
+ void changeItemStatus(uint32 dwCode, uint32 dwStatus);
// Save methods
- int GetSaveStateSize(void);
- void SaveState(byte *state);
- int LoadState(byte *state);
+ int getSaveStateSize(void);
+ void saveState(byte *state);
+ int loadState(byte *state);
};
class RMInterface : public RMGfxSourceBuffer8RLEByte {
private:
- bool m_bActive;
- RMPoint m_mpos;
- RMPoint m_openPos;
- RMPoint m_openStart;
- RMText m_hints[5];
- RMGfxSourceBuffer8RLEByte m_hotzone[5];
- RMRect m_hotbbox[5];
- bool m_bPalesati;
- int m_lastHotZone;
+ bool _bActive;
+ RMPoint _mpos;
+ RMPoint _openPos;
+ RMPoint _openStart;
+ RMText _hints[5];
+ RMGfxSourceBuffer8RLEByte _hotzone[5];
+ RMRect _hotbbox[5];
+ bool _bPalesati;
+ int _lastHotZone;
protected:
// Return which box a given point is in
- int OnWhichBox(RMPoint pt);
+ int onWhichBox(RMPoint pt);
public:
virtual ~RMInterface();
// The usual DoFrame (poll the graphics engine)
- void DoFrame(RMGfxTargetBuffer &bigBuf, RMPoint mousepos);
+ void doFrame(RMGfxTargetBuffer &bigBuf, RMPoint mousepos);
// TRUE if it is active (you can select items)
- bool Active();
+ bool active();
// Initialisation
- void Init(void);
- void Close(void);
+ void init(void);
+ void close(void);
// Reset the interface
- void Reset(void);
+ void reset(void);
// Warns of mouse clicks and releases
- void Clicked(const RMPoint &mousepos);
- bool Released(const RMPoint &mousepos, RMTonyAction &action);
+ void clicked(const RMPoint &mousepos);
+ bool released(const RMPoint &mousepos, RMTonyAction &action);
// Enalbes or disables the fifth verb
- void SetPalesati(bool bOn);
- bool GetPalesati(void);
+ void setPalesati(bool bOn);
+ bool getPalesati(void);
// Overloaded Draw
virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim);