Skip to content

Commit

Permalink
TONY: Rename variables and functions in inventory.h
Browse files Browse the repository at this point in the history
That fixes the regression in the credits
  • Loading branch information
Strangerke committed Jun 6, 2012
1 parent f1ac5d5 commit 53e3810
Show file tree
Hide file tree
Showing 7 changed files with 407 additions and 403 deletions.
6 changes: 3 additions & 3 deletions engines/tony/custom.cpp
Expand Up @@ -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);
}


Expand Down
9 changes: 4 additions & 5 deletions engines/tony/font.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions engines/tony/font.h
Expand Up @@ -60,7 +60,7 @@ class RMFont : public RMGfxTaskSetPrior {
RMFontPrimitive() : RMGfxPrimitive() {}
RMFontPrimitive(RMGfxTask *task) : RMGfxPrimitive(task) {}
virtual ~RMFontPrimitive() { }
virtual RMGfxPrimitive *Duplicate() {
virtual RMGfxPrimitive *duplicate() {
return new RMFontPrimitive(*this);
}

Expand Down Expand Up @@ -112,7 +112,7 @@ class RMFontColor : public virtual RMFont {
public:
RMFontColor();
virtual ~RMFontColor();
virtual void SetBaseColor(byte r, byte g, byte b);
virtual void setBaseColor(byte r, byte g, byte b);
};


Expand Down
46 changes: 23 additions & 23 deletions engines/tony/gfxengine.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down Expand Up @@ -226,15 +226,15 @@ 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());
else if (_itemName.getSelectedItem() != NULL)
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);
}

Expand All @@ -248,7 +248,7 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) {
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);
Expand All @@ -260,7 +260,7 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) {
_curAction = TA_GOTO;
_curActionObj = 0;
_point.setAction(_curAction);
_inter.Clicked(_input.mousePos());
_inter.clicked(_input.mousePos());
}
}

Expand All @@ -269,7 +269,7 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) {
// *************
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);

Expand All @@ -282,13 +282,13 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) {

// 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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -521,7 +521,7 @@ void RMGfxEngine::init() {
void RMGfxEngine::close(void) {
_bigBuf.clearOT();

_inter.Close();
_inter.close();
_inv.close();
_tony.Close();
_point.close();
Expand All @@ -540,7 +540,7 @@ void RMGfxEngine::enableInput(void) {

void RMGfxEngine::disableInput(void) {
_bInput = false;
_inter.Reset();
_inter.reset();
}

void RMGfxEngine::enableMouse(void) {
Expand Down Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion engines/tony/gfxengine.h
Expand Up @@ -145,7 +145,7 @@ class RMGfxEngine {
void waitWipeEnd(CORO_PARAM);

void setPalesati(bool bpal) {
_inter.SetPalesati(bpal);
_inter.setPalesati(bpal);
}
bool canLoadSave();
};
Expand Down

0 comments on commit 53e3810

Please sign in to comment.