diff options
author | Strangerke | 2012-06-06 08:04:33 +0200 |
---|---|---|
committer | Strangerke | 2012-06-06 08:04:33 +0200 |
commit | f1ac5d5acdbc0349850377619d8056be22871b42 (patch) | |
tree | 6076996dd7201af5f63447e382c2600e12eb183d /engines | |
parent | 334dc91e279d01b264ae7454f39faa557a250428 (diff) | |
download | scummvm-rg350-f1ac5d5acdbc0349850377619d8056be22871b42.tar.gz scummvm-rg350-f1ac5d5acdbc0349850377619d8056be22871b42.tar.bz2 scummvm-rg350-f1ac5d5acdbc0349850377619d8056be22871b42.zip |
TONY: More renaming
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tony/custom.cpp | 170 | ||||
-rw-r--r-- | engines/tony/font.cpp | 434 | ||||
-rw-r--r-- | engines/tony/font.h | 160 | ||||
-rw-r--r-- | engines/tony/game.cpp | 8 | ||||
-rw-r--r-- | engines/tony/gfxengine.cpp | 28 | ||||
-rw-r--r-- | engines/tony/inventory.cpp | 65 | ||||
-rw-r--r-- | engines/tony/inventory.h | 10 | ||||
-rw-r--r-- | engines/tony/tony.cpp | 14 | ||||
-rw-r--r-- | engines/tony/window.cpp | 40 | ||||
-rw-r--r-- | engines/tony/window.h | 30 |
10 files changed, 479 insertions, 480 deletions
diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 24caaa1e29..84bafc2cd1 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -297,32 +297,32 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX } if (GLOBALS.curBackText) - CORO_INVOKE_0(GLOBALS.curBackText->Hide); + CORO_INVOKE_0(GLOBALS.curBackText->hide); GLOBALS.bTonyIsSpeaking = true; for (_ctx->i = 0; _ctx->i < _ctx->msg.NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { - _ctx->text.SetInput(GLOBALS.Input); + _ctx->text.setInput(GLOBALS.Input); // Alignment - _ctx->text.SetAlignType(RMText::HCENTER, RMText::VBOTTOM); + _ctx->text.setAlignType(RMText::HCENTER, RMText::VBOTTOM); // Colour - _ctx->text.SetColor(0, 255, 0); + _ctx->text.setColor(0, 255, 0); // Writes the text - _ctx->text.WriteText(_ctx->msg[_ctx->i], 0); + _ctx->text.writeText(_ctx->msg[_ctx->i], 0); // Set the position if (nX == 0 && nY == 0) - _ctx->text.SetPosition(GLOBALS.Tony->Position() - RMPoint(0, 130) - GLOBALS.Loc->ScrollPosition()); + _ctx->text.setPosition(GLOBALS.Tony->Position() - RMPoint(0, 130) - GLOBALS.Loc->ScrollPosition()); else - _ctx->text.SetPosition(RMPoint(nX, nY) - GLOBALS.Loc->ScrollPosition()); + _ctx->text.setPosition(RMPoint(nX, nY) - GLOBALS.Loc->ScrollPosition()); // Handling for always display if (GLOBALS.bAlwaysDisplay) { - _ctx->text.SetAlwaysDisplay(); - _ctx->text.ForceTime(); + _ctx->text.setAlwaysDisplay(); + _ctx->text.forceTime(); } // Record the text @@ -331,7 +331,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX if (_ctx->curVoc) { if (_ctx->i == 0) { _ctx->voice->Play(); - _ctx->text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text.setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } else { _vm->_vdbFP.seek(_ctx->curOffset); _vm->_theSound.CreateSfx(&_ctx->voice); @@ -340,13 +340,13 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX _ctx->curOffset = _vm->_vdbFP.pos(); _ctx->voice->SetLoop(false); _ctx->voice->Play(); - _ctx->text.SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text.setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } } // Wait for the end of the display - _ctx->text.SetCustomSkipHandle(GLOBALS.hSkipIdle); - CORO_INVOKE_0(_ctx->text.WaitForEndDisplay); + _ctx->text.setCustomSkipHandle(GLOBALS.hSkipIdle); + CORO_INVOKE_0(_ctx->text.waitForEndDisplay); if (_ctx->curVoc) { _ctx->voice->Stop(); @@ -357,7 +357,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX GLOBALS.bTonyIsSpeaking = false; if (GLOBALS.curBackText) - GLOBALS.curBackText->Show(); + GLOBALS.curBackText->show(); CORO_INVOKE_0(GLOBALS.Tony->EndTalk); @@ -418,36 +418,36 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 GLOBALS.Unfreeze(); for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods() && !GLOBALS.bSkipIdle; _ctx->i++) { - _ctx->text.SetInput(GLOBALS.Input); + _ctx->text.setInput(GLOBALS.Input); // Alignment - _ctx->text.SetAlignType(RMText::HCENTER, RMText::VCENTER); + _ctx->text.setAlignType(RMText::HCENTER, RMText::VCENTER); // Forces the text to disappear in time - _ctx->text.ForceTime(); + _ctx->text.forceTime(); // Colour - _ctx->text.SetColor(255, 255, 255); + _ctx->text.setColor(255, 255, 255); // Write the text if (nFont == 0) - _ctx->text.WriteText((*_ctx->msg)[_ctx->i], 1); + _ctx->text.writeText((*_ctx->msg)[_ctx->i], 1); else if (nFont == 1) - _ctx->text.WriteText((*_ctx->msg)[_ctx->i], 0); + _ctx->text.writeText((*_ctx->msg)[_ctx->i], 0); // Set the position - _ctx->text.SetPosition(RMPoint(320, 240)); + _ctx->text.setPosition(RMPoint(320, 240)); - _ctx->text.SetAlwaysDisplay(); - _ctx->text.ForceTime(); + _ctx->text.setAlwaysDisplay(); + _ctx->text.forceTime(); // Record the text GLOBALS.LinkGraphicTask(&_ctx->clear); GLOBALS.LinkGraphicTask(&_ctx->text); // Wait for the end of display - _ctx->text.SetCustomSkipHandle(GLOBALS.hSkipIdle); - CORO_INVOKE_0(_ctx->text.WaitForEndDisplay); + _ctx->text.setCustomSkipHandle(GLOBALS.hSkipIdle); + CORO_INVOKE_0(_ctx->text.waitForEndDisplay); } delete _ctx->msg; @@ -1487,31 +1487,31 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess if (bIsBack) { GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); if (GLOBALS.bTonyIsSpeaking) - CORO_INVOKE_0(GLOBALS.curBackText->Hide); + CORO_INVOKE_0(GLOBALS.curBackText->hide); } else _ctx->text = new RMTextDialog; - _ctx->text->SetInput(GLOBALS.Input); + _ctx->text->setInput(GLOBALS.Input); // Skipping - _ctx->text->SetSkipStatus(!bIsBack); + _ctx->text->setSkipStatus(!bIsBack); // Alignment - _ctx->text->SetAlignType(RMText::HCENTER, RMText::VBOTTOM); + _ctx->text->setAlignType(RMText::HCENTER, RMText::VBOTTOM); // Colour - _ctx->text->SetColor(GLOBALS.Character[nChar].r, GLOBALS.Character[nChar].g, GLOBALS.Character[nChar].b); + _ctx->text->setColor(GLOBALS.Character[nChar].r, GLOBALS.Character[nChar].g, GLOBALS.Character[nChar].b); // Write the text - _ctx->text->WriteText((*_ctx->msg)[_ctx->i], 0); + _ctx->text->writeText((*_ctx->msg)[_ctx->i], 0); // Set the position - _ctx->text->SetPosition(_ctx->pt); + _ctx->text->setPosition(_ctx->pt); // Set the always display if (GLOBALS.bAlwaysDisplay) { - _ctx->text->SetAlwaysDisplay(); - _ctx->text->ForceTime(); + _ctx->text->setAlwaysDisplay(); + _ctx->text->forceTime(); } // Record the text @@ -1524,13 +1524,13 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess _ctx->voice->SetLoop(false); if (bIsBack) _ctx->voice->SetVolume(55); _ctx->voice->Play(); - _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text->setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); _ctx->curOffset = _vm->_vdbFP.pos(); } // Wait for the end of display - _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); - CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); + _ctx->text->setCustomSkipHandle(GLOBALS.hSkipIdle); + CORO_INVOKE_0(_ctx->text->waitForEndDisplay); if (_ctx->curVoc) { _ctx->voice->Stop(); @@ -1700,31 +1700,31 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes if (bIsBack) { GLOBALS.curBackText = _ctx->text = new RMTextDialogScrolling(GLOBALS.Loc); if (GLOBALS.bTonyIsSpeaking) - CORO_INVOKE_0(GLOBALS.curBackText->Hide); + CORO_INVOKE_0(GLOBALS.curBackText->hide); } else _ctx->text = new RMTextDialog; - _ctx->text->SetInput(GLOBALS.Input); + _ctx->text->setInput(GLOBALS.Input); // Skipping - _ctx->text->SetSkipStatus(!bIsBack); + _ctx->text->setSkipStatus(!bIsBack); // Alignment - _ctx->text->SetAlignType(RMText::HCENTER, RMText::VBOTTOM); + _ctx->text->setAlignType(RMText::HCENTER, RMText::VBOTTOM); // Colour - _ctx->text->SetColor(GLOBALS.MCharacter[nChar].r, GLOBALS.MCharacter[nChar].g, GLOBALS.MCharacter[nChar].b); + _ctx->text->setColor(GLOBALS.MCharacter[nChar].r, GLOBALS.MCharacter[nChar].g, GLOBALS.MCharacter[nChar].b); // Write the text - _ctx->text->WriteText((*_ctx->msg)[_ctx->i], nFont); + _ctx->text->writeText((*_ctx->msg)[_ctx->i], nFont); // Set the position - _ctx->text->SetPosition(_ctx->pt); + _ctx->text->setPosition(_ctx->pt); // Set the always display if (GLOBALS.bAlwaysDisplay) { - _ctx->text->SetAlwaysDisplay(); - _ctx->text->ForceTime(); + _ctx->text->setAlwaysDisplay(); + _ctx->text->forceTime(); } // Record the text @@ -1737,13 +1737,13 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes _ctx->voice->SetLoop(false); if (bIsBack) _ctx->voice->SetVolume(55); _ctx->voice->Play(); - _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text->setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); _ctx->curOffset = _vm->_vdbFP.pos(); } // Wait for the end of display - _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); - CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); + _ctx->text->setCustomSkipHandle(GLOBALS.hSkipIdle); + CORO_INVOKE_0(_ctx->text->waitForEndDisplay); if (_ctx->curVoc) { _ctx->voice->Stop(); @@ -1814,9 +1814,9 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (nPers == 0) { _ctx->text = new RMTextDialog; - _ctx->text->SetColor(0, 255, 0); - _ctx->text->SetPosition(GLOBALS.Tony->Position() - RMPoint(0, 130) - GLOBALS.Loc->ScrollPosition()); - _ctx->text->WriteText(_ctx->string, 0); + _ctx->text->setColor(0, 255, 0); + _ctx->text->setPosition(GLOBALS.Tony->Position() - RMPoint(0, 130) - GLOBALS.Loc->ScrollPosition()); + _ctx->text->writeText(_ctx->string, 0); if (GLOBALS.dwTonyNumTexts > 0) { if (!GLOBALS.bTonyInTexts) { @@ -1849,9 +1849,9 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg GLOBALS.Character[nPers].item->SetPattern(GLOBALS.Character[nPers].talkpattern); - _ctx->text->SetColor(GLOBALS.Character[nPers].r, GLOBALS.Character[nPers].g, GLOBALS.Character[nPers].b); - _ctx->text->WriteText(_ctx->string, 0); - _ctx->text->SetPosition(_ctx->pt); + _ctx->text->setColor(GLOBALS.Character[nPers].r, GLOBALS.Character[nPers].g, GLOBALS.Character[nPers].b); + _ctx->text->writeText(_ctx->string, 0); + _ctx->text->setPosition(_ctx->pt); } else { if (GLOBALS.MCharacter[nPers].x == -1) _ctx->pt = GLOBALS.MCharacter[nPers].item->CalculatePos() - RMPoint(-60, 20) - GLOBALS.Loc->ScrollPosition(); @@ -1881,35 +1881,35 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg if (GLOBALS.MCharacter[nPers].bAlwaysBack) { _ctx->text = GLOBALS.curBackText = new RMTextDialogScrolling(GLOBALS.Loc); if (GLOBALS.bTonyIsSpeaking) - CORO_INVOKE_0(GLOBALS.curBackText->Hide); + CORO_INVOKE_0(GLOBALS.curBackText->hide); _ctx->bIsBack = true; } else _ctx->text = new RMTextDialog; - _ctx->text->SetSkipStatus(!GLOBALS.MCharacter[nPers].bAlwaysBack); - _ctx->text->SetColor(GLOBALS.MCharacter[nPers].r, GLOBALS.MCharacter[nPers].g, GLOBALS.MCharacter[nPers].b); - _ctx->text->WriteText(_ctx->string, 0); - _ctx->text->SetPosition(_ctx->pt); + _ctx->text->setSkipStatus(!GLOBALS.MCharacter[nPers].bAlwaysBack); + _ctx->text->setColor(GLOBALS.MCharacter[nPers].r, GLOBALS.MCharacter[nPers].g, GLOBALS.MCharacter[nPers].b); + _ctx->text->writeText(_ctx->string, 0); + _ctx->text->setPosition(_ctx->pt); } if (!GLOBALS.bSkipIdle) { - _ctx->text->SetInput(GLOBALS.Input); + _ctx->text->setInput(GLOBALS.Input); if (GLOBALS.bAlwaysDisplay) { - _ctx->text->SetAlwaysDisplay(); - _ctx->text->ForceTime(); + _ctx->text->setAlwaysDisplay(); + _ctx->text->forceTime(); } - _ctx->text->SetAlignType(RMText::HCENTER, RMText::VBOTTOM); + _ctx->text->setAlignType(RMText::HCENTER, RMText::VBOTTOM); GLOBALS.LinkGraphicTask(_ctx->text); if (_ctx->curVoc) { _ctx->voice->Play(); - _ctx->text->SetCustomSkipHandle2(_ctx->voice->hEndOfBuffer); + _ctx->text->setCustomSkipHandle2(_ctx->voice->hEndOfBuffer); } // Wait for the end of display - _ctx->text->SetCustomSkipHandle(GLOBALS.hSkipIdle); - CORO_INVOKE_0(_ctx->text->WaitForEndDisplay); + _ctx->text->setCustomSkipHandle(GLOBALS.hSkipIdle); + CORO_INVOKE_0(_ctx->text->waitForEndDisplay); } if (_ctx->curVoc) { @@ -1999,39 +1999,39 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr // Making a choice for dialog _ctx->dc.init(); - _ctx->dc.SetNumChoices(_ctx->num); + _ctx->dc.setNumChoices(_ctx->num); // Writeall the possible options for (_ctx->i = 0; _ctx->i < _ctx->num; _ctx->i++) { _ctx->string = mpalQueryDialogPeriod(_ctx->sl[_ctx->i]); assert(_ctx->string != NULL); - _ctx->dc.AddChoice(_ctx->string); + _ctx->dc.addChoice(_ctx->string); GlobalFree(_ctx->string); } // Activate the object GLOBALS.LinkGraphicTask(&_ctx->dc); - CORO_INVOKE_0(_ctx->dc.Show); + CORO_INVOKE_0(_ctx->dc.show); // Draw the pointer GLOBALS.Pointer->setSpecialPointer(GLOBALS.Pointer->PTR_NONE); mainShowMouse(); - while (!(GLOBALS.Input->mouseLeftClicked() && ((_ctx->sel = _ctx->dc.GetSelection()) != -1))) { + while (!(GLOBALS.Input->mouseLeftClicked() && ((_ctx->sel = _ctx->dc.getSelection()) != -1))) { CORO_INVOKE_0(GLOBALS.WaitFrame); GLOBALS.Freeze(); - CORO_INVOKE_1(_ctx->dc.DoFrame, GLOBALS.Input->mousePos()); + CORO_INVOKE_1(_ctx->dc.doFrame, GLOBALS.Input->mousePos()); GLOBALS.Unfreeze(); } // Hide the pointer mainHideMouse(); - CORO_INVOKE_0(_ctx->dc.Hide); + CORO_INVOKE_0(_ctx->dc.hide); mpalQueryDialogSelectionDWORD(_ctx->nChoice, _ctx->sl[_ctx->sel]); // Closes the choice - _ctx->dc.Close(); + _ctx->dc.close(); GlobalFree(_ctx->sl); @@ -2328,27 +2328,27 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3 _ctx->text = new RMTextDialog[_ctx->msg->NumPeriods()]; for (_ctx->i = 0; _ctx->i < _ctx->msg->NumPeriods(); _ctx->i++) { - _ctx->text[_ctx->i].SetInput(GLOBALS.Input); + _ctx->text[_ctx->i].setInput(GLOBALS.Input); // Alignment if ((*_ctx->msg)[_ctx->i][0] == '@') { - _ctx->text[_ctx->i].SetAlignType(RMText::HCENTER, RMText::VTOP); - _ctx->text[_ctx->i].WriteText(&(*_ctx->msg)[_ctx->i][1], 3); - _ctx->text[_ctx->i].SetPosition(RMPoint(414, 70 + _ctx->i * 26)); // 70 + _ctx->text[_ctx->i].setAlignType(RMText::HCENTER, RMText::VTOP); + _ctx->text[_ctx->i].writeText(&(*_ctx->msg)[_ctx->i][1], 3); + _ctx->text[_ctx->i].setPosition(RMPoint(414, 70 + _ctx->i * 26)); // 70 } else { - _ctx->text[_ctx->i].SetAlignType(RMText::HLEFT, RMText::VTOP); - _ctx->text[_ctx->i].WriteText((*_ctx->msg)[_ctx->i], 3); - _ctx->text[_ctx->i].SetPosition(RMPoint(260, 70 + _ctx->i * 26)); + _ctx->text[_ctx->i].setAlignType(RMText::HLEFT, RMText::VTOP); + _ctx->text[_ctx->i].writeText((*_ctx->msg)[_ctx->i], 3); + _ctx->text[_ctx->i].setPosition(RMPoint(260, 70 + _ctx->i * 26)); } // Set the position - _ctx->text[_ctx->i].SetAlwaysDisplay(); - _ctx->text[_ctx->i].SetForcedTime(dwTime * 1000); - _ctx->text[_ctx->i].SetNoTab(); + _ctx->text[_ctx->i].setAlwaysDisplay(); + _ctx->text[_ctx->i].setForcedTime(dwTime * 1000); + _ctx->text[_ctx->i].setNoTab(); // Wait for the end of display - _ctx->text[_ctx->i].SetCustomSkipHandle(_ctx->hDisable); + _ctx->text[_ctx->i].setCustomSkipHandle(_ctx->hDisable); // Record the text GLOBALS.LinkGraphicTask(&_ctx->text[_ctx->i]); diff --git a/engines/tony/font.cpp b/engines/tony/font.cpp index e0eca3b4e2..e967f38199 100644 --- a/engines/tony/font.cpp +++ b/engines/tony/font.cpp @@ -41,11 +41,11 @@ namespace Tony { \****************************************************************************/ RMFont::RMFont() { - m_letter = NULL; + _letter = NULL; } RMFont::~RMFont() { - Unload(); + unload(); } @@ -63,53 +63,53 @@ void DumpFontBMP(const char *filename, const byte *buf, int nChars, int charX, i } -void RMFont::Load(const byte *buf, int nChars, int dimx, int dimy, uint32 palResID) { - m_letter = new RMGfxSourceBuffer8RLEByte[nChars]; +void RMFont::load(const byte *buf, int nChars, int dimx, int dimy, uint32 palResID) { + _letter = new RMGfxSourceBuffer8RLEByte[nChars]; // Initialise the fonts for (int i = 0; i < nChars; i++) { // Initialise the buffer with the letters - m_letter[i].init(buf + i * (dimx * dimy + 8) + 8, dimx, dimy); - m_letter[i].loadPaletteWA(palResID); + _letter[i].init(buf + i * (dimx * dimy + 8) + 8, dimx, dimy); + _letter[i].loadPaletteWA(palResID); } - m_fontDimx = dimx; - m_fontDimy = dimy; + _fontDimx = dimx; + _fontDimy = dimy; nLetters = nChars; } -void RMFont::Load(uint32 resID, int nChars, int dimx, int dimy, uint32 palResID) { +void RMFont::load(uint32 resID, int nChars, int dimx, int dimy, uint32 palResID) { RMRes res(resID); if ((int)res.Size() < nChars * (dimy * dimx + 8)) nChars = res.Size() / (dimy * dimx + 8); - Load(res, nChars, dimx, dimy, palResID); + load(res, nChars, dimx, dimy, palResID); } -void RMFont::Unload(void) { - if (m_letter != NULL) { - delete[] m_letter; - m_letter = NULL; +void RMFont::unload(void) { + if (_letter != NULL) { + delete[] _letter; + _letter = NULL; } } -RMGfxPrimitive *RMFont::MakeLetterPrimitive(byte bChar, int &nLength) { +RMGfxPrimitive *RMFont::makeLetterPrimitive(byte bChar, int &nLength) { RMFontPrimitive *prim; int nLett; // Convert from character to glyph index - nLett = ConvertToLetter(bChar); + nLett = convertToLetter(bChar); assert(nLett < nLetters); // Create primitive font prim = new RMFontPrimitive(this); - prim->m_nChar = nLett; + prim->_nChar = nLett; // Get the length of the character in pixels - nLength = LetterLength(bChar); + nLength = letterLength(bChar); return prim; } @@ -123,29 +123,29 @@ void RMFont::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim2) CORO_BEGIN_CODE(_ctx); // Call the draw method of the letter assigned to the primitive - if (prim->m_nChar != -1) - CORO_INVOKE_2(m_letter[prim->m_nChar].draw, bigBuf, prim); + if (prim->_nChar != -1) + CORO_INVOKE_2(_letter[prim->_nChar].draw, bigBuf, prim); CORO_END_CODE; } -void RMFont::Close(void) { - Unload(); +void RMFont::close(void) { + unload(); } -int RMFont::StringLen(const RMString &text) { +int RMFont::stringLen(const RMString &text) { int len, i; len = 0; for (i = 0; i < text.Length() - 1; i++) - len += LetterLength(text[i], text[i + 1]); - len += LetterLength(text[i]); + len += letterLength(text[i], text[i + 1]); + len += letterLength(text[i]); return len; } -int RMFont::StringLen(char bChar, char bNext) { - return LetterLength(bChar, bNext); +int RMFont::stringLen(char bChar, char bNext) { + return letterLength(bChar, bNext); } /****************************************************************************\ @@ -197,7 +197,7 @@ void RMFontColor::SetBaseColor(byte r1, byte g1, byte b1) { // Puts in all the letters for (i = 0; i < nLetters; i++) - m_letter[i].loadPaletteWA(pal); + _letter[i].loadPaletteWA(pal); } @@ -217,7 +217,7 @@ void RMFontParla::init(void) { + 8 // french + 5; // deutsch - Load(RES_F_PARL, nchars, 20, 20); + load(RES_F_PARL, nchars, 20, 20); // Initialise the f**king table lDefault = 13; @@ -625,7 +625,7 @@ void RMFontMacc::init(void) { + 5; // deutsch - Load(RES_F_MACC, nchars, 11, 16); + load(RES_F_MACC, nchars, 11, 16); // Default lDefault = 10; @@ -989,7 +989,7 @@ void RMFontCredits::init(void) { + 2; // deutsch - Load(RES_F_CREDITS, nchars, 27, 28, RES_F_CPAL); + load(RES_F_CREDITS, nchars, 27, 28, RES_F_CPAL); // Default lDefault = 10; @@ -1433,7 +1433,7 @@ void RMFontCredits::init(void) { #define TOUPPER(a) ((a) >= 'a' && (a) <= 'z' ? (a) + 'A' - 'a' : (a)) #define TOLOWER(a) ((a) >= 'A' && (a) <= 'Z' ? (a) + 'a' - 'A' : (a)) -void RMFontObj::SetBothCase(int nChar, int nNext, signed char spiazz) { +void RMFontObj::setBothCase(int nChar, int nNext, signed char spiazz) { l2Table[TOUPPER(nChar)][TOUPPER(nNext)] = spiazz; l2Table[TOUPPER(nChar)][TOLOWER(nNext)] = spiazz; l2Table[TOLOWER(nChar)][TOUPPER(nNext)] = spiazz; @@ -1454,7 +1454,7 @@ void RMFontObj::init(void) { + 1; // deutsch - Load(RES_F_OBJ, nchars, 25, 30); + load(RES_F_OBJ, nchars, 25, 30); // Initialise the f**king table lDefault = 26; @@ -1569,17 +1569,17 @@ void RMFontObj::init(void) { lTable[(byte)'Ñ'] = 17; /* Casi particolari */ - SetBothCase('C', 'C', 2); - SetBothCase('A', 'T', -2); - SetBothCase('R', 'S', 2); - SetBothCase('H', 'I', -2); - SetBothCase('T', 'S', 2); - SetBothCase('O', 'R', 2); - SetBothCase('O', 'L', 2); - SetBothCase('O', 'G', 2); - SetBothCase('Z', 'A', -1); - SetBothCase('R', 'R', 1); - SetBothCase('R', 'U', 3); + setBothCase('C', 'C', 2); + setBothCase('A', 'T', -2); + setBothCase('R', 'S', 2); + setBothCase('H', 'I', -2); + setBothCase('T', 'S', 2); + setBothCase('O', 'R', 2); + setBothCase('O', 'L', 2); + setBothCase('O', 'G', 2); + setBothCase('Z', 'A', -1); + setBothCase('R', 'R', 1); + setBothCase('R', 'U', 3); if (_vm->getLanguage() == Common::PL_POL) { // Polish characters @@ -1760,11 +1760,11 @@ void RMFontObj::init(void) { * RMText Methods \****************************************************************************/ -RMFontColor *RMText::m_fonts[4] = { NULL, NULL, NULL, NULL }; -RMGfxClearTask RMText::m_clear; +RMFontColor *RMText::_fonts[4] = { NULL, NULL, NULL, NULL }; +RMGfxClearTask RMText::_clear; void RMText::initStatics() { - Common::fill(&m_fonts[0], &m_fonts[4], (RMFontColor *)NULL); + Common::fill(&_fonts[0], &_fonts[4], (RMFontColor *)NULL); } RMText::RMText() { @@ -1784,17 +1784,17 @@ RMText::~RMText() { } -void RMText::Unload() { - if (m_fonts[0] != NULL) { - delete m_fonts[0]; - delete m_fonts[1]; - delete m_fonts[2]; - delete m_fonts[3]; - m_fonts[0] = m_fonts[1] = m_fonts[2] = m_fonts[3] = 0; +void RMText::unload() { + if (_fonts[0] != NULL) { + delete _fonts[0]; + delete _fonts[1]; + delete _fonts[2]; + delete _fonts[3]; + _fonts[0] = _fonts[1] = _fonts[2] = _fonts[3] = 0; } } -void RMText::SetMaxLineLength(int max) { +void RMText::setMaxLineLength(int max) { maxLineLength = max; } @@ -1804,24 +1804,24 @@ void RMText::removeThis(CORO_PARAM, bool &result) { } -void RMText::WriteText(const RMString &text, int nFont, int *time) { +void RMText::writeText(const RMString &text, int nFont, int *time) { // Initialises the font (only once) - if (m_fonts[0] == NULL) { - m_fonts[0] = new RMFontParla; - m_fonts[0]->init(); - m_fonts[1] = new RMFontObj; - m_fonts[1]->init(); - m_fonts[2] = new RMFontMacc; - m_fonts[2]->init(); - m_fonts[3] = new RMFontCredits; - m_fonts[3]->init(); + if (_fonts[0] == NULL) { + _fonts[0] = new RMFontParla; + _fonts[0]->init(); + _fonts[1] = new RMFontObj; + _fonts[1]->init(); + _fonts[2] = new RMFontMacc; + _fonts[2]->init(); + _fonts[3] = new RMFontCredits; + _fonts[3]->init(); } - WriteText(text, m_fonts[nFont], time); + writeText(text, _fonts[nFont], time); } -void RMText::WriteText(const RMString &text, RMFontColor *font, int *time) { +void RMText::writeText(const RMString &text, RMFontColor *font, int *time) { RMGfxPrimitive *prim; char *p, *old_p; int i, j, x, y; @@ -1846,9 +1846,9 @@ void RMText::WriteText(const RMString &text, RMFontColor *font, int *time) { string = p = text; i = j = x = 0; while (*p != '\0') { - j += font->StringLen(*p); + j += font->stringLen(*p); if (j > (((aHorType == HLEFTPAR) && (i > 0)) ? maxLineLength - 25 : maxLineLength)) { - j -= font->StringLen(*p, p[1]); + j -= font->stringLen(*p, p[1]); if (j > x) x = j; @@ -1888,7 +1888,7 @@ void RMText::WriteText(const RMString &text, RMFontColor *font, int *time) { // Starting position for the surface: X1, Y width = x; - height = (numlines - 1) * font->LetterHeight() + font->m_fontDimy; + height = (numlines - 1) * font->letterHeight() + font->_fontDimy; // Create the surface Create(width, height); @@ -1902,7 +1902,7 @@ void RMText::WriteText(const RMString &text, RMFontColor *font, int *time) { for (; i > 0; i--) { // Measure the length of the line x = 0; - j = font->StringLen(RMString(p)); + j = font->stringLen(RMString(p)); switch (aHorType) { case HLEFT: @@ -1927,30 +1927,30 @@ void RMText::WriteText(const RMString &text, RMFontColor *font, int *time) { while (*p != '\0') { if (*p == ' ') { - x += font->StringLen(*p); + x += font->stringLen(*p); p++; continue; } - prim = font->MakeLetterPrimitive(*p, len); + prim = font->makeLetterPrimitive(*p, len); prim->Dst().x1 = x; prim->Dst().y1 = y; addPrim(prim); numchar++; - x += font->StringLen(*p, p[1]); + x += font->stringLen(*p, p[1]); p++; } p++; - y += font->LetterHeight(); + y += font->letterHeight(); } if (time != NULL) *time = 1000 + numchar * (11 - GLOBALS.nCfgTextSpeed) * 14; } -void RMText::ClipOnScreen(RMGfxPrimitive *prim) { +void RMText::clipOnScreen(RMGfxPrimitive *prim) { // Don't let it go outside the screen if (prim->Dst().x1 < 5) prim->Dst().x1 = 5; @@ -1984,7 +1984,7 @@ void RMText::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { prim->Dst().y1 -= _dimy; } - ClipOnScreen(prim); + clipOnScreen(prim); CORO_INVOKE_2(RMGfxWoodyBuffer::draw, bigBuf, prim); @@ -1996,18 +1996,18 @@ void RMText::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { \****************************************************************************/ RMTextDialog::RMTextDialog() : RMText() { - m_startTime = 0; + _startTime = 0; dst = RMPoint(0, 0); - m_bSkipStatus = true; - m_bShowed = true; - m_bForceTime = false; - m_bForceNoTime = false; - m_bAlwaysDisplay = false; - m_bNoTab = false; + _bSkipStatus = true; + _bShowed = true; + _bForceTime = false; + _bForceNoTime = false; + _bAlwaysDisplay = false; + _bNoTab = false; hCustomSkip = CORO_INVALID_PID_VALUE; hCustomSkip2 = CORO_INVALID_PID_VALUE; - m_input = NULL; + _input = NULL; // Create the event for displaying the end hEndDisplay = CoroScheduler.createEvent(false, false); @@ -2017,51 +2017,51 @@ RMTextDialog::~RMTextDialog() { CoroScheduler.closeEvent(hEndDisplay); } -void RMTextDialog::Show(void) { - m_bShowed = true; +void RMTextDialog::show(void) { + _bShowed = true; } -void RMTextDialog::Hide(CORO_PARAM) { - m_bShowed = false; +void RMTextDialog::hide(CORO_PARAM) { + _bShowed = false; } -void RMTextDialog::WriteText(const RMString &text, int font, int *time) { - RMText::WriteText(text, font, &m_time); +void RMTextDialog::writeText(const RMString &text, int font, int *time) { + RMText::writeText(text, font, &_time); if (time != NULL) - *time = m_time; + *time = _time; } -void RMTextDialog::WriteText(const RMString &text, RMFontColor *font, int *time) { - RMText::WriteText(text, font, &m_time); +void RMTextDialog::writeText(const RMString &text, RMFontColor *font, int *time) { + RMText::writeText(text, font, &_time); if (time != NULL) - *time = m_time; + *time = _time; } -void RMTextDialog::SetSkipStatus(bool bEnabled) { - m_bSkipStatus = bEnabled; +void RMTextDialog::setSkipStatus(bool bEnabled) { + _bSkipStatus = bEnabled; } -void RMTextDialog::ForceTime(void) { - m_bForceTime = true; +void RMTextDialog::forceTime(void) { + _bForceTime = true; } -void RMTextDialog::ForceNoTime(void) { - m_bForceNoTime = true; +void RMTextDialog::forceNoTime(void) { + _bForceNoTime = true; } -void RMTextDialog::SetNoTab(void) { - m_bNoTab = true; +void RMTextDialog::setNoTab(void) { + _bNoTab = true; } -void RMTextDialog::SetForcedTime(uint32 dwTime) { - m_time = dwTime; +void RMTextDialog::setForcedTime(uint32 dwTime) { + _time = dwTime; } -void RMTextDialog::SetAlwaysDisplay(void) { - m_bAlwaysDisplay = true; +void RMTextDialog::setAlwaysDisplay(void) { + _bAlwaysDisplay = true; } void RMTextDialog::removeThis(CORO_PARAM, bool &result) { @@ -2075,39 +2075,39 @@ void RMTextDialog::removeThis(CORO_PARAM, bool &result) { result = true; // Don't erase the background - if (m_bSkipStatus) { + if (_bSkipStatus) { if (!(GLOBALS.bCfgDubbing && hCustomSkip2 != CORO_INVALID_PID_VALUE)) { if (GLOBALS.bCfgTimerizedText) { - if (!m_bForceNoTime) { - if (_vm->getTime() > (uint32)m_time + m_startTime) + if (!_bForceNoTime) { + if (_vm->getTime() > (uint32)_time + _startTime) return; } } } - if (!m_bNoTab) { + if (!_bNoTab) { if (_vm->getEngine()->getInput().getAsyncKeyState(Common::KEYCODE_TAB)) return; } - if (!m_bNoTab) { - if (m_input) { - if (m_input->mouseLeftClicked() || m_input->mouseRightClicked()) + if (!_bNoTab) { + if (_input) { + if (_input->mouseLeftClicked() || _input->mouseRightClicked()) return; } } } // Erase the background else if (!(GLOBALS.bCfgDubbing && hCustomSkip2 != CORO_INVALID_PID_VALUE)) { - if (!m_bForceNoTime) { - if (_vm->getTime() > (uint32)m_time + m_startTime) + if (!_bForceNoTime) { + if (_vm->getTime() > (uint32)_time + _startTime) return; } } // If time is forced - if (m_bForceTime) { - if (_vm->getTime() > (uint32)m_time + m_startTime) + if (_bForceTime) { + if (_vm->getTime() > (uint32)_time + _startTime) return; } @@ -2142,11 +2142,11 @@ void RMTextDialog::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *p CORO_BEGIN_CODE(_ctx); - if (m_startTime == 0) - m_startTime = _vm->getTime(); + if (_startTime == 0) + _startTime = _vm->getTime(); - if (m_bShowed) { - if (GLOBALS.bCfgSottotitoli || m_bAlwaysDisplay) { + if (_bShowed) { + if (GLOBALS.bCfgSottotitoli || _bAlwaysDisplay) { prim->Dst().TopLeft() = dst; CORO_INVOKE_2(RMText::draw, bigBuf, prim); } @@ -2155,20 +2155,20 @@ void RMTextDialog::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *p CORO_END_CODE; } -void RMTextDialog::SetCustomSkipHandle(uint32 hCustom) { +void RMTextDialog::setCustomSkipHandle(uint32 hCustom) { hCustomSkip = hCustom; } -void RMTextDialog::SetCustomSkipHandle2(uint32 hCustom) { +void RMTextDialog::setCustomSkipHandle2(uint32 hCustom) { hCustomSkip2 = hCustom; } -void RMTextDialog::WaitForEndDisplay(CORO_PARAM) { +void RMTextDialog::waitForEndDisplay(CORO_PARAM) { CoroScheduler.waitForSingleObject(coroParam, hEndDisplay, CORO_INFINITE); } -void RMTextDialog::SetInput(RMInput *input) { - m_input = input; +void RMTextDialog::setInput(RMInput *input) { + _input = input; } /****************************************************************************\ @@ -2206,7 +2206,7 @@ void RMTextDialogScrolling::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPri CORO_END_CODE; } -void RMTextDialogScrolling::ClipOnScreen(RMGfxPrimitive *prim) { +void RMTextDialogScrolling::clipOnScreen(RMGfxPrimitive *prim) { // We must not do anything! } @@ -2216,7 +2216,7 @@ void RMTextDialogScrolling::ClipOnScreen(RMGfxPrimitive *prim) { \****************************************************************************/ RMTextItemName::RMTextItemName() : RMText() { - m_item = NULL; + _item = NULL; setPriority(220); } @@ -2224,7 +2224,7 @@ RMTextItemName::~RMTextItemName() { } -void RMTextItemName::DoFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation &loc, RMPointer &ptr, RMInventory &inv) { +void RMTextItemName::doFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation &loc, RMPointer &ptr, RMInventory &inv) { CORO_BEGIN_CONTEXT; RMItem *lastItem; uint32 hThread; @@ -2234,36 +2234,36 @@ void RMTextItemName::DoFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation & CORO_BEGIN_CODE(_ctx); - _ctx->lastItem = m_item; + _ctx->lastItem = _item; // Adds to the list if there is need if (!_nInList) bigBuf.addPrim(new RMGfxPrimitive(this)); // Update the scrolling co-ordinates - m_curscroll = loc.ScrollPosition(); + _curscroll = loc.ScrollPosition(); // Check if we are on the inventory - if (inv.ItemInFocus(m_mpos)) - m_item = inv.WhichItemIsIn(m_mpos); + if (inv.ItemInFocus(_mpos)) + _item = inv.WhichItemIsIn(_mpos); else - m_item = loc.WhichItemIsIn(m_mpos); + _item = loc.WhichItemIsIn(_mpos); itemName = ""; // If there an item, get its name - if (m_item != NULL) - m_item->GetName(itemName); + if (_item != NULL) + _item->GetName(itemName); // Write it - WriteText(itemName, 1); + writeText(itemName, 1); // Handle the change If the selected item is different from the previous one - if (_ctx->lastItem != m_item) { - if (m_item == NULL) + if (_ctx->lastItem != _item) { + if (_item == NULL) ptr.setSpecialPointer(RMPointer::PTR_NONE); else { - _ctx->hThread = mpalQueryDoAction(20, m_item->MpalCode(), 0); + _ctx->hThread = mpalQueryDoAction(20, _item->MpalCode(), 0); if (_ctx->hThread == CORO_INVALID_PID_VALUE) ptr.setSpecialPointer(RMPointer::PTR_NONE); else @@ -2286,30 +2286,30 @@ void RMTextItemName::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive return; // Set the destination coordinates of the mouse - prim->Dst().TopLeft() = m_mpos - RMPoint(0, 30); + prim->Dst().TopLeft() = _mpos - RMPoint(0, 30); CORO_INVOKE_2(RMText::draw, bigBuf, prim); CORO_END_CODE; } -RMPoint RMTextItemName::GetHotspot() { - if (m_item == NULL) - return m_mpos + m_curscroll; +RMPoint RMTextItemName::getHotspot() { + if (_item == NULL) + return _mpos + _curscroll; else - return m_item->Hotspot(); + return _item->Hotspot(); } -RMItem *RMTextItemName::GetSelectedItem() { - return m_item; +RMItem *RMTextItemName::getSelectedItem() { + return _item; } -bool RMTextItemName::IsItemSelected() { - return m_item != NULL; +bool RMTextItemName::isItemSelected() { + return _item != NULL; } -bool RMTextItemName::IsNormalItemSelected() { - return m_item != NULL && m_itemName.Length() > 0; +bool RMTextItemName::isNormalItemSelected() { + return _item != NULL && _itemName.Length() > 0; } @@ -2345,56 +2345,56 @@ void RMDialogChoice::Unregister(void) { } void RMDialogChoice::init(void) { - m_numChoices = 0; - m_drawedStrings = NULL; - m_ptDrawStrings = NULL; - m_curSelection = -1; + _numChoices = 0; + _drawedStrings = NULL; + _ptDrawStrings = NULL; + _curSelection = -1; Create(640, 477); setPriority(140); } -void RMDialogChoice::Close(void) { - if (m_drawedStrings != NULL) { - delete[] m_drawedStrings; - m_drawedStrings = NULL; +void RMDialogChoice::close(void) { + if (_drawedStrings != NULL) { + delete[] _drawedStrings; + _drawedStrings = NULL; } - if (m_ptDrawStrings != NULL) { - delete[] m_ptDrawStrings; - m_ptDrawStrings = NULL; + if (_ptDrawStrings != NULL) { + delete[] _ptDrawStrings; + _ptDrawStrings = NULL; } destroy(); } -void RMDialogChoice::SetNumChoices(int num) { +void RMDialogChoice::setNumChoices(int num) { int i; - m_numChoices = num; - m_curAdded = 0; + _numChoices = num; + _curAdded = 0; // Allocate space for drawn strings - m_drawedStrings = new RMText[num]; - m_ptDrawStrings = new RMPoint[num]; + _drawedStrings = new RMText[num]; + _ptDrawStrings = new RMPoint[num]; // Initialisation - for (i = 0; i < m_numChoices; i++) { - m_drawedStrings[i].SetColor(0, 255, 0); - m_drawedStrings[i].SetAlignType(RMText::HLEFTPAR, RMText::VTOP); - m_drawedStrings[i].SetMaxLineLength(600); - m_drawedStrings[i].setPriority(10); + for (i = 0; i < _numChoices; i++) { + _drawedStrings[i].setColor(0, 255, 0); + _drawedStrings[i].setAlignType(RMText::HLEFTPAR, RMText::VTOP); + _drawedStrings[i].setMaxLineLength(600); + _drawedStrings[i].setPriority(10); } } -void RMDialogChoice::AddChoice(const RMString &string) { +void RMDialogChoice::addChoice(const RMString &string) { // Draw the string - assert(m_curAdded < m_numChoices); - m_drawedStrings[m_curAdded++].WriteText(string, 0); + assert(_curAdded < _numChoices); + _drawedStrings[_curAdded++].writeText(string, 0); } -void RMDialogChoice::Prepare(CORO_PARAM) { +void RMDialogChoice::prepare(CORO_PARAM) { CORO_BEGIN_CONTEXT; int i; RMPoint ptPos; @@ -2410,21 +2410,21 @@ void RMDialogChoice::Prepare(CORO_PARAM) { _ctx->ptPos.Set(20, 90); - for (_ctx->i = 0; _ctx->i < m_numChoices; _ctx->i++) { - addPrim(new RMGfxPrimitive(&m_drawedStrings[_ctx->i], _ctx->ptPos)); - m_ptDrawStrings[_ctx->i] = _ctx->ptPos; - _ctx->ptPos.Offset(0, m_drawedStrings[_ctx->i].getDimy() + 15); + for (_ctx->i = 0; _ctx->i < _numChoices; _ctx->i++) { + addPrim(new RMGfxPrimitive(&_drawedStrings[_ctx->i], _ctx->ptPos)); + _ptDrawStrings[_ctx->i] = _ctx->ptPos; + _ctx->ptPos.Offset(0, _drawedStrings[_ctx->i].getDimy() + 15); } CORO_INVOKE_0(drawOT); clearOT(); - m_ptDrawPos.Set(0, 480 - _ctx->ptPos.y); + _ptDrawPos.Set(0, 480 - _ctx->ptPos.y); CORO_END_CODE; } -void RMDialogChoice::SetSelected(CORO_PARAM, int pos) { +void RMDialogChoice::setSelected(CORO_PARAM, int pos) { CORO_BEGIN_CONTEXT; RMGfxBox box; RMRect rc; @@ -2432,39 +2432,39 @@ void RMDialogChoice::SetSelected(CORO_PARAM, int pos) { CORO_BEGIN_CODE(_ctx); - if (pos == m_curSelection) + if (pos == _curSelection) return; _ctx->box.setPriority(5); - if (m_curSelection != -1) { + if (_curSelection != -1) { _ctx->box.SetColor(0xCC, 0xCC, 0xFF); - _ctx->rc.TopLeft() = RMPoint(18, m_ptDrawStrings[m_curSelection].y); - _ctx->rc.BottomRight() = _ctx->rc.TopLeft() + RMPoint(597, m_drawedStrings[m_curSelection].getDimy()); + _ctx->rc.TopLeft() = RMPoint(18, _ptDrawStrings[_curSelection].y); + _ctx->rc.BottomRight() = _ctx->rc.TopLeft() + RMPoint(597, _drawedStrings[_curSelection].getDimy()); addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc)); - addPrim(new RMGfxPrimitive(&m_drawedStrings[m_curSelection], m_ptDrawStrings[m_curSelection])); + addPrim(new RMGfxPrimitive(&_drawedStrings[_curSelection], _ptDrawStrings[_curSelection])); CORO_INVOKE_0(drawOT); clearOT(); } if (pos != -1) { _ctx->box.SetColor(100, 100, 100); - _ctx->rc.TopLeft() = RMPoint(18, m_ptDrawStrings[pos].y); - _ctx->rc.BottomRight() = _ctx->rc.TopLeft() + RMPoint(597, m_drawedStrings[pos].getDimy()); + _ctx->rc.TopLeft() = RMPoint(18, _ptDrawStrings[pos].y); + _ctx->rc.BottomRight() = _ctx->rc.TopLeft() + RMPoint(597, _drawedStrings[pos].getDimy()); addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc)); - addPrim(new RMGfxPrimitive(&m_drawedStrings[pos], m_ptDrawStrings[pos])); + addPrim(new RMGfxPrimitive(&_drawedStrings[pos], _ptDrawStrings[pos])); } CORO_INVOKE_0(drawOT); clearOT(); - m_curSelection = pos; + _curSelection = pos; CORO_END_CODE; } -void RMDialogChoice::Show(CORO_PARAM, RMGfxTargetBuffer *bigBuf) { +void RMDialogChoice::show(CORO_PARAM, RMGfxTargetBuffer *bigBuf) { CORO_BEGIN_CONTEXT; RMPoint destpt; int deltay; @@ -2474,34 +2474,34 @@ void RMDialogChoice::Show(CORO_PARAM, RMGfxTargetBuffer *bigBuf) { CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_0(Prepare); - m_bShow = false; + CORO_INVOKE_0(prepare); + _bShow = false; if (!_nInList && bigBuf != NULL) bigBuf->addPrim(new RMGfxPrimitive(this)); if (0) { - m_bShow = true; + _bShow = true; } else { _ctx->starttime = _vm->getTime(); - _ctx->deltay = 480 - m_ptDrawPos.y; - _ctx->destpt = m_ptDrawPos; - m_ptDrawPos.Set(0, 480); + _ctx->deltay = 480 - _ptDrawPos.y; + _ctx->destpt = _ptDrawPos; + _ptDrawPos.Set(0, 480); if (!_nInList && bigBuf != NULL) bigBuf->addPrim(new RMGfxPrimitive(this)); - m_bShow = true; + _bShow = true; _ctx->elaps = 0; while (_ctx->elaps < 700) { CORO_INVOKE_0(mainWaitFrame); mainFreeze(); _ctx->elaps = _vm->getTime() - _ctx->starttime; - m_ptDrawPos.y = 480 - ((_ctx->deltay * 100) / 700 * _ctx->elaps) / 100; + _ptDrawPos.y = 480 - ((_ctx->deltay * 100) / 700 * _ctx->elaps) / 100; mainUnfreeze(); } - m_ptDrawPos.y = _ctx->destpt.y; + _ptDrawPos.y = _ctx->destpt.y; } CORO_END_CODE; @@ -2513,17 +2513,17 @@ void RMDialogChoice::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive CORO_BEGIN_CODE(_ctx); - if (m_bShow == false) + if (_bShow == false) return; - prim->setDst(m_ptDrawPos); + prim->setDst(_ptDrawPos); CORO_INVOKE_2(RMGfxSourceBuffer16::draw, bigBuf, prim); CORO_END_CODE; } -void RMDialogChoice::Hide(CORO_PARAM) { +void RMDialogChoice::hide(CORO_PARAM) { CORO_BEGIN_CONTEXT; int deltay; int starttime; @@ -2535,18 +2535,18 @@ void RMDialogChoice::Hide(CORO_PARAM) { if (1) { _ctx->starttime = _vm->getTime(); - _ctx->deltay = 480 - m_ptDrawPos.y; + _ctx->deltay = 480 - _ptDrawPos.y; _ctx->elaps = 0; while (_ctx->elaps < 700) { CORO_INVOKE_0(mainWaitFrame); mainFreeze(); _ctx->elaps = _vm->getTime() - _ctx->starttime; - m_ptDrawPos.y = 480 - ((_ctx->deltay * 100) / 700 * (700 - _ctx->elaps)) / 100; + _ptDrawPos.y = 480 - ((_ctx->deltay * 100) / 700 * (700 - _ctx->elaps)) / 100; mainUnfreeze(); } } - m_bShow = false; + _bShow = false; bRemoveFromOT = true; CORO_INVOKE_2(CoroScheduler.waitForSingleObject, hUnreg, CORO_INFINITE); @@ -2558,30 +2558,30 @@ void RMDialogChoice::removeThis(CORO_PARAM, bool &result) { result = bRemoveFromOT; } -void RMDialogChoice::DoFrame(CORO_PARAM, RMPoint ptMousePos) { +void RMDialogChoice::doFrame(CORO_PARAM, RMPoint ptMousePos) { CORO_BEGIN_CONTEXT; int i; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - if (ptMousePos.y > m_ptDrawPos.y) { - for (_ctx->i = 0; _ctx->i < m_numChoices; _ctx->i++) { - if ((ptMousePos.y >= m_ptDrawPos.y + m_ptDrawStrings[_ctx->i].y) && (ptMousePos.y < m_ptDrawPos.y + m_ptDrawStrings[_ctx->i].y + m_drawedStrings[_ctx->i].getDimy())) { - CORO_INVOKE_1(SetSelected, _ctx->i); + if (ptMousePos.y > _ptDrawPos.y) { + for (_ctx->i = 0; _ctx->i < _numChoices; _ctx->i++) { + if ((ptMousePos.y >= _ptDrawPos.y + _ptDrawStrings[_ctx->i].y) && (ptMousePos.y < _ptDrawPos.y + _ptDrawStrings[_ctx->i].y + _drawedStrings[_ctx->i].getDimy())) { + CORO_INVOKE_1(setSelected, _ctx->i); break; } } - if (_ctx->i == m_numChoices) - CORO_INVOKE_1(SetSelected, -1); + if (_ctx->i == _numChoices) + CORO_INVOKE_1(setSelected, -1); } CORO_END_CODE; } -int RMDialogChoice::GetSelection(void) { - return m_curSelection; +int RMDialogChoice::getSelection(void) { + return _curSelection; } } // End of namespace Tony diff --git a/engines/tony/font.h b/engines/tony/font.h index 752f142cf1..d39b9752a7 100644 --- a/engines/tony/font.h +++ b/engines/tony/font.h @@ -48,12 +48,12 @@ class RMPointer; class RMFont : public RMGfxTaskSetPrior { protected: int nLetters; - RMGfxSourceBuffer8RLEByte *m_letter; + RMGfxSourceBuffer8RLEByte *_letter; public: - int m_fontDimx, m_fontDimy; + int _fontDimx, _fontDimy; private: - int m_dimx, m_dimy; + int _dimx, _dimy; class RMFontPrimitive : public RMGfxPrimitive { public: @@ -64,26 +64,26 @@ private: return new RMFontPrimitive(*this); } - int m_nChar; + int _nChar; }; protected: // Loads the font - void Load(uint32 resID, int nChars, int dimx, int dimy, uint32 palResID = RES_F_PAL); - void Load(const byte *buf, int nChars, int dimx, int dimy, uint32 palResID = RES_F_PAL); + void load(uint32 resID, int nChars, int dimx, int dimy, uint32 palResID = RES_F_PAL); + void load(const byte *buf, int nChars, int dimx, int dimy, uint32 palResID = RES_F_PAL); // Remove the font - void Unload(void); + void unload(void); protected: // Conversion form character to font index - virtual int ConvertToLetter(byte nChar) = 0; + virtual int convertToLetter(byte nChar) = 0; // Character width - virtual int LetterLength(int nChar, int nNext = 0) = 0; + virtual int letterLength(int nChar, int nNext = 0) = 0; public: - virtual int LetterHeight(void) = 0; + virtual int letterHeight(void) = 0; public: RMFont(); @@ -91,17 +91,17 @@ public: // Initialisation and closing virtual void init(void) = 0; - virtual void Close(void); + virtual void close(void); // Drawing virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBug, RMGfxPrimitive *prim); // Create a primitive for a letter - RMGfxPrimitive *MakeLetterPrimitive(byte bChar, int &nLength); + RMGfxPrimitive *makeLetterPrimitive(byte bChar, int &nLength); // Length in pixels of a string with the current font - int StringLen(const RMString &text); - int StringLen(char bChar, char bNext = 0); + int stringLen(const RMString &text); + int stringLen(char bChar, char bNext = 0); }; @@ -126,15 +126,15 @@ protected: protected: // Overloaded methods - int ConvertToLetter(byte nChar) { + int convertToLetter(byte nChar) { return cTable[nChar]; } - int LetterLength(int nChar, int nNext = 0) { + int letterLength(int nChar, int nNext = 0) { return (nChar != -1 ? lTable[(byte)nChar] + l2Table[(byte)nChar][(byte)nNext] : lDefault); } public: - int LetterHeight() { + int letterHeight() { return hDefault; } virtual ~RMFontWithTables() {} @@ -149,7 +149,7 @@ public: class RMFontObj : public RMFontColor, public RMFontWithTables { private: - void SetBothCase(int nChar, int nNext, signed char spiazz); + void setBothCase(int nChar, int nNext, signed char spiazz); public: void init(void); @@ -166,7 +166,7 @@ class RMFontCredits : public RMFontColor, public RMFontWithTables { public: void init(void); virtual ~RMFontCredits() {} - virtual void SetBaseColor(byte r, byte g, byte b) {} + virtual void setBaseColor(byte r, byte g, byte b) {} }; /** @@ -174,8 +174,8 @@ public: */ class RMText : public RMGfxWoodyBuffer { private: - static RMFontColor *m_fonts[4]; - static RMGfxClearTask m_clear; + static RMFontColor *_fonts[4]; + static RMGfxClearTask _clear; int maxLineLength; public: @@ -198,26 +198,26 @@ private: byte m_r, m_g, m_b; protected: - virtual void ClipOnScreen(RMGfxPrimitive *prim); + virtual void clipOnScreen(RMGfxPrimitive *prim); public: RMText(); virtual ~RMText(); static void initStatics(); - static void Unload(); + static void unload(); // Set the alignment type - void SetAlignType(HORALIGN aHor, VERALIGN aVer) { + void setAlignType(HORALIGN aHor, VERALIGN aVer) { aHorType = aHor; aVerType = aVer; } // Sets the maximum length of a line in pixels (used to format the text) - void SetMaxLineLength(int max); + void setMaxLineLength(int max); // Write the text - void WriteText(const RMString &text, int font, int *time = NULL); - void WriteText(const RMString &text, RMFontColor *font, int *time = NULL); + void writeText(const RMString &text, int font, int *time = NULL); + void writeText(const RMString &text, RMFontColor *font, int *time = NULL); // Overloaded function to decide when you delete the object from the OT list virtual void removeThis(CORO_PARAM, bool &result); @@ -226,7 +226,7 @@ public: virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // Set the base colour - void SetColor(byte r, byte g, byte b) { + void setColor(byte r, byte g, byte b) { m_r = r; m_g = g; m_b = b; @@ -238,27 +238,27 @@ public: */ class RMTextDialog : public RMText { protected: - int m_startTime; - int m_time; - bool m_bSkipStatus; + int _startTime; + int _time; + bool _bSkipStatus; RMPoint dst; uint32 hEndDisplay; - bool m_bShowed; - bool m_bForceTime; - bool m_bForceNoTime; + bool _bShowed; + bool _bForceTime; + bool _bForceNoTime; uint32 hCustomSkip; uint32 hCustomSkip2; - RMInput *m_input; - bool m_bAlwaysDisplay; - bool m_bNoTab; + RMInput *_input; + bool _bAlwaysDisplay; + bool _bNoTab; public: RMTextDialog(); virtual ~RMTextDialog(); // Write the text - void WriteText(const RMString &text, int font, int *time = NULL); - void WriteText(const RMString &text, RMFontColor *font, int *time = NULL); + void writeText(const RMString &text, int font, int *time = NULL); + void writeText(const RMString &text, RMFontColor *font, int *time = NULL); // Overloaded function to decide when you delete the object from the OT list virtual void removeThis(CORO_PARAM, bool &result); @@ -270,26 +270,26 @@ public: virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // Set the position - void SetPosition(const RMPoint &pt) { + void setPosition(const RMPoint &pt) { dst = pt; } // Waiting - void WaitForEndDisplay(CORO_PARAM); - void SetCustomSkipHandle(uint32 hCustomSkip); - void SetCustomSkipHandle2(uint32 hCustomSkip); - void SetSkipStatus(bool bEnabled); - void SetForcedTime(uint32 dwTime); - void SetNoTab(void); - void ForceTime(void); - void ForceNoTime(void); - void SetAlwaysDisplay(void); + void waitForEndDisplay(CORO_PARAM); + void setCustomSkipHandle(uint32 hCustomSkip); + void setCustomSkipHandle2(uint32 hCustomSkip); + void setSkipStatus(bool bEnabled); + void setForcedTime(uint32 dwTime); + void setNoTab(void); + void forceTime(void); + void forceNoTime(void); + void setAlwaysDisplay(void); // Set the input device, to allow skip from mouse - void SetInput(RMInput *input); + void setInput(RMInput *input); - void Show(void); - void Hide(CORO_PARAM); + void show(void); + void hide(CORO_PARAM); }; class RMTextDialogScrolling : public RMTextDialog { @@ -297,7 +297,7 @@ protected: RMLocation *curLoc; RMPoint startScroll; - virtual void ClipOnScreen(RMGfxPrimitive *prim); + virtual void clipOnScreen(RMGfxPrimitive *prim); public: RMTextDialogScrolling(); @@ -313,26 +313,26 @@ public: */ class RMTextItemName : protected RMText { protected: - RMPoint m_mpos; - RMPoint m_curscroll; - RMItem *m_item; - RMString m_itemName; + RMPoint _mpos; + RMPoint _curscroll; + RMItem *_item; + RMString _itemName; public: RMTextItemName(); virtual ~RMTextItemName(); - void SetMouseCoord(const RMPoint &m) { - m_mpos = m; + void setMouseCoord(const RMPoint &m) { + _mpos = m; } - void DoFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation &loc, RMPointer &ptr, RMInventory &inv); + void doFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation &loc, RMPointer &ptr, RMInventory &inv); virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); - RMPoint GetHotspot(); - RMItem *GetSelectedItem(); - bool IsItemSelected(); - bool IsNormalItemSelected(); + RMPoint getHotspot(); + RMItem *getSelectedItem(); + bool isItemSelected(); + bool isNormalItemSelected(); virtual void removeThis(CORO_PARAM, bool &result) { result = true; @@ -345,21 +345,21 @@ public: */ class RMDialogChoice : public RMGfxWoodyBuffer { private: - int m_curSelection; - int m_numChoices; - RMText *m_drawedStrings; - RMPoint *m_ptDrawStrings; - int m_curAdded; - bool m_bShow; + int _curSelection; + int _numChoices; + RMText *_drawedStrings; + RMPoint *_ptDrawStrings; + int _curAdded; + bool _bShow; RMGfxSourceBuffer8 DlgText; RMGfxSourceBuffer8 DlgTextLine; - RMPoint m_ptDrawPos; + RMPoint _ptDrawPos; uint32 hUnreg; bool bRemoveFromOT; protected: - void Prepare(CORO_PARAM); - void SetSelected(CORO_PARAM, int pos); + void prepare(CORO_PARAM); + void setSelected(CORO_PARAM, int pos); public: virtual void removeThis(CORO_PARAM, bool &result); @@ -373,25 +373,25 @@ public: // Initialisation and closure void init(void); - void Close(void); + void close(void); // Sets the number of possible sentences, which then be added with AddChoice() - void SetNumChoices(int num); + void setNumChoices(int num); // Adds a string with the choice - void AddChoice(const RMString &string); + void addChoice(const RMString &string); // Show and hide the selection, with possible animations. // NOTE: If no parameter is passed to Show(), it is the obligation of // caller to ensure that the class is inserted into OT list - void Show(CORO_PARAM, RMGfxTargetBuffer *bigBuf = NULL); - void Hide(CORO_PARAM); + void show(CORO_PARAM, RMGfxTargetBuffer *bigBuf = NULL); + void hide(CORO_PARAM); // Polling Update - void DoFrame(CORO_PARAM, RMPoint ptMousePos); + void doFrame(CORO_PARAM, RMPoint ptMousePos); // Returns the currently selected item, or -1 if none is selected - int GetSelection(void); + int getSelection(void); }; } // End of namespace Tony diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp index c729a4e8c0..bf708ec075 100644 --- a/engines/tony/game.cpp +++ b/engines/tony/game.cpp @@ -443,10 +443,10 @@ void RMOptionScreen::refreshAll(CORO_PARAM) { _ctx->title = new RMText; if (_nState == MENULOAD) { RMMessage msg(10); - _ctx->title->WriteText(msg[0], 1); + _ctx->title->writeText(msg[0], 1); } else { RMMessage msg(11); - _ctx->title->WriteText(msg[0], 1); + _ctx->title->writeText(msg[0], 1); } addPrim(new RMGfxPrimitive(_ctx->title, RMPoint(320, 10))); @@ -520,8 +520,8 @@ void RMOptionScreen::refreshAll(CORO_PARAM) { } _ctx->num[_ctx->i] = new RMText; - _ctx->num[_ctx->i]->SetAlignType(RMText::HLEFT, RMText::VTOP); - _ctx->num[_ctx->i]->WriteText(s, 2); + _ctx->num[_ctx->i]->setAlignType(RMText::HLEFT, RMText::VTOP); + _ctx->num[_ctx->i]->writeText(s, 2); } addPrim(new RMGfxPrimitive(_ctx->num[0], RMPoint(55 - 3, 180 + 14))); diff --git a/engines/tony/gfxengine.cpp b/engines/tony/gfxengine.cpp index ca7e645825..08976e6092 100644 --- a/engines/tony/gfxengine.cpp +++ b/engines/tony/gfxengine.cpp @@ -186,7 +186,7 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) { // Right Click // *********** if (_input.mouseRightClicked()) { - if (_itemName.IsItemSelected()) { + if (_itemName.isItemSelected()) { _curActionObj = 0; _inv.RightClick(_input.mousePos()); } else @@ -197,7 +197,7 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) { // ************* if (_input.mouseRightReleased()) { if (_inv.RightRelease(_input.mousePos(), _curAction)) { - CORO_INVOKE_3(_tony.MoveAndDoAction, _itemName.GetHotspot(), _itemName.GetSelectedItem(), _curAction); + CORO_INVOKE_3(_tony.MoveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), _curAction); _curAction = TA_GOTO; _point.setAction(_curAction); @@ -229,9 +229,9 @@ void RMGfxEngine::doFrame(CORO_PARAM, bool bDrawLocation) { 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); + 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(); @@ -254,7 +254,7 @@ SKIPCLICKSINISTRO: _point.setAction(_curAction); _point.setSpecialPointer(RMPointer::PTR_NONE); } - } else if (_input.mouseRightClicked() && _itemName.IsItemSelected() && _point.getSpecialPointer() == RMPointer::PTR_NONE) { + } else if (_input.mouseRightClicked() && _itemName.isItemSelected() && _point.getSpecialPointer() == RMPointer::PTR_NONE) { if (_bGUIInterface) { // Before opening the interface, replaces GOTO _curAction = TA_GOTO; @@ -271,7 +271,7 @@ SKIPCLICKSINISTRO: if (_bGUIInterface) { if (_inter.Released(_input.mousePos(), _curAction)) { _point.setAction(_curAction); - CORO_INVOKE_3(_tony.MoveAndDoAction, _itemName.GetHotspot(), _itemName.GetSelectedItem(), _curAction); + CORO_INVOKE_3(_tony.MoveAndDoAction, _itemName.getHotspot(), _itemName.getSelectedItem(), _curAction); _curAction = TA_GOTO; _point.setAction(_curAction); @@ -281,14 +281,14 @@ SKIPCLICKSINISTRO: } // Update the name under the mouse pointer - _itemName.SetMouseCoord(_input.mousePos()); + _itemName.setMouseCoord(_input.mousePos()); if (!_inter.Active() && !_inv.MiniActive()) - CORO_INVOKE_4(_itemName.DoFrame, _bigBuf, _loc, _point, _inv); + 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)); + _inv.doFrame(_bigBuf, _point, _input.mousePos(), (!_tony.InAction() && !_inter.Active() && _bGUIInventory)); } // Animate Tony @@ -397,7 +397,7 @@ void RMGfxEngine::initForNewLocation(int nLoc, RMPoint ptTonyStart, RMPoint star _point.setSpecialPointer(RMPointer::PTR_NONE); _point.setAction(_curAction); _inter.Reset(); - _inv.Reset(); + _inv.reset(); mpalStartIdlePoll(_nCurLoc); } @@ -472,7 +472,7 @@ void RMGfxEngine::init() { _bigBuf.drawOT(Common::nullContext); _bigBuf.clearOT(); delete load; - _vm->_window.GetNewFrame(*this, NULL); + _vm->_window.getNewFrame(*this, NULL); GLOBALS.bPatIrqFreeze = true; @@ -506,7 +506,7 @@ void RMGfxEngine::init() { _tony.LinkToBoxes(&_vm->_theBoxes); // Initialise the inventory and the interface - _inv.Init(); + _inv.init(); _inter.Init(); // Download the location and set priorities @@@@@ @@ -522,7 +522,7 @@ void RMGfxEngine::close(void) { _bigBuf.clearOT(); _inter.Close(); - _inv.Close(); + _inv.close(); _tony.Close(); _point.close(); _input.close(); diff --git a/engines/tony/inventory.cpp b/engines/tony/inventory.cpp index cd302f8259..360e53803e 100644 --- a/engines/tony/inventory.cpp +++ b/engines/tony/inventory.cpp @@ -60,7 +60,7 @@ RMInventory::RMInventory() { } RMInventory::~RMInventory() { - Close(); + close(); g_system->deleteMutex(m_csModifyInterface); } @@ -72,8 +72,7 @@ bool RMInventory::CheckPointInside(const RMPoint &pt) { } - -void RMInventory::Init(void) { +void RMInventory::init(void) { int i, j; int curres; @@ -140,27 +139,27 @@ 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); + m_hints[0].setAlignType(RMText::HCENTER, RMText::VTOP); + m_hints[1].setAlignType(RMText::HCENTER, RMText::VTOP); + m_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 + m_hints[0].writeText(msg1[0], 1); // Examine + m_hints[1].writeText(msg2[0], 1); // Take + m_hints[2].writeText(msg3[0], 1); // Use // Prepare initial inventory - Prepare(); + prepare(); drawOT(Common::nullContext); clearOT(); } -void RMInventory::Close(void) { +void RMInventory::close(void) { // Has memory if (m_items != NULL) { // Delete the item pointers @@ -175,7 +174,7 @@ void RMInventory::Close(void) { destroy(); } -void RMInventory::Reset(void) { +void RMInventory::reset(void) { m_state = CLOSED; EndCombine(); } @@ -248,7 +247,7 @@ void RMInventory::RemoveItem(int code) { Common::copy(&m_inv[i + 1], &m_inv[i + 1] + (m_nInv - i), &m_inv[i]); m_nInv--; - Prepare(); + prepare(); drawOT(Common::nullContext); clearOT(); g_system->unlockMutex(m_csModifyInterface); @@ -269,7 +268,7 @@ void RMInventory::AddItem(int code) { m_inv[m_nInv++] = code - 10000; - Prepare(); + prepare(); drawOT(Common::nullContext); clearOT(); g_system->unlockMutex(m_csModifyInterface); @@ -284,7 +283,7 @@ void RMInventory::ChangeItemStatus(uint32 code, uint32 dwStatus) { m_items[code - 10000].icon.SetPattern(dwStatus); m_items[code - 10000].status = dwStatus; - Prepare(); + prepare(); drawOT(Common::nullContext); clearOT(); g_system->unlockMutex(m_csModifyInterface); @@ -292,7 +291,7 @@ void RMInventory::ChangeItemStatus(uint32 code, uint32 dwStatus) { } -void RMInventory::Prepare(void) { +void RMInventory::prepare(void) { int i; for (i = 1; i < RM_SX / 64 - 1; i++) { @@ -363,7 +362,7 @@ bool RMInventory::LeftClick(const RMPoint &mpos, int &nCombineObj) { m_items[29].icon.SetPattern(2); } - Prepare(); + prepare(); drawOT(Common::nullContext); clearOT(); g_system->unlockMutex(m_csModifyInterface); @@ -384,7 +383,7 @@ bool RMInventory::LeftClick(const RMPoint &mpos, int &nCombineObj) { m_items[28].icon.SetPattern(2); } - Prepare(); + prepare(); drawOT(Common::nullContext); clearOT(); g_system->unlockMutex(m_csModifyInterface); @@ -429,7 +428,7 @@ void RMInventory::RightClick(const RMPoint &mpos) { m_items[29].icon.SetPattern(2); } - Prepare(); + prepare(); drawOT(Common::nullContext); clearOT(); g_system->unlockMutex(m_csModifyInterface); @@ -449,7 +448,7 @@ void RMInventory::RightClick(const RMPoint &mpos) { m_items[28].icon.SetPattern(2); } - Prepare(); + prepare(); drawOT(Common::nullContext); clearOT(); g_system->unlockMutex(m_csModifyInterface); @@ -477,7 +476,7 @@ bool RMInventory::RightRelease(const RMPoint &mpos, RMTonyAction &curAction) { #define INVSPEED 20 -void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpos, bool bCanOpen) { +void RMInventory::doFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpos, bool bCanOpen) { int i; bool bNeedRedraw = false; @@ -525,7 +524,7 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo bNeedRedraw = true; if (bNeedRedraw) - Prepare(); + prepare(); g_system->unlockMutex(m_csModifyInterface); } @@ -743,7 +742,7 @@ int RMInventory::LoadState(byte *state) { else m_items[28].icon.SetPattern(1); - Prepare(); + prepare(); drawOT(Common::nullContext); clearOT(); @@ -908,11 +907,11 @@ void RMInterface::Init(void) { m_hotbbox[3].SetRect(56, 51, 93, 99); m_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); + 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); // The text is taken from MPAL for translation RMMessage msg0(12); @@ -921,11 +920,11 @@ 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 + 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 m_bActive = false; m_bPalesati = false; diff --git a/engines/tony/inventory.h b/engines/tony/inventory.h index 9ed250592d..3548317dcc 100644 --- a/engines/tony/inventory.h +++ b/engines/tony/inventory.h @@ -80,7 +80,7 @@ protected: protected: // Prepare the image inventory. It should be recalled whenever the inventory changes - void Prepare(void); + void prepare(void); // Check if the mouse Y position is conrrect, even under the inventory portion of the screen bool CheckPointInside(const RMPoint &pt); @@ -90,12 +90,12 @@ public: virtual ~RMInventory(); // Prepare a frame - void DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpos, bool bCanOpen); + void doFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpos, bool bCanOpen); // Initialisation and closing - void Init(void); - void Close(void); - void Reset(void); + void init(void); + void close(void); + void reset(void); // Overload test for removal from OT list virtual void removeThis(CORO_PARAM, bool &result); diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp index cc323eb5d2..ea378e0fc3 100644 --- a/engines/tony/tony.cpp +++ b/engines/tony/tony.cpp @@ -477,7 +477,7 @@ void TonyEngine::closeVoiceDatabase() { } void TonyEngine::grabThumbnail(void) { - _window.GrabThumbnail(_curThumbnail); + _window.grabThumbnail(_curThumbnail); } void TonyEngine::optionScreen(void) { @@ -533,13 +533,13 @@ void TonyEngine::playProcess(CORO_PARAM, const void *param) { // Handle drawing the frame if (!_vm->_bPaused) { if (!_vm->_theEngine._bWiping) - _vm->_window.GetNewFrame(_vm->_theEngine, NULL); + _vm->_window.getNewFrame(_vm->_theEngine, NULL); else - _vm->_window.GetNewFrame(_vm->_theEngine, &_vm->_theEngine._rcWipeEllipse); + _vm->_window.getNewFrame(_vm->_theEngine, &_vm->_theEngine._rcWipeEllipse); } // Paint the frame onto the screen - _vm->_window.Repaint(); + _vm->_window.repaint(); // Signal the ScummVM debugger _vm->_debugger->onFrame(); @@ -570,12 +570,12 @@ void TonyEngine::close(void) { CoroScheduler.closeEvent(_hEndOfFrame); _theBoxes.Close(); _theEngine.close(); - _window.Close(); + _window.close(); delete[] _curThumbnail; } void TonyEngine::switchFullscreen(bool bFull) { - _window.SwitchFullscreen(bFull); + _window.switchFullscreen(bFull); _theEngine.switchFullscreen(bFull); } @@ -617,7 +617,7 @@ Common::Error TonyEngine::saveGameState(int slot, const Common::String &desc) { return Common::kUnknownError; RMSnapshot s; - s.GrabScreenshot(*GLOBALS.GfxEngine, 4, _curThumbnail); + s.grabScreenshot(*GLOBALS.GfxEngine, 4, _curThumbnail); GLOBALS.GfxEngine->saveState(getSaveStateFileName(slot), (byte *)_curThumbnail, desc); return Common::kNoError; diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp index 5d73443167..cfa9d088e3 100644 --- a/engines/tony/window.cpp +++ b/engines/tony/window.cpp @@ -44,8 +44,8 @@ RMWindow::RMWindow() { } RMWindow::~RMWindow() { - Close(); - RMText::Unload(); + close(); + RMText::unload(); } /** @@ -58,40 +58,40 @@ void RMWindow::init() { // Inizializza i conteggi degli FPS fps = lastfcount = fcount = lastsecond = 0; - m_bGrabScreenshot = false; - m_bGrabThumbnail = false; - m_bGrabMovie = false; + _bGrabScreenshot = false; + _bGrabThumbnail = false; + _bGrabMovie = false; } /** * Close the window */ -void RMWindow::Close(void) { +void RMWindow::close(void) { } -void RMWindow::GrabThumbnail(uint16 *thumbmem) { - m_bGrabThumbnail = true; - m_wThumbBuf = thumbmem; +void RMWindow::grabThumbnail(uint16 *thumbmem) { + _bGrabThumbnail = true; + _wThumbBuf = thumbmem; } /** * Repaint the screen */ -void RMWindow::Repaint(void) { +void RMWindow::repaint(void) { g_system->updateScreen(); } -bool RMWindow::Lock() { +bool RMWindow::lock() { return true; } -void RMWindow::Unlock() { +void RMWindow::unlock() { } /** * Wipes an area of the screen */ -void RMWindow::WipeEffect(Common::Rect &rcBoundEllipse) { +void RMWindow::wipeEffect(Common::Rect &rcBoundEllipse) { if ((rcBoundEllipse.left == 0) && (rcBoundEllipse.top == 0) && (rcBoundEllipse.right == RM_SX) && (rcBoundEllipse.bottom == RM_SY)) { // Full screen clear wanted, so use shortcut method @@ -108,28 +108,28 @@ void RMWindow::WipeEffect(Common::Rect &rcBoundEllipse) { } } -void RMWindow::GetNewFrame(byte *lpBuf, Common::Rect *rcBoundEllipse) { +void RMWindow::getNewFrame(byte *lpBuf, Common::Rect *rcBoundEllipse) { if (rcBoundEllipse != NULL) { // Circular wipe effect - GetNewFrameWipe(lpBuf, *rcBoundEllipse); + getNewFrameWipe(lpBuf, *rcBoundEllipse); } else { // Standard screen copy g_system->copyRectToScreen(lpBuf, RM_SX * 2, 0, 0, RM_SX, RM_SY); } - if (m_bGrabThumbnail) { + if (_bGrabThumbnail) { // Need to generate a thumbnail RMSnapshot s; - s.GrabScreenshot(lpBuf, 4, m_wThumbBuf); - m_bGrabThumbnail = false; + s.grabScreenshot(lpBuf, 4, _wThumbBuf); + _bGrabThumbnail = false; } } /** * Copies a section of the game frame in a circle bounded by the specified rectangle */ -void RMWindow::GetNewFrameWipe(byte *lpBuf, Common::Rect &rcBoundEllipse) { +void RMWindow::getNewFrameWipe(byte *lpBuf, Common::Rect &rcBoundEllipse) { // Clear the screen g_system->fillScreen(0); @@ -208,7 +208,7 @@ void RMWindow::plotLines(const byte *lpBuf, const Common::Point ¢er, int x, byte RMSnapshot::rgb[RM_SX *RM_SY * 3]; -void RMSnapshot::GrabScreenshot(byte *lpBuf, int dezoom, uint16 *lpDestBuf) { +void RMSnapshot::grabScreenshot(byte *lpBuf, int dezoom, uint16 *lpDestBuf) { uint16 *src = (uint16 *)lpBuf; int dimx = RM_SX / dezoom; diff --git a/engines/tony/window.h b/engines/tony/window.h index 70e74eb54d..3d1199482f 100644 --- a/engines/tony/window.h +++ b/engines/tony/window.h @@ -45,14 +45,14 @@ private: static byte rgb[RM_SX *RM_SY * 3]; public: // Take a screenshot - void GrabScreenshot(byte *lpBuf, int dezoom = 1, uint16 *lpDestBuf = NULL); + void grabScreenshot(byte *lpBuf, int dezoom = 1, uint16 *lpDestBuf = NULL); }; class RMWindow { private: - bool Lock(); - void Unlock(); + bool lock(); + void unlock(); void plotSplices(const byte *lpBuf, const Common::Point ¢er, int x, int y); void plotLines(const byte *lpBuf, const Common::Point ¢er, int x, int y); @@ -65,14 +65,14 @@ protected: int mskRed, mskGreen, mskBlue; - bool m_bGrabScreenshot; - bool m_bGrabThumbnail; - bool m_bGrabMovie; - uint16 *m_wThumbBuf; + bool _bGrabScreenshot; + bool _bGrabThumbnail; + bool _bGrabMovie; + uint16 *_wThumbBuf; - void CreateBWPrecalcTable(void); - void WipeEffect(Common::Rect &rcBoundEllipse); - void GetNewFrameWipe(byte *lpBuf, Common::Rect &rcBoundEllipse); + void createBWPrecalcTable(void); + void wipeEffect(Common::Rect &rcBoundEllipse); + void getNewFrameWipe(byte *lpBuf, Common::Rect &rcBoundEllipse); public: RMWindow(); @@ -81,19 +81,19 @@ public: // Initialisation void init(/*HINSTANCE hInst*/); void initDirectDraw(void); - void Close(void); + void close(void); // Drawing - void Repaint(void); + void repaint(void); // Switch between windowed and fullscreen - void SwitchFullscreen(bool bFull) {} + void switchFullscreen(bool bFull) {} // Reads the next frame - void GetNewFrame(byte *lpBuf, Common::Rect *rcBoundEllipse); + void getNewFrame(byte *lpBuf, Common::Rect *rcBoundEllipse); // Request a thumbnail be grabbed during the next frame - void GrabThumbnail(uint16 *buf); + void grabThumbnail(uint16 *buf); int getFps() const { return fps; |