diff options
author | Strangerke | 2012-06-05 08:39:55 +0200 |
---|---|---|
committer | Strangerke | 2012-06-05 08:39:55 +0200 |
commit | 23c95d7014ee9875bb1b55c696d0245d7f114ba8 (patch) | |
tree | 460c6cbc7aab5c49609358117faa7da62e5e1454 /engines/tony | |
parent | 93cba6d88049d73b965143130a1f7751e3dc79db (diff) | |
download | scummvm-rg350-23c95d7014ee9875bb1b55c696d0245d7f114ba8.tar.gz scummvm-rg350-23c95d7014ee9875bb1b55c696d0245d7f114ba8.tar.bz2 scummvm-rg350-23c95d7014ee9875bb1b55c696d0245d7f114ba8.zip |
TONY: Some more renaming
Diffstat (limited to 'engines/tony')
-rw-r--r-- | engines/tony/custom.cpp | 2 | ||||
-rw-r--r-- | engines/tony/font.cpp | 154 | ||||
-rw-r--r-- | engines/tony/font.h | 26 | ||||
-rw-r--r-- | engines/tony/game.cpp | 156 | ||||
-rw-r--r-- | engines/tony/game.h | 12 | ||||
-rw-r--r-- | engines/tony/gfxcore.cpp | 551 | ||||
-rw-r--r-- | engines/tony/gfxcore.h | 282 | ||||
-rw-r--r-- | engines/tony/gfxengine.cpp | 20 | ||||
-rw-r--r-- | engines/tony/gfxengine.h | 2 | ||||
-rw-r--r-- | engines/tony/inventory.cpp | 108 | ||||
-rw-r--r-- | engines/tony/inventory.h | 4 | ||||
-rw-r--r-- | engines/tony/loc.cpp | 86 | ||||
-rw-r--r-- | engines/tony/loc.h | 10 | ||||
-rw-r--r-- | engines/tony/tony.cpp | 6 | ||||
-rw-r--r-- | engines/tony/tonychar.cpp | 22 | ||||
-rw-r--r-- | engines/tony/tonychar.h | 6 | ||||
-rw-r--r-- | engines/tony/window.cpp | 2 | ||||
-rw-r--r-- | engines/tony/window.h | 4 |
18 files changed, 731 insertions, 722 deletions
diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp index 579532d9bc..8092109ef5 100644 --- a/engines/tony/custom.cpp +++ b/engines/tony/custom.cpp @@ -1998,7 +1998,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr } // Making a choice for dialog - _ctx->dc.Init(); + _ctx->dc.init(); _ctx->dc.SetNumChoices(_ctx->num); // Writeall the possible options diff --git a/engines/tony/font.cpp b/engines/tony/font.cpp index 80837be34d..16cf4497fc 100644 --- a/engines/tony/font.cpp +++ b/engines/tony/font.cpp @@ -69,8 +69,8 @@ void RMFont::Load(const byte *buf, int nChars, int dimx, int dimy, uint32 palRes // 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); + m_letter[i].init(buf + i * (dimx * dimy + 8) + 8, dimx, dimy); + m_letter[i].loadPaletteWA(palResID); } m_fontDimx = dimx; @@ -114,7 +114,7 @@ RMGfxPrimitive *RMFont::MakeLetterPrimitive(byte bChar, int &nLength) { return prim; } -void RMFont::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim2) { +void RMFont::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim2) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -124,7 +124,7 @@ void RMFont::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim2) // 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); + CORO_INVOKE_2(m_letter[prim->m_nChar].draw, bigBuf, prim); CORO_END_CODE; } @@ -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); + m_letter[i].loadPaletteWA(pal); } @@ -205,7 +205,7 @@ void RMFontColor::SetBaseColor(byte r1, byte g1, byte b1) { * RMFontParla Methods \****************************************************************************/ -void RMFontParla::Init(void) { +void RMFontParla::init(void) { int i; // bernie: Number of characters in the font @@ -612,7 +612,7 @@ void RMFontParla::Init(void) { * RMFontMacc Methods \****************************************************************************/ -void RMFontMacc::Init(void) { +void RMFontMacc::init(void) { int i; // bernie: Number of characters in the font @@ -976,7 +976,7 @@ void RMFontMacc::Init(void) { * RMFontCredits Methods \****************************************************************************/ -void RMFontCredits::Init(void) { +void RMFontCredits::init(void) { int i; // bernie: Number of characters in the font @@ -1441,7 +1441,7 @@ void RMFontObj::SetBothCase(int nChar, int nNext, signed char spiazz) { } -void RMFontObj::Init(void) { +void RMFontObj::init(void) { int i; //bernie: Number of characters in the font (solo maiuscolo) @@ -1763,7 +1763,7 @@ void RMFontObj::Init(void) { RMFontColor *RMText::m_fonts[4] = { NULL, NULL, NULL, NULL }; RMGfxClearTask RMText::m_clear; -void RMText::InitStatics() { +void RMText::initStatics() { Common::fill(&m_fonts[0], &m_fonts[4], (RMFontColor *)NULL); } @@ -1774,10 +1774,10 @@ RMText::RMText() { // Default length maxLineLength = 350; - m_bTrasp0 = true; + _bTrasp0 = true; aHorType = HCENTER; aVerType = VTOP; - SetPriority(150); + setPriority(150); } RMText::~RMText() { @@ -1808,13 +1808,13 @@ 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[0]->init(); m_fonts[1] = new RMFontObj; - m_fonts[1]->Init(); + m_fonts[1]->init(); m_fonts[2] = new RMFontMacc; - m_fonts[2]->Init(); + m_fonts[2]->init(); m_fonts[3] = new RMFontCredits; - m_fonts[3]->Init(); + m_fonts[3]->init(); } WriteText(text, m_fonts[nFont], time); @@ -1835,7 +1835,7 @@ void RMText::WriteText(const RMString &text, RMFontColor *font, int *time) { font->SetBaseColor(m_r, m_g, m_b); // Destroy the buffer before starting - Destroy(); + destroy(); // If the string is empty, do nothing if (text == NULL || text[0] == '\0') @@ -1893,7 +1893,7 @@ void RMText::WriteText(const RMString &text, RMFontColor *font, int *time) { // Create the surface Create(width, height); //AddPrim(new RMGfxPrimitive(&m_clear)); - Common::fill(m_buf, m_buf + width * height * 2, 0); + Common::fill(_buf, _buf + width * height * 2, 0); p = string; @@ -1935,7 +1935,7 @@ void RMText::WriteText(const RMString &text, RMFontColor *font, int *time) { prim = font->MakeLetterPrimitive(*p, len); prim->Dst().x1 = x; prim->Dst().y1 = y; - AddPrim(prim); + addPrim(prim); numchar++; @@ -1956,37 +1956,37 @@ void RMText::ClipOnScreen(RMGfxPrimitive *prim) { prim->Dst().x1 = 5; if (prim->Dst().y1 < 5) prim->Dst().y1 = 5; - if (prim->Dst().x1 + m_dimx > 635) - prim->Dst().x1 = 635 - m_dimx; - if (prim->Dst().y1 + m_dimy > 475) - prim->Dst().y1 = 475 - m_dimy; + if (prim->Dst().x1 + _dimx > 635) + prim->Dst().x1 = 635 - _dimx; + if (prim->Dst().y1 + _dimy > 475) + prim->Dst().y1 = 475 - _dimy; } -void RMText::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMText::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); // Horizontally if (aHorType == HCENTER) - prim->Dst().TopLeft() -= RMPoint(m_dimx / 2, 0); + prim->Dst().TopLeft() -= RMPoint(_dimx / 2, 0); else if (aHorType == HRIGHT) - prim->Dst().TopLeft() -= RMPoint(m_dimx, 0); + prim->Dst().TopLeft() -= RMPoint(_dimx, 0); // Vertically if (aVerType == VTOP) { } else if (aVerType == VCENTER) { - prim->Dst().y1 -= m_dimy / 2; + prim->Dst().y1 -= _dimy / 2; } else if (aVerType == VBOTTOM) { - prim->Dst().y1 -= m_dimy; + prim->Dst().y1 -= _dimy; } ClipOnScreen(prim); - CORO_INVOKE_2(RMGfxWoodyBuffer::Draw, bigBuf, prim); + CORO_INVOKE_2(RMGfxWoodyBuffer::draw, bigBuf, prim); CORO_END_CODE; } @@ -2132,11 +2132,11 @@ void RMTextDialog::RemoveThis(CORO_PARAM, bool &result) { void RMTextDialog::Unregister(void) { RMGfxTask::Unregister(); - assert(m_nInList == 0); + assert(_nInList == 0); CoroScheduler.setEvent(hEndDisplay); } -void RMTextDialog::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMTextDialog::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -2148,7 +2148,7 @@ void RMTextDialog::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *p if (m_bShowed) { if (GLOBALS.bCfgSottotitoli || m_bAlwaysDisplay) { prim->Dst().TopLeft() = dst; - CORO_INVOKE_2(RMText::Draw, bigBuf, prim); + CORO_INVOKE_2(RMText::draw, bigBuf, prim); } } @@ -2187,7 +2187,7 @@ RMTextDialogScrolling::RMTextDialogScrolling(RMLocation *loc) { RMTextDialogScrolling::~RMTextDialogScrolling() { } -void RMTextDialogScrolling::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMTextDialogScrolling::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; RMPoint curDst; CORO_END_CONTEXT(_ctx); @@ -2199,7 +2199,7 @@ void RMTextDialogScrolling::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPri if (curLoc != NULL) dst -= curLoc->ScrollPosition() - startScroll; - CORO_INVOKE_2(RMTextDialog::Draw, bigBuf, prim); + CORO_INVOKE_2(RMTextDialog::draw, bigBuf, prim); dst = _ctx->curDst; @@ -2217,7 +2217,7 @@ void RMTextDialogScrolling::ClipOnScreen(RMGfxPrimitive *prim) { RMTextItemName::RMTextItemName() : RMText() { m_item = NULL; - SetPriority(220); + setPriority(220); } RMTextItemName::~RMTextItemName() { @@ -2237,8 +2237,8 @@ void RMTextItemName::DoFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation & _ctx->lastItem = m_item; // Adds to the list if there is need - if (!m_nInList) - bigBuf.AddPrim(new RMGfxPrimitive(this)); + if (!_nInList) + bigBuf.addPrim(new RMGfxPrimitive(this)); // Update the scrolling co-ordinates m_curscroll = loc.ScrollPosition(); @@ -2275,20 +2275,20 @@ void RMTextItemName::DoFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation & } -void RMTextItemName::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMTextItemName::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); // If there is no text, it's pointless to continue - if (m_buf == NULL) + if (_buf == NULL) return; // Set the destination coordinates of the mouse prim->Dst().TopLeft() = m_mpos - RMPoint(0, 30); - CORO_INVOKE_2(RMText::Draw, bigBuf, prim); + CORO_INVOKE_2(RMText::draw, bigBuf, prim); CORO_END_CODE; } @@ -2322,11 +2322,11 @@ RMDialogChoice::RMDialogChoice() { RMResRaw dlg2(RES_I_DLGTEXTLINE); RMRes dlgpal(RES_I_DLGTEXTPAL); - DlgText.Init(dlg1, dlg1.Width(), dlg1.Height()); - DlgTextLine.Init(dlg2, dlg2.Width(), dlg2.Height()); + DlgText.init(dlg1, dlg1.Width(), dlg1.Height()); + DlgTextLine.init(dlg2, dlg2.Width(), dlg2.Height()); - DlgText.LoadPaletteWA(dlgpal); - DlgTextLine.LoadPaletteWA(dlgpal); + DlgText.loadPaletteWA(dlgpal); + DlgTextLine.loadPaletteWA(dlgpal); hUnreg = CoroScheduler.createEvent(false, false); bRemoveFromOT = false; @@ -2338,20 +2338,20 @@ RMDialogChoice::~RMDialogChoice() { void RMDialogChoice::Unregister(void) { RMGfxWoodyBuffer::Unregister(); - assert(!m_nInList); + assert(!_nInList); CoroScheduler.pulseEvent(hUnreg); bRemoveFromOT = false; } -void RMDialogChoice::Init(void) { +void RMDialogChoice::init(void) { m_numChoices = 0; m_drawedStrings = NULL; m_ptDrawStrings = NULL; m_curSelection = -1; Create(640, 477); - SetPriority(140); + setPriority(140); } @@ -2366,7 +2366,7 @@ void RMDialogChoice::Close(void) { m_ptDrawStrings = NULL; } - Destroy(); + destroy(); } void RMDialogChoice::SetNumChoices(int num) { @@ -2384,7 +2384,7 @@ void RMDialogChoice::SetNumChoices(int num) { 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); + m_drawedStrings[i].setPriority(10); } } @@ -2402,22 +2402,22 @@ void RMDialogChoice::Prepare(CORO_PARAM) { CORO_BEGIN_CODE(_ctx); - AddPrim(new RMGfxPrimitive(&DlgText, RMPoint(0, 0))); - AddPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155))); - AddPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83))); - AddPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83 + 83))); - AddPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83 + 83 + 83))); + addPrim(new RMGfxPrimitive(&DlgText, RMPoint(0, 0))); + addPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155))); + addPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83))); + addPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83 + 83))); + addPrim(new RMGfxPrimitive(&DlgTextLine, RMPoint(0, 155 + 83 + 83 + 83))); _ctx->ptPos.Set(20, 90); for (_ctx->i = 0; _ctx->i < m_numChoices; _ctx->i++) { - AddPrim(new RMGfxPrimitive(&m_drawedStrings[_ctx->i], _ctx->ptPos)); + addPrim(new RMGfxPrimitive(&m_drawedStrings[_ctx->i], _ctx->ptPos)); m_ptDrawStrings[_ctx->i] = _ctx->ptPos; - _ctx->ptPos.Offset(0, m_drawedStrings[_ctx->i].Dimy() + 15); + _ctx->ptPos.Offset(0, m_drawedStrings[_ctx->i].getDimy() + 15); } - CORO_INVOKE_0(DrawOT); - ClearOT(); + CORO_INVOKE_0(drawOT); + clearOT(); m_ptDrawPos.Set(0, 480 - _ctx->ptPos.y); @@ -2435,29 +2435,29 @@ void RMDialogChoice::SetSelected(CORO_PARAM, int pos) { if (pos == m_curSelection) return; - _ctx->box.SetPriority(5); + _ctx->box.setPriority(5); if (m_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].Dimy()); - AddPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc)); + _ctx->rc.BottomRight() = _ctx->rc.TopLeft() + RMPoint(597, m_drawedStrings[m_curSelection].getDimy()); + addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc)); - AddPrim(new RMGfxPrimitive(&m_drawedStrings[m_curSelection], m_ptDrawStrings[m_curSelection])); - CORO_INVOKE_0(DrawOT); - ClearOT(); + addPrim(new RMGfxPrimitive(&m_drawedStrings[m_curSelection], m_ptDrawStrings[m_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].Dimy()); - AddPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc)); - AddPrim(new RMGfxPrimitive(&m_drawedStrings[pos], m_ptDrawStrings[pos])); + _ctx->rc.BottomRight() = _ctx->rc.TopLeft() + RMPoint(597, m_drawedStrings[pos].getDimy()); + addPrim(new RMGfxPrimitive(&_ctx->box, _ctx->rc)); + addPrim(new RMGfxPrimitive(&m_drawedStrings[pos], m_ptDrawStrings[pos])); } - CORO_INVOKE_0(DrawOT); - ClearOT(); + CORO_INVOKE_0(drawOT); + clearOT(); m_curSelection = pos; @@ -2477,8 +2477,8 @@ void RMDialogChoice::Show(CORO_PARAM, RMGfxTargetBuffer *bigBuf) { CORO_INVOKE_0(Prepare); m_bShow = false; - if (!m_nInList && bigBuf != NULL) - bigBuf->AddPrim(new RMGfxPrimitive(this)); + if (!_nInList && bigBuf != NULL) + bigBuf->addPrim(new RMGfxPrimitive(this)); if (0) { m_bShow = true; @@ -2488,8 +2488,8 @@ void RMDialogChoice::Show(CORO_PARAM, RMGfxTargetBuffer *bigBuf) { _ctx->destpt = m_ptDrawPos; m_ptDrawPos.Set(0, 480); - if (!m_nInList && bigBuf != NULL) - bigBuf->AddPrim(new RMGfxPrimitive(this)); + if (!_nInList && bigBuf != NULL) + bigBuf->addPrim(new RMGfxPrimitive(this)); m_bShow = true; _ctx->elaps = 0; @@ -2507,7 +2507,7 @@ void RMDialogChoice::Show(CORO_PARAM, RMGfxTargetBuffer *bigBuf) { CORO_END_CODE; } -void RMDialogChoice::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMDialogChoice::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -2516,8 +2516,8 @@ void RMDialogChoice::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive if (m_bShow == false) return; - prim->SetDst(m_ptDrawPos); - CORO_INVOKE_2(RMGfxSourceBuffer16::Draw, bigBuf, prim); + prim->setDst(m_ptDrawPos); + CORO_INVOKE_2(RMGfxSourceBuffer16::draw, bigBuf, prim); CORO_END_CODE; } @@ -2567,7 +2567,7 @@ void RMDialogChoice::DoFrame(CORO_PARAM, RMPoint ptMousePos) { 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].Dimy())) { + 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); break; } diff --git a/engines/tony/font.h b/engines/tony/font.h index 82ce686ec0..0faaec89d4 100644 --- a/engines/tony/font.h +++ b/engines/tony/font.h @@ -90,11 +90,11 @@ public: virtual ~RMFont(); // Initialisation and closing - virtual void Init(void) = 0; + virtual void init(void) = 0; virtual void Close(void); // Drawing - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBug, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBug, RMGfxPrimitive *prim); // Create a primitive for a letter RMGfxPrimitive *MakeLetterPrimitive(byte bChar, int &nLength); @@ -143,7 +143,7 @@ public: class RMFontParla : public RMFontColor, public RMFontWithTables { public: - void Init(void); + void init(void); virtual ~RMFontParla() {} }; @@ -152,19 +152,19 @@ private: void SetBothCase(int nChar, int nNext, signed char spiazz); public: - void Init(void); + void init(void); virtual ~RMFontObj() {} }; class RMFontMacc : public RMFontColor, public RMFontWithTables { public: - void Init(void); + void init(void); virtual ~RMFontMacc() {} }; class RMFontCredits : public RMFontColor, public RMFontWithTables { public: - void Init(void); + void init(void); virtual ~RMFontCredits() {} virtual void SetBaseColor(byte r, byte g, byte b) {} }; @@ -203,7 +203,7 @@ protected: public: RMText(); virtual ~RMText(); - static void InitStatics(); + static void initStatics(); static void Unload(); // Set the alignment type @@ -223,7 +223,7 @@ public: virtual void RemoveThis(CORO_PARAM, bool &result); // Overloading of the Draw to center the text, if necessary - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // Set the base colour void SetColor(byte r, byte g, byte b) { @@ -267,7 +267,7 @@ public: virtual void Unregister(void); // Overloading of the Draw to center the text, if necessary - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // Set the position void SetPosition(const RMPoint &pt) { @@ -304,7 +304,7 @@ public: RMTextDialogScrolling(RMLocation *loc); virtual ~RMTextDialogScrolling(); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); }; @@ -327,7 +327,7 @@ public: } void DoFrame(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMLocation &loc, RMPointer &ptr, RMInventory &inv); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); RMPoint GetHotspot(); RMItem *GetSelectedItem(); @@ -363,7 +363,7 @@ protected: public: virtual void RemoveThis(CORO_PARAM, bool &result); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); void Unregister(void); public: @@ -372,7 +372,7 @@ public: virtual ~RMDialogChoice(); // Initialisation and closure - void Init(void); + void init(void); void Close(void); // Sets the number of possible sentences, which then be added with AddChoice() diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp index 220f41a558..c22706cc6d 100644 --- a/engines/tony/game.cpp +++ b/engines/tony/game.cpp @@ -126,7 +126,7 @@ RMOptionButton::RMOptionButton(uint32 dwRes, RMPoint pt, bool bDoubleState) { RMResRaw raw(dwRes); assert(raw.IsValid()); m_buf = new RMGfxSourceBuffer16(false); - m_buf->Init(raw, raw.Width(), raw.Height()); + m_buf->init(raw, raw.Width(), raw.Height()); m_rect.SetRect(pt.x, pt.y, pt.x + raw.Width() - 1, pt.y + raw.Height() - 1); m_bActive = false; @@ -170,9 +170,7 @@ bool RMOptionButton::DoFrame(const RMPoint &mousePos, bool bLeftClick, bool bRig return false; } - - -void RMOptionButton::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMOptionButton::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -182,14 +180,14 @@ void RMOptionButton::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive return; if (m_bHasGfx) - CORO_INVOKE_2(m_buf->Draw, bigBuf, prim); + CORO_INVOKE_2(m_buf->draw, bigBuf, prim); CORO_END_CODE; } void RMOptionButton::AddToList(RMGfxTargetBuffer &bigBuf) { if (m_bHasGfx) - bigBuf.AddPrim(new RMGfxPrimitive(this, m_rect)); + bigBuf.addPrim(new RMGfxPrimitive(this, m_rect)); } /****************************************************************************\ @@ -272,7 +270,7 @@ bool RMOptionSlide::DoFrame(const RMPoint &mousePos, bool bLeftClick, bool bRigh return bRefresh; } -void RMOptionSlide::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMOptionSlide::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; int i; int val; @@ -290,21 +288,21 @@ void RMOptionSlide::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive * else if (_ctx->val > 100) _ctx->val = 100; if (_ctx->val == 1) { - prim->SetDst(_ctx->pos); - CORO_INVOKE_2(m_SliderSingle->Draw, bigBuf, prim); + prim->setDst(_ctx->pos); + CORO_INVOKE_2(m_SliderSingle->draw, bigBuf, prim); } else { - prim->SetDst(_ctx->pos); - CORO_INVOKE_2(m_SliderLeft->Draw, bigBuf, prim); + prim->setDst(_ctx->pos); + CORO_INVOKE_2(m_SliderLeft->draw, bigBuf, prim); _ctx->pos.x += 3; for (_ctx->i = 1; _ctx->i < _ctx->val - 1; _ctx->i++) { - prim->SetDst(_ctx->pos); - CORO_INVOKE_2(m_SliderCenter->Draw, bigBuf, prim); + prim->setDst(_ctx->pos); + CORO_INVOKE_2(m_SliderCenter->draw, bigBuf, prim); _ctx->pos.x += 3; } - prim->SetDst(_ctx->pos); - CORO_INVOKE_2(m_SliderRight->Draw, bigBuf, prim); + prim->setDst(_ctx->pos); + CORO_INVOKE_2(m_SliderRight->draw, bigBuf, prim); _ctx->pos.x += 3; } @@ -312,7 +310,7 @@ void RMOptionSlide::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive * } void RMOptionSlide::AddToList(RMGfxTargetBuffer &bigBuf) { - bigBuf.AddPrim(new RMGfxPrimitive(this)); + bigBuf.addPrim(new RMGfxPrimitive(this)); } @@ -392,15 +390,15 @@ void RMOptionScreen::RefreshAll(CORO_PARAM) { CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - ClearOT(); + clearOT(); - AddPrim(new RMGfxPrimitive(m_menu)); + addPrim(new RMGfxPrimitive(m_menu)); if (m_bNoLoadSave) - AddPrim(new RMGfxPrimitive(m_HideLoadSave, RMPoint(0, 401))); + addPrim(new RMGfxPrimitive(m_HideLoadSave, RMPoint(0, 401))); if (m_bQuitConfirm) { - AddPrim(new RMGfxPrimitive(m_QuitConfirm, RMPoint(270, 200))); + addPrim(new RMGfxPrimitive(m_QuitConfirm, RMPoint(270, 200))); m_ButtonQuitYes->AddToList(*this); m_ButtonQuitNo->AddToList(*this); } @@ -449,62 +447,62 @@ void RMOptionScreen::RefreshAll(CORO_PARAM) { _ctx->title->WriteText(msg[0], 1); } - AddPrim(new RMGfxPrimitive(_ctx->title, RMPoint(320, 10))); + addPrim(new RMGfxPrimitive(_ctx->title, RMPoint(320, 10))); if (m_curThumbDiff[0] == 0) - AddPrim(new RMGfxPrimitive(m_SaveHard, RMPoint(48, 57))); + addPrim(new RMGfxPrimitive(m_SaveHard, RMPoint(48, 57))); else if (m_curThumbDiff[0] == 1) - AddPrim(new RMGfxPrimitive(m_SaveEasy, RMPoint(48, 57))); + addPrim(new RMGfxPrimitive(m_SaveEasy, RMPoint(48, 57))); if (m_curThumbDiff[1] == 0) - AddPrim(new RMGfxPrimitive(m_SaveHard, RMPoint(240, 57))); + addPrim(new RMGfxPrimitive(m_SaveHard, RMPoint(240, 57))); else if (m_curThumbDiff[1] == 1) - AddPrim(new RMGfxPrimitive(m_SaveEasy, RMPoint(240, 57))); + addPrim(new RMGfxPrimitive(m_SaveEasy, RMPoint(240, 57))); if (m_curThumbDiff[2] == 0) - AddPrim(new RMGfxPrimitive(m_SaveHard, RMPoint(432, 57))); + addPrim(new RMGfxPrimitive(m_SaveHard, RMPoint(432, 57))); else if (m_curThumbDiff[2] == 1) - AddPrim(new RMGfxPrimitive(m_SaveEasy, RMPoint(432, 57))); + addPrim(new RMGfxPrimitive(m_SaveEasy, RMPoint(432, 57))); if (m_curThumbDiff[3] == 0) - AddPrim(new RMGfxPrimitive(m_SaveHard, RMPoint(48, 239))); + addPrim(new RMGfxPrimitive(m_SaveHard, RMPoint(48, 239))); else if (m_curThumbDiff[3] == 1) - AddPrim(new RMGfxPrimitive(m_SaveEasy, RMPoint(48, 239))); + addPrim(new RMGfxPrimitive(m_SaveEasy, RMPoint(48, 239))); if (m_curThumbDiff[4] == 0) - AddPrim(new RMGfxPrimitive(m_SaveHard, RMPoint(240, 239))); + addPrim(new RMGfxPrimitive(m_SaveHard, RMPoint(240, 239))); else if (m_curThumbDiff[4] == 1) - AddPrim(new RMGfxPrimitive(m_SaveEasy, RMPoint(240, 239))); + addPrim(new RMGfxPrimitive(m_SaveEasy, RMPoint(240, 239))); if (m_curThumbDiff[5] == 0) - AddPrim(new RMGfxPrimitive(m_SaveHard, RMPoint(432, 239))); + addPrim(new RMGfxPrimitive(m_SaveHard, RMPoint(432, 239))); else if (m_curThumbDiff[5] == 1) - AddPrim(new RMGfxPrimitive(m_SaveEasy, RMPoint(432, 239))); + addPrim(new RMGfxPrimitive(m_SaveEasy, RMPoint(432, 239))); if (m_curThumb[0] && !(m_bEditSaveName && m_nEditPos == 0)) - AddPrim(new RMGfxPrimitive(m_curThumb[0], RMPoint(48, 57))); + addPrim(new RMGfxPrimitive(m_curThumb[0], RMPoint(48, 57))); if (m_curThumb[1] && !(m_bEditSaveName && m_nEditPos == 1)) - AddPrim(new RMGfxPrimitive(m_curThumb[1], RMPoint(240, 57))); + addPrim(new RMGfxPrimitive(m_curThumb[1], RMPoint(240, 57))); if (m_curThumb[2] && !(m_bEditSaveName && m_nEditPos == 2)) - AddPrim(new RMGfxPrimitive(m_curThumb[2], RMPoint(432, 57))); + addPrim(new RMGfxPrimitive(m_curThumb[2], RMPoint(432, 57))); if (m_curThumb[3] && !(m_bEditSaveName && m_nEditPos == 3)) - AddPrim(new RMGfxPrimitive(m_curThumb[3], RMPoint(48, 239))); + addPrim(new RMGfxPrimitive(m_curThumb[3], RMPoint(48, 239))); if (m_curThumb[4] && !(m_bEditSaveName && m_nEditPos == 4)) - AddPrim(new RMGfxPrimitive(m_curThumb[4], RMPoint(240, 239))); + addPrim(new RMGfxPrimitive(m_curThumb[4], RMPoint(240, 239))); if (m_curThumb[5] && !(m_bEditSaveName && m_nEditPos == 5)) - AddPrim(new RMGfxPrimitive(m_curThumb[5], RMPoint(432, 239))); + addPrim(new RMGfxPrimitive(m_curThumb[5], RMPoint(432, 239))); if (m_bEditSaveName) { _ctx->thumb = new RMGfxSourceBuffer16; - _ctx->thumb->Init((byte *)_vm->getThumbnail(), 640 / 4, 480 / 4); + _ctx->thumb->init((byte *)_vm->getThumbnail(), 640 / 4, 480 / 4); if (m_nEditPos == 0) - AddPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(48, 57))); + addPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(48, 57))); else if (m_nEditPos == 1) - AddPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(240, 57))); + addPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(240, 57))); else if (m_nEditPos == 2) - AddPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(432, 57))); + addPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(432, 57))); else if (m_nEditPos == 3) - AddPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(48, 239))); + addPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(48, 239))); else if (m_nEditPos == 4) - AddPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(240, 239))); + addPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(240, 239))); else if (m_nEditPos == 5) - AddPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(432, 239))); + addPrim(new RMGfxPrimitive(_ctx->thumb, RMPoint(432, 239))); } for (_ctx->i = 0; _ctx->i < 6; _ctx->i++) { @@ -524,18 +522,18 @@ void RMOptionScreen::RefreshAll(CORO_PARAM) { _ctx->num[_ctx->i]->WriteText(s, 2); } - AddPrim(new RMGfxPrimitive(_ctx->num[0], RMPoint(55 - 3, 180 + 14))); - AddPrim(new RMGfxPrimitive(_ctx->num[1], RMPoint(247 - 3, 180 + 14))); - AddPrim(new RMGfxPrimitive(_ctx->num[2], RMPoint(439 - 3, 180 + 14))); - AddPrim(new RMGfxPrimitive(_ctx->num[3], RMPoint(55 - 3, 362 + 14))); - AddPrim(new RMGfxPrimitive(_ctx->num[4], RMPoint(247 - 3, 362 + 14))); - AddPrim(new RMGfxPrimitive(_ctx->num[5], RMPoint(439 - 3, 362 + 14))); + addPrim(new RMGfxPrimitive(_ctx->num[0], RMPoint(55 - 3, 180 + 14))); + addPrim(new RMGfxPrimitive(_ctx->num[1], RMPoint(247 - 3, 180 + 14))); + addPrim(new RMGfxPrimitive(_ctx->num[2], RMPoint(439 - 3, 180 + 14))); + addPrim(new RMGfxPrimitive(_ctx->num[3], RMPoint(55 - 3, 362 + 14))); + addPrim(new RMGfxPrimitive(_ctx->num[4], RMPoint(247 - 3, 362 + 14))); + addPrim(new RMGfxPrimitive(_ctx->num[5], RMPoint(439 - 3, 362 + 14))); m_ButtonSave_ArrowLeft->AddToList(*this); m_ButtonSave_ArrowRight->AddToList(*this); } - CORO_INVOKE_0(DrawOT); + CORO_INVOKE_0(drawOT); if (m_nState == MENULOAD || m_nState == MENUSAVE) { if (_ctx->thumb) delete _ctx->thumb; @@ -588,7 +586,7 @@ void RMOptionScreen::InitState(CORO_PARAM) { assert(_ctx->raw->IsValid()); assert(m_menu == NULL); m_menu = new RMGfxSourceBuffer16(false); - m_menu->Init(*_ctx->raw, _ctx->raw->Width(), _ctx->raw->Height()); + m_menu->init(*_ctx->raw, _ctx->raw->Width(), _ctx->raw->Height()); delete _ctx->raw; if (m_nState == MENULOAD || m_nState == MENUSAVE) { @@ -650,22 +648,22 @@ void RMOptionScreen::InitState(CORO_PARAM) { assert(_ctx->raw->IsValid()); assert(m_QuitConfirm == NULL); m_QuitConfirm = new RMGfxSourceBuffer16(false); - m_QuitConfirm->Init(*_ctx->raw, _ctx->raw->Width(), _ctx->raw->Height()); + m_QuitConfirm->init(*_ctx->raw, _ctx->raw->Width(), _ctx->raw->Height()); delete _ctx->raw; assert(m_ButtonQuitYes == NULL); m_ButtonQuitYes = new RMOptionButton(20022, RMPoint(281, 265)); - m_ButtonQuitYes->SetPriority(30); + m_ButtonQuitYes->setPriority(30); assert(m_ButtonQuitNo == NULL); m_ButtonQuitNo = new RMOptionButton(20023, RMPoint(337, 264)); - m_ButtonQuitNo->SetPriority(30); + m_ButtonQuitNo->setPriority(30); if (m_bNoLoadSave) { _ctx->raw = new RMResRaw(20028); assert(_ctx->raw->IsValid()); assert(m_HideLoadSave == NULL); m_HideLoadSave = new RMGfxSourceBuffer16(false); - m_HideLoadSave->Init(*_ctx->raw, _ctx->raw->Width(), _ctx->raw->Height()); + m_HideLoadSave->init(*_ctx->raw, _ctx->raw->Width(), _ctx->raw->Height()); delete _ctx->raw; } @@ -863,7 +861,7 @@ void RMOptionScreen::CloseState(void) { } void RMOptionScreen::ReInit(RMGfxTargetBuffer &bigBuf) { - bigBuf.AddPrim(new RMGfxPrimitive(this)); + bigBuf.addPrim(new RMGfxPrimitive(this)); } void RMOptionScreen::Init(CORO_PARAM, RMGfxTargetBuffer &bigBuf, bool &result) { @@ -885,7 +883,7 @@ void RMOptionScreen::Init(CORO_PARAM, RMGfxTargetBuffer &bigBuf, bool &result) { m_bNoLoadSave = false; m_bAlterGfx = false; - bigBuf.AddPrim(new RMGfxPrimitive(this)); + bigBuf.addPrim(new RMGfxPrimitive(this)); if (m_nState == MENULOAD || m_nState == MENUSAVE) m_nState = MENUGAME; @@ -916,7 +914,7 @@ void RMOptionScreen::InitLoadMenuOnly(CORO_PARAM, RMGfxTargetBuffer &bigBuf, boo m_bNoLoadSave = false; m_bAlterGfx = bAlternateGfx; - bigBuf.AddPrim(new RMGfxPrimitive(this)); + bigBuf.addPrim(new RMGfxPrimitive(this)); m_nState = MENULOAD; CORO_INVOKE_0(InitState); @@ -945,7 +943,7 @@ void RMOptionScreen::InitSaveMenuOnly(CORO_PARAM, RMGfxTargetBuffer &bigBuf, boo m_bNoLoadSave = false; m_bAlterGfx = bAlternateGfx; - bigBuf.AddPrim(new RMGfxPrimitive(this)); + bigBuf.addPrim(new RMGfxPrimitive(this)); m_nState = MENUSAVE; CORO_INVOKE_0(InitState); @@ -973,7 +971,7 @@ void RMOptionScreen::InitNoLoadSave(CORO_PARAM, RMGfxTargetBuffer &bigBuf, bool m_bLoadMenuOnly = false; m_bNoLoadSave = true; - bigBuf.AddPrim(new RMGfxPrimitive(this)); + bigBuf.addPrim(new RMGfxPrimitive(this)); m_nState = MENUGAME; CORO_INVOKE_0(InitState); @@ -1273,7 +1271,7 @@ void RMOptionScreen::DoFrame(CORO_PARAM, RMInput *input) { } -void RMOptionScreen::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMOptionScreen::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; int curTime; CORO_END_CONTEXT(_ctx); @@ -1300,7 +1298,7 @@ void RMOptionScreen::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive } // Set the part to draw the scrolling - prim->SetSrc(RMRect(0, 480 - m_FadeY, 640, 480)); + prim->setSrc(RMRect(0, 480 - m_FadeY, 640, 480)); } else if (m_FadeStep == 2) { // Bounce 1 @@ -1310,7 +1308,7 @@ void RMOptionScreen::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive m_FadeStep++; } - prim->SetSrc(RMRect(0, 480 - m_FadeY, 640, 480)); + prim->setSrc(RMRect(0, 480 - m_FadeY, 640, 480)); } else if (m_FadeStep == 3) { m_FadeY -= FADE_SPEED / 4 * SYNC; @@ -1319,7 +1317,7 @@ void RMOptionScreen::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive m_FadeStep++; } - prim->SetSrc(RMRect(0, 480 - m_FadeY, 640, 480)); + prim->setSrc(RMRect(0, 480 - m_FadeY, 640, 480)); } else if (m_FadeStep == 4) { // Bounce 1 - 2 @@ -1329,7 +1327,7 @@ void RMOptionScreen::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive m_FadeStep++; } - prim->SetSrc(RMRect(0, 480 - m_FadeY, 640, 480)); + prim->setSrc(RMRect(0, 480 - m_FadeY, 640, 480)); } else if (m_FadeStep == 5) { m_FadeY += FADE_SPEED / 2 * SYNC; @@ -1339,7 +1337,7 @@ void RMOptionScreen::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive _vm->hideLocation(); } - prim->SetSrc(RMRect(0, 480 - m_FadeY, 640, 480)); + prim->setSrc(RMRect(0, 480 - m_FadeY, 640, 480)); } else if (m_FadeStep == 6) { // Menu ON @@ -1355,7 +1353,7 @@ void RMOptionScreen::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive m_FadeY = 0; m_FadeStep++; } - prim->SetSrc(RMRect(0, 480 - m_FadeY, 640, 480)); + prim->setSrc(RMRect(0, 480 - m_FadeY, 640, 480)); } else if (m_FadeStep == 9) { // Hello hello! @@ -1372,7 +1370,7 @@ void RMOptionScreen::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive m_FadeTime = _ctx->curTime; - CORO_INVOKE_2(RMGfxWoodyBuffer::Draw, bigBuf, prim); + CORO_INVOKE_2(RMGfxWoodyBuffer::draw, bigBuf, prim); CORO_END_CODE; } @@ -1483,8 +1481,8 @@ void RMPointer::Init(void) { RMResRaw res(RES_P_GO + i); m_pointer[i] = new RMGfxSourceBuffer8RLEByteAA; - m_pointer[i]->Init(res, res.Width(), res.Height(), false); - m_pointer[i]->LoadPaletteWA(RES_P_PAL); + m_pointer[i]->init(res, res.Width(), res.Height(), false); + m_pointer[i]->loadPaletteWA(RES_P_PAL); } for (i = 0; i < 5; i++) { @@ -1530,7 +1528,7 @@ int RMPointer::Priority() { return 200; } -void RMPointer::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMPointer::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; int n; CORO_END_CONTEXT(_ctx); @@ -1542,20 +1540,20 @@ void RMPointer::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim if (_ctx->n == TA_COMBINE) _ctx->n = TA_USE; // Copy the destination coordinates in the primitive - prim->SetDst(m_pos); + prim->setDst(m_pos); if (m_pos.x >= 0 && m_pos.y >= 0 && m_pos.x < RM_SX && m_pos.y < RM_SY) { // Call the Draw method of the poitner prim->Dst() -= m_hotspot[_ctx->n]; if (m_nCurSpecialPointer == 0) { - CORO_INVOKE_2(m_pointer[_ctx->n]->Draw, bigBuf, prim); + CORO_INVOKE_2(m_pointer[_ctx->n]->draw, bigBuf, prim); } else { if (m_nCurSpecialPointer == PTR_CUSTOM) - CORO_INVOKE_2(m_nCurCustomPointer->Draw, bigBuf, prim); + CORO_INVOKE_2(m_nCurCustomPointer->draw, bigBuf, prim); else // Call the draw on the special pointer - CORO_INVOKE_2(m_specialPointer[m_nCurSpecialPointer - 1]->Draw, bigBuf, prim); + CORO_INVOKE_2(m_specialPointer[m_nCurSpecialPointer - 1]->draw, bigBuf, prim); } } @@ -1564,7 +1562,7 @@ void RMPointer::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim void RMPointer::DoFrame(RMGfxTargetBuffer *bigBuf) { // Add it to the list of primitives - bigBuf->AddPrim(new RMGfxPrimitive(this)); + bigBuf->addPrim(new RMGfxPrimitive(this)); // If there is a special pointer, does DoFrame if (m_nCurSpecialPointer != 0 && m_nCurSpecialPointer != PTR_CUSTOM) diff --git a/engines/tony/game.h b/engines/tony/game.h index c920b88ee5..d42a3805c8 100644 --- a/engines/tony/game.h +++ b/engines/tony/game.h @@ -42,7 +42,7 @@ namespace Tony { assert(raw->IsValid()); \ assert((buf16) == NULL); \ (buf16) = new RMGfxSourceBuffer16(false); \ - (buf16)->Init(*raw,raw->Width(),raw->Height()); \ + (buf16)->init(*raw,raw->Width(),raw->Height()); \ delete raw; #define INIT_GFX8_FROMRAW(raw, dwRes, buf8) \ @@ -50,7 +50,7 @@ namespace Tony { assert(raw->IsValid()); \ assert((buf8) == NULL); \ (buf8) = new RMGfxSourceBuffer8RLEByte(); \ - (buf8)->Init(*raw, raw->Width(), raw->Height(), true); \ + (buf8)->init(*raw, raw->Width(), raw->Height(), true); \ delete raw; @@ -96,7 +96,7 @@ public: int Priority(); // Overloading draw method - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // Sets the current co-ordinates void SetCoord(const RMPoint &pt) { @@ -144,7 +144,7 @@ public: virtual ~RMOptionButton(); bool DoFrame(const RMPoint &mousePos, bool bLeftClick, bool bRightClick); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); void AddToList(RMGfxTargetBuffer &bigBuf); bool IsActive() { return m_bActive; @@ -173,7 +173,7 @@ public: virtual ~RMOptionSlide(); bool DoFrame(const RMPoint &mousePos, bool bLeftClick, bool bRightClick); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); void AddToList(RMGfxTargetBuffer &bigBuf); int GetValue() { @@ -273,7 +273,7 @@ public: // Overloaded methods virtual int Priority(); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); virtual void RemoveThis(CORO_PARAM, bool &result); // Polling for the option screen diff --git a/engines/tony/gfxcore.cpp b/engines/tony/gfxcore.cpp index be59a2d9a5..2076e2af47 100644 --- a/engines/tony/gfxcore.cpp +++ b/engines/tony/gfxcore.cpp @@ -37,15 +37,15 @@ namespace Tony { \****************************************************************************/ RMGfxTask::RMGfxTask() { - m_nPrior = 0; - m_nInList = 0; + _nPrior = 0; + _nInList = 0; } -int RMGfxTask::Priority() { - return m_nPrior; +int RMGfxTask::priority() { + return _nPrior; } -void RMGfxTask::RemoveThis(CORO_PARAM, bool &result) { +void RMGfxTask::removeThis(CORO_PARAM, bool &result) { result = true; } @@ -54,8 +54,8 @@ void RMGfxTask::RemoveThis(CORO_PARAM, bool &result) { * RMGfxTaskSetPrior Methods \****************************************************************************/ -void RMGfxTaskSetPrior::SetPriority(int nPrior) { - m_nPrior = nPrior; +void RMGfxTaskSetPrior::setPriority(int nPrior) { + _nPrior = nPrior; } @@ -64,111 +64,111 @@ void RMGfxTaskSetPrior::SetPriority(int nPrior) { \****************************************************************************/ RMGfxBuffer::RMGfxBuffer() { - m_dimx = m_dimy = 0; - m_bUseDDraw = false; - m_origBuf = m_buf = NULL; + _dimx = _dimy = 0; + _bUseDDraw = false; + _origBuf = _buf = NULL; } RMGfxBuffer::~RMGfxBuffer() { - Destroy(); + destroy(); } -void RMGfxBuffer::Create(int dimx, int dimy, int nBpp, bool bUseDDraw) { +void RMGfxBuffer::create(int dimx, int dimy, int nBpp, bool bUseDDraw) { // Destroy the buffer it is already exists - if (m_buf != NULL) - Destroy(); + if (_buf != NULL) + destroy(); // Copy the parameters in the private members - m_dimx = dimx; - m_dimy = dimy; - m_bUseDDraw = bUseDDraw; + _dimx = dimx; + _dimy = dimy; + _bUseDDraw = bUseDDraw; - if (!m_bUseDDraw) { + if (!_bUseDDraw) { // Allocate a buffer - m_origBuf = m_buf = new byte[m_dimx * m_dimy * nBpp / 8]; - assert(m_buf != NULL); - Common::fill(m_origBuf, m_origBuf + m_dimx * m_dimy * nBpp / 8, 0); + _origBuf = _buf = new byte[_dimx * _dimy * nBpp / 8]; + assert(_buf != NULL); + Common::fill(_origBuf, _origBuf + _dimx * _dimy * nBpp / 8, 0); } } -void RMGfxBuffer::Destroy(void) { - if (!m_bUseDDraw) { - if (m_origBuf != NULL && m_origBuf == m_buf) { - delete[] m_origBuf; - m_origBuf = m_buf = NULL; +void RMGfxBuffer::destroy(void) { + if (!_bUseDDraw) { + if (_origBuf != NULL && _origBuf == _buf) { + delete[] _origBuf; + _origBuf = _buf = NULL; } } } -void RMGfxBuffer::Lock(void) { - if (m_bUseDDraw) { +void RMGfxBuffer::lock(void) { + if (_bUseDDraw) { // Manages acceleration } } -void RMGfxBuffer::Unlock(void) { - if (m_bUseDDraw) { +void RMGfxBuffer::unlock(void) { + if (_bUseDDraw) { // Manages acceleration } } -void RMGfxBuffer::OffsetY(int nLines, int nBpp) { - m_buf += nLines * Dimx() * nBpp / 8; +void RMGfxBuffer::offsetY(int nLines, int nBpp) { + _buf += nLines * getDimx() * nBpp / 8; } RMGfxBuffer::operator byte *() { - return m_buf; + return _buf; } RMGfxBuffer::operator void *() { - return (void *)m_buf; + return (void *)_buf; } RMGfxBuffer::RMGfxBuffer(int dimx, int dimy, int nBpp, bool bUseDDraw) { - Create(dimx, dimy, nBpp, bUseDDraw); + create(dimx, dimy, nBpp, bUseDDraw); } /****************************************************************************\ * RMGfxSourceBuffer Methods \****************************************************************************/ -int RMGfxSourceBuffer::Init(const byte *buf, int dimx, int dimy, bool bLoadPalette) { - Create(dimx, dimy, Bpp()); - CopyMemory(m_buf, buf, dimx * dimy * Bpp() / 8); +int RMGfxSourceBuffer::init(const byte *buf, int dimx, int dimy, bool bLoadPalette) { + create(dimx, dimy, Bpp()); + CopyMemory(_buf, buf, dimx * dimy * Bpp() / 8); // Invokes the method for preparing the surface (inherited) - PrepareImage(); + prepareImage(); return dimx * dimy * Bpp() / 8; } -void RMGfxSourceBuffer::Init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) { - Create(dimx, dimy, Bpp()); - ds.Read(m_buf, dimx * dimy * Bpp() / 8); +void RMGfxSourceBuffer::init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) { + create(dimx, dimy, Bpp()); + ds.Read(_buf, dimx * dimy * Bpp() / 8); // Invokes the method for preparing the surface (inherited) - PrepareImage(); + prepareImage(); } RMGfxSourceBuffer::~RMGfxSourceBuffer() { } -void RMGfxSourceBuffer::PrepareImage(void) { +void RMGfxSourceBuffer::prepareImage(void) { // Do nothing. Can be overloaded if necessary } -bool RMGfxSourceBuffer::Clip2D(int &x1, int &y1, int &u, int &v, int &width, int &height, bool bUseSrc, RMGfxTargetBuffer *buf) { +bool RMGfxSourceBuffer::clip2D(int &x1, int &y1, int &u, int &v, int &width, int &height, bool bUseSrc, RMGfxTargetBuffer *buf) { int destw, desth; - destw = buf->Dimx(); - desth = buf->Dimy(); + destw = buf->getDimx(); + desth = buf->getDimy(); if (!bUseSrc) { u = v = 0; - width = m_dimx; - height = m_dimy; + width = _dimx; + height = _dimy; } if (x1 > destw - 1) @@ -210,8 +210,8 @@ bool RMGfxSourceBuffer::Clip2D(int &x1, int &y1, int &u, int &v, int &width, int * @param dimx Buffer X dimension * @param dimy Buffer Y dimension */ -int RMGfxSourceBuffer::Init(uint32 resID, int dimx, int dimy, bool bLoadPalette) { - return Init(RMRes(resID), dimx, dimy, bLoadPalette); +int RMGfxSourceBuffer::init(uint32 resID, int dimx, int dimy, bool bLoadPalette) { + return init(RMRes(resID), dimx, dimy, bLoadPalette); } /****************************************************************************\ @@ -222,17 +222,17 @@ RMGfxWoodyBuffer::~RMGfxWoodyBuffer() { } -void RMGfxWoodyBuffer::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMGfxWoodyBuffer::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); // Draw the OT list - CORO_INVOKE_0(DrawOT); + CORO_INVOKE_0(drawOT); // Draw itself into the target buffer - CORO_INVOKE_2(RMGfxSourceBuffer16::Draw, bigBuf, prim); + CORO_INVOKE_2(RMGfxSourceBuffer16::draw, bigBuf, prim); CORO_END_CODE; } @@ -255,16 +255,16 @@ RMGfxClearTask RMGfxTargetBuffer::taskClear; RMGfxTargetBuffer::RMGfxTargetBuffer() { otlist = NULL; - m_otSize = 0; + _otSize = 0; // csModifyingOT = g_system->createMutex(); } RMGfxTargetBuffer::~RMGfxTargetBuffer() { - ClearOT(); + clearOT(); // g_system->deleteMutex(csModifyingOT); } -void RMGfxTargetBuffer::ClearOT(void) { +void RMGfxTargetBuffer::clearOT(void) { OTList *cur, *n; // g_system->lockMutex(csModifyingOT); @@ -272,7 +272,7 @@ void RMGfxTargetBuffer::ClearOT(void) { cur = otlist; while (cur != NULL) { - cur->prim->m_task->Unregister(); + cur->prim->_task->Unregister(); delete cur->prim; n = cur->next; delete cur; @@ -284,7 +284,7 @@ void RMGfxTargetBuffer::ClearOT(void) { // g_system->unlockMutex(csModifyingOT); } -void RMGfxTargetBuffer::DrawOT(CORO_PARAM) { +void RMGfxTargetBuffer::drawOT(CORO_PARAM) { CORO_BEGIN_CONTEXT; OTList *cur; OTList *prev; @@ -299,20 +299,20 @@ void RMGfxTargetBuffer::DrawOT(CORO_PARAM) { _ctx->cur = otlist; // Lock the buffer to access it - Lock(); + lock(); // g_system->lockMutex(csModifyingOT); while (_ctx->cur != NULL) { // Call the task Draw method, passing it a copy of the original - _ctx->myprim = _ctx->cur->prim->Duplicate(); - CORO_INVOKE_2(_ctx->cur->prim->m_task->Draw, *this, _ctx->myprim); + _ctx->myprim = _ctx->cur->prim->duplicate(); + CORO_INVOKE_2(_ctx->cur->prim->_task->draw, *this, _ctx->myprim); delete _ctx->myprim; // Check if it's time to remove the task from the OT list - CORO_INVOKE_1(_ctx->cur->prim->m_task->RemoveThis, _ctx->result); + CORO_INVOKE_1(_ctx->cur->prim->_task->removeThis, _ctx->result); if (_ctx->result) { // De-register the task - _ctx->cur->prim->m_task->Unregister(); + _ctx->cur->prim->_task->Unregister(); // Delete task, freeing the memory delete _ctx->cur->prim; @@ -337,22 +337,22 @@ void RMGfxTargetBuffer::DrawOT(CORO_PARAM) { // g_system->unlockMutex(csModifyingOT); //Unlock after writing - Unlock(); + unlock(); CORO_END_CODE; } -void RMGfxTargetBuffer::AddPrim(RMGfxPrimitive *prim) { +void RMGfxTargetBuffer::addPrim(RMGfxPrimitive *prim) { int nPrior; OTList *cur, *n; // g_system->lockMutex(csModifyingOT); // Warn of the OT listing - prim->m_task->Register(); + prim->_task->Register(); // Check the priority - nPrior = prim->m_task->Priority(); + nPrior = prim->_task->priority(); n = new OTList(prim); // Empty list @@ -361,12 +361,12 @@ void RMGfxTargetBuffer::AddPrim(RMGfxPrimitive *prim) { otlist->next = NULL; } // Inclusion in the head - else if (nPrior < otlist->prim->m_task->Priority()) { + else if (nPrior < otlist->prim->_task->priority()) { n->next = otlist; otlist = n; } else { cur = otlist; - while (cur->next != NULL && nPrior > cur->next->prim->m_task->Priority()) + while (cur->next != NULL && nPrior > cur->next->prim->_task->priority()) cur = cur->next; n->next = cur->next; @@ -376,8 +376,8 @@ void RMGfxTargetBuffer::AddPrim(RMGfxPrimitive *prim) { // g_system->unlockMutex(csModifyingOT); } -void RMGfxTargetBuffer::AddClearTask(void) { - AddPrim(new RMGfxPrimitive(&taskClear)); +void RMGfxTargetBuffer::addClearTask(void) { + addPrim(new RMGfxPrimitive(&taskClear)); } @@ -389,89 +389,89 @@ RMGfxSourceBufferPal::~RMGfxSourceBufferPal() { } -int RMGfxSourceBufferPal::LoadPaletteWA(const byte *buf, bool bSwapped) { +int RMGfxSourceBufferPal::loadPaletteWA(const byte *buf, bool bSwapped) { int i; if (bSwapped) for (i = 0; i < (1 << Bpp()); i++) { - m_pal[i * 3 + 0] = buf[i * 3 + 2]; - m_pal[i * 3 + 1] = buf[i * 3 + 1]; - m_pal[i * 3 + 2] = buf[i * 3 + 0]; + _pal[i * 3 + 0] = buf[i * 3 + 2]; + _pal[i * 3 + 1] = buf[i * 3 + 1]; + _pal[i * 3 + 2] = buf[i * 3 + 0]; } else - CopyMemory(m_pal, buf, (1 << Bpp()) * 3); + CopyMemory(_pal, buf, (1 << Bpp()) * 3); - PreparePalette(); + preparePalette(); return (1 << Bpp()) * 3; } -int RMGfxSourceBufferPal::LoadPalette(const byte *buf) { +int RMGfxSourceBufferPal::loadPalette(const byte *buf) { int i; for (i = 0; i < 256; i++) - CopyMemory(m_pal + i * 3, buf + i * 4, 3); + CopyMemory(_pal + i * 3, buf + i * 4, 3); - PreparePalette(); + preparePalette(); return (1 << Bpp()) * 4; } -void RMGfxSourceBufferPal::PreparePalette(void) { +void RMGfxSourceBufferPal::preparePalette(void) { int i; for (i = 0; i < 256; i++) { - m_palFinal[i] = (((int)m_pal[i * 3 + 0] >> 3) << 10) | - (((int)m_pal[i * 3 + 1] >> 3) << 5) | - (((int)m_pal[i * 3 + 2] >> 3) << 0); + _palFinal[i] = (((int)_pal[i * 3 + 0] >> 3) << 10) | + (((int)_pal[i * 3 + 1] >> 3) << 5) | + (((int)_pal[i * 3 + 2] >> 3) << 0); } } -int RMGfxSourceBufferPal::Init(const byte *buf, int dimx, int dimy, bool bLoadPalette) { +int RMGfxSourceBufferPal::init(const byte *buf, int dimx, int dimy, bool bLoadPalette) { int read; // Load the RAW image - read = RMGfxSourceBuffer::Init(buf, dimx, dimy); + read = RMGfxSourceBuffer::init(buf, dimx, dimy); // Load the palette if necessary if (bLoadPalette) - read += LoadPaletteWA(&buf[read]); + read += loadPaletteWA(&buf[read]); return read; } -void RMGfxSourceBufferPal::Init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) { +void RMGfxSourceBufferPal::init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) { // Load the RAW image - RMGfxSourceBuffer::Init(ds, dimx, dimy); + RMGfxSourceBuffer::init(ds, dimx, dimy); // Load the palette if necessary if (bLoadPalette) { byte *suxpal = new byte[256 * 3]; ds.Read(suxpal, 256 * 3); - LoadPaletteWA(suxpal); + loadPaletteWA(suxpal); delete[] suxpal; } } -int RMGfxSourceBufferPal::LoadPalette(uint32 resID) { - return LoadPalette(RMRes(resID)); +int RMGfxSourceBufferPal::loadPalette(uint32 resID) { + return loadPalette(RMRes(resID)); } -int RMGfxSourceBufferPal::LoadPaletteWA(uint32 resID, bool bSwapped) { - return LoadPaletteWA(RMRes(resID), bSwapped); +int RMGfxSourceBufferPal::loadPaletteWA(uint32 resID, bool bSwapped) { + return loadPaletteWA(RMRes(resID), bSwapped); } /****************************************************************************\ * RMGfxSourceBuffer4 Methods \****************************************************************************/ -void RMGfxSourceBuffer4::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMGfxSourceBuffer4::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { } RMGfxSourceBuffer4::RMGfxSourceBuffer4(int dimx, int dimy, bool bUseDDraw) : RMGfxBuffer(dimx, dimy, 4, bUseDDraw) { - SetPriority(0); + setPriority(0); } @@ -485,7 +485,7 @@ int RMGfxSourceBuffer4::Bpp() { } void RMGfxSourceBuffer4::Create(int dimx, int dimy, bool bUseDDraw) { - RMGfxBuffer::Create(dimx, dimy, 4, bUseDDraw); + RMGfxBuffer::create(dimx, dimy, 4, bUseDDraw); } /****************************************************************************\ @@ -496,19 +496,19 @@ RMGfxSourceBuffer8::~RMGfxSourceBuffer8() { } -void RMGfxSourceBuffer8::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMGfxSourceBuffer8::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { int x, y, width, height, u, v; - int bufx = bigBuf.Dimx(); + int bufx = bigBuf.getDimx(); uint16 *buf = bigBuf; - byte *raw = m_buf; + byte *raw = _buf; // Destination buffer RMRect dst; - if (prim->HaveDst()) + if (prim->haveDst()) dst = prim->Dst(); // Clipping - if (prim->HaveSrc()) { + if (prim->haveSrc()) { u = prim->Src().x1; v = prim->Src().y1; @@ -516,19 +516,20 @@ void RMGfxSourceBuffer8::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimit height = prim->Src().Height(); } - if (!Clip2D(dst.x1, dst.y1, u, v, width, height, prim->HaveSrc(), &bigBuf)) + if (!clip2D(dst.x1, dst.y1, u, v, width, height, prim->haveSrc(), &bigBuf)) return; // Starting offset into the buffer buf += dst.y1 * bufx + dst.x1; // Normal step - if (m_bTrasp0) { + if (_bTrasp0) { for (y = 0; y < height; y++) { - raw = m_buf + (y + v) * m_dimx + u; + raw = _buf + (y + v) * _dimx + u; for (x = 0; x < width; x++) { - if (*raw) *buf = m_palFinal[*raw]; + if (*raw) + *buf = _palFinal[*raw]; buf++; raw++; } @@ -537,11 +538,11 @@ void RMGfxSourceBuffer8::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimit } } else { for (y = 0; y < height; y++) { - raw = m_buf + (y + v) * m_dimx + u; + raw = _buf + (y + v) * _dimx + u; for (x = 0; x < width; x += 2) { - buf[0] = m_palFinal[raw[0]]; - buf[1] = m_palFinal[raw[1]]; + buf[0] = _palFinal[raw[0]]; + buf[1] = _palFinal[raw[1]]; buf += 2; raw += 2; @@ -554,11 +555,11 @@ void RMGfxSourceBuffer8::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimit RMGfxSourceBuffer8::RMGfxSourceBuffer8(int dimx, int dimy, bool bUseDDraw) : RMGfxBuffer(dimx, dimy, 8, bUseDDraw) { - SetPriority(0); + setPriority(0); } RMGfxSourceBuffer8::RMGfxSourceBuffer8(bool bTrasp0) { - m_bTrasp0 = bTrasp0; + _bTrasp0 = bTrasp0; } @@ -571,8 +572,8 @@ int RMGfxSourceBuffer8::Bpp() { return 8; } -void RMGfxSourceBuffer8::Create(int dimx, int dimy, bool bUseDDraw) { - RMGfxBuffer::Create(dimx, dimy, 8, bUseDDraw); +void RMGfxSourceBuffer8::create(int dimx, int dimy, bool bUseDDraw) { + RMGfxBuffer::create(dimx, dimy, 8, bUseDDraw); } #define GETRED(x) (((x) >> 10) & 0x1F) @@ -588,7 +589,7 @@ RMGfxSourceBuffer8AB::~RMGfxSourceBuffer8AB() { } -int RMGfxSourceBuffer8AB::CalcTrasp(int fore, int back) { +int RMGfxSourceBuffer8AB::calcTrasp(int fore, int back) { int r, g, b; r = (GETRED(fore) >> 2) + (GETRED(back) >> 1); @@ -603,19 +604,19 @@ int RMGfxSourceBuffer8AB::CalcTrasp(int fore, int back) { } -void RMGfxSourceBuffer8AB::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMGfxSourceBuffer8AB::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { int x, y, width, height, u, v; - int bufx = bigBuf.Dimx(); + int bufx = bigBuf.getDimx(); uint16 *buf = bigBuf; - byte *raw = m_buf; + byte *raw = _buf; // Destination buffer RMRect dst; - if (prim->HaveDst()) + if (prim->haveDst()) dst = prim->Dst(); // Clipping - if (prim->HaveSrc()) { + if (prim->haveSrc()) { u = prim->Src().x1; v = prim->Src().y1; @@ -623,19 +624,21 @@ void RMGfxSourceBuffer8AB::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrim height = prim->Src().Height(); } - if (!Clip2D(dst.x1, dst.y1, u, v, width, height, prim->HaveSrc(), &bigBuf)) + if (!clip2D(dst.x1, dst.y1, u, v, width, height, prim->haveSrc(), &bigBuf)) return; // Starting offset into the buffer buf += dst.y1 * bufx + dst.x1; // Passaggio normale - if (m_bTrasp0) { + if (_bTrasp0) { for (y = 0; y < height; y++) { - raw = m_buf + (y + v) * m_dimx + u; + raw = _buf + (y + v) * _dimx + u; for (x = 0; x < width; x++) { - if (*raw) *buf = CalcTrasp(m_palFinal[*raw], *buf); + if (*raw) + *buf = calcTrasp(_palFinal[*raw], *buf); + buf++; raw++; } @@ -644,11 +647,11 @@ void RMGfxSourceBuffer8AB::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrim } } else { for (y = 0; y < height; y++) { - raw = m_buf + (y + v) * m_dimx + u; + raw = _buf + (y + v) * _dimx + u; for (x = 0; x < width; x += 2) { - buf[0] = CalcTrasp(m_palFinal[raw[0]], buf[0]); - buf[1] = CalcTrasp(m_palFinal[raw[1]], buf[1]); + buf[0] = calcTrasp(_palFinal[raw[0]], buf[0]); + buf[1] = calcTrasp(_palFinal[raw[1]], buf[1]); buf += 2; raw += 2; @@ -669,69 +672,69 @@ void RMGfxSourceBuffer8AB::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrim byte RMGfxSourceBuffer8RLE::MegaRLEBuf[512 * 1024]; -void RMGfxSourceBuffer8RLE::SetAlphaBlendColor(int color) { +void RMGfxSourceBuffer8RLE::setAlphaBlendColor(int color) { alphaBlendColor = color; } RMGfxSourceBuffer8RLE::RMGfxSourceBuffer8RLE() { alphaBlendColor = -1; bNeedRLECompress = true; - m_buf = NULL; + _buf = NULL; } RMGfxSourceBuffer8RLE::~RMGfxSourceBuffer8RLE() { - if (m_buf != NULL) { - delete[] m_buf; - m_buf = NULL; + if (_buf != NULL) { + delete[] _buf; + _buf = NULL; } } -int RMGfxSourceBuffer8RLE::Init(const byte *buf, int dimx, int dimy, bool bLoadPalette) { - return RMGfxSourceBufferPal::Init(buf, dimx, dimy, bLoadPalette); +int RMGfxSourceBuffer8RLE::init(const byte *buf, int dimx, int dimy, bool bLoadPalette) { + return RMGfxSourceBufferPal::init(buf, dimx, dimy, bLoadPalette); } -void RMGfxSourceBuffer8RLE::Init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) { +void RMGfxSourceBuffer8RLE::init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) { if (bNeedRLECompress) { - RMGfxSourceBufferPal::Init(ds, dimx, dimy, bLoadPalette); + RMGfxSourceBufferPal::init(ds, dimx, dimy, bLoadPalette); } else { int size; ds >> size; - m_buf = new byte[size]; - ds.Read(m_buf, size); + _buf = new byte[size]; + ds.Read(_buf, size); - m_dimx = dimx; - m_dimy = dimy; + _dimx = dimx; + _dimy = dimy; } } -void RMGfxSourceBuffer8RLE::PreparePalette(void) { +void RMGfxSourceBuffer8RLE::preparePalette(void) { // Invoke the parent method - RMGfxSourceBuffer8::PreparePalette(); + RMGfxSourceBuffer8::preparePalette(); // Handle RGB alpha blending if (alphaBlendColor != -1) { - alphaR = (m_palFinal[alphaBlendColor] >> 10) & 0x1F; - alphaG = (m_palFinal[alphaBlendColor] >> 5) & 0x1F; - alphaB = (m_palFinal[alphaBlendColor]) & 0x1F; + alphaR = (_palFinal[alphaBlendColor] >> 10) & 0x1F; + alphaG = (_palFinal[alphaBlendColor] >> 5) & 0x1F; + alphaB = (_palFinal[alphaBlendColor]) & 0x1F; } } -void RMGfxSourceBuffer8RLE::PrepareImage(void) { +void RMGfxSourceBuffer8RLE::prepareImage(void) { // Invoke the parent method - RMGfxSourceBuffer::PrepareImage(); + RMGfxSourceBuffer::prepareImage(); // Compress - CompressRLE(); + compressRLE(); } -void RMGfxSourceBuffer8RLE::SetAlreadyCompressed(void) { +void RMGfxSourceBuffer8RLE::setAlreadyCompressed(void) { bNeedRLECompress = false; } -void RMGfxSourceBuffer8RLE::CompressRLE(void) { +void RMGfxSourceBuffer8RLE::compressRLE(void) { int x, y; byte *startline; byte *cur; @@ -742,8 +745,8 @@ void RMGfxSourceBuffer8RLE::CompressRLE(void) { // Perform RLE compression for lines cur = MegaRLEBuf; - src = m_buf; - for (y = 0; y < m_dimy; y++) { + src = _buf; + for (y = 0; y < _dimy; y++) { // Save the beginning of the line startline = cur; @@ -754,7 +757,7 @@ void RMGfxSourceBuffer8RLE::CompressRLE(void) { curdata = 0; rep = 0; startsrc = src; - for (x = 0; x < m_dimx;) { + for (x = 0; x < _dimx;) { if ((curdata == 0 && *src == 0) || (curdata == 1 && *src == alphaBlendColor) || (curdata == 2 && (*src != alphaBlendColor && *src != 0))) { src++; @@ -795,15 +798,15 @@ void RMGfxSourceBuffer8RLE::CompressRLE(void) { } // Delete the original image - delete[] m_buf; + delete[] _buf; // Copy the compressed image x = cur - MegaRLEBuf; - m_buf = new byte[x]; - Common::copy(MegaRLEBuf, MegaRLEBuf + x, m_buf); + _buf = new byte[x]; + Common::copy(MegaRLEBuf, MegaRLEBuf + x, _buf); } -void RMGfxSourceBuffer8RLE::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMGfxSourceBuffer8RLE::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { int y; byte *src; uint16 *buf = bigBuf; @@ -812,26 +815,26 @@ void RMGfxSourceBuffer8RLE::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPri // Clipping x1 = prim->Dst().x1; y1 = prim->Dst().y1; - if (!Clip2D(x1, y1, u, v, width, height, false, &bigBuf)) + if (!clip2D(x1, y1, u, v, width, height, false, &bigBuf)) return; // Go forward through the RLE lines - src = m_buf; + src = _buf; for (y = 0; y < v; y++) src += READ_LE_UINT16(src); // Calculate the position in the destination buffer - buf += y1 * bigBuf.Dimx(); + buf += y1 * bigBuf.getDimx(); // Loop - if (prim->IsFlipped()) { + if (prim->isFlipped()) { // Eliminate horizontal clipping // width = m_dimx; // x1=prim->Dst().x1; // Clipping - u = m_dimx - (width + u); - x1 = (prim->Dst().x1 + m_dimx - 1) - u; + u = _dimx - (width + u); + x1 = (prim->Dst().x1 + _dimx - 1) - u; for (y = 0; y < height; y++) { // Decompressione @@ -841,7 +844,7 @@ void RMGfxSourceBuffer8RLE::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPri src += READ_LE_UINT16(src); // Skip to the next line - buf += bigBuf.Dimx(); + buf += bigBuf.getDimx(); } } else { for (y = 0; y < height; y++) { @@ -852,7 +855,7 @@ void RMGfxSourceBuffer8RLE::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPri src += READ_LE_UINT16(src); // Skip to the next line - buf += bigBuf.Dimx(); + buf += bigBuf.getDimx(); } } } @@ -990,7 +993,7 @@ RLEByteDoCopy2: n = nLength; for (i = 0; i < n; i++) - *dst ++ = m_palFinal[*src++]; + *dst ++ = _palFinal[*src++]; nLength -= n; if (!nLength) @@ -1096,7 +1099,7 @@ RLEByteFlippedDoCopy2: n = nLength; for (i = 0; i < n; i++) - *dst -- = m_palFinal[*src++]; + *dst-- = _palFinal[*src++]; nLength -= n; if (!nLength) @@ -1247,7 +1250,7 @@ RLEWordDoCopy2: n = nLength; for (i = 0; i < n; i++) - *dst ++ = m_palFinal[*src++]; + *dst++ = _palFinal[*src++]; nLength -= n; if (!nLength) @@ -1365,7 +1368,7 @@ RLEWordFlippedDoCopy2: n = nLength; for (i = 0; i < n; i++) - *dst -- = m_palFinal[*src++]; + *dst-- = _palFinal[*src++]; nLength -= n; if (!nLength) @@ -1500,9 +1503,9 @@ RLEWordDoCopy2: g = (*dst >> 5) & 0x1F; b = *dst & 0x1F; - r2 = (m_palFinal[*src] >> 10) & 0x1F; - g2 = (m_palFinal[*src] >> 5) & 0x1F; - b2 = m_palFinal[*src] & 0x1F; + r2 = (_palFinal[*src] >> 10) & 0x1F; + g2 = (_palFinal[*src] >> 5) & 0x1F; + b2 = _palFinal[*src] & 0x1F; r = (r >> 1) + (r2 >> 1); g = (g >> 1) + (g2 >> 1); @@ -1529,16 +1532,16 @@ RLEWordDoCopy2: byte RMGfxSourceBuffer8AA::MegaAABuf[256 * 1024]; byte RMGfxSourceBuffer8AA::MegaAABuf2[64 * 1024]; -void RMGfxSourceBuffer8AA::PrepareImage(void) { +void RMGfxSourceBuffer8AA::prepareImage(void) { // Invoke the parent method - RMGfxSourceBuffer::PrepareImage(); + RMGfxSourceBuffer::prepareImage(); // Prepare the buffer for anti-aliasing - CalculateAA(); + calculateAA(); } -void RMGfxSourceBuffer8AA::CalculateAA(void) { +void RMGfxSourceBuffer8AA::calculateAA(void) { // I suck, you suck, he sucks, we suck, they all suck ---> ANTI ALIASING SUX! // ************************************************************ @@ -1546,17 +1549,17 @@ void RMGfxSourceBuffer8AA::CalculateAA(void) { byte *src, *srcaa; /* First pass: fill the edges */ - Common::fill(MegaAABuf, MegaAABuf + m_dimx * m_dimy, 0); + Common::fill(MegaAABuf, MegaAABuf + _dimx * _dimy, 0); - src = m_buf; + src = _buf; srcaa = MegaAABuf; - for (y = 0; y < m_dimy; y++) { - for (x = 0; x < m_dimx; x++) { + for (y = 0; y < _dimy; y++) { + for (x = 0; x < _dimx; x++) { if (*src == 0) { - if ((y > 0 && src[-m_dimx] != 0) || - (y < m_dimy - 1 && src[m_dimx] != 0) || + if ((y > 0 && src[-_dimx] != 0) || + (y < _dimy - 1 && src[_dimx] != 0) || (x > 0 && src[-1] != 0) || - (x < m_dimx - 1 && src[1] != 0)) + (x < _dimx - 1 && src[1] != 0)) *srcaa = 1; } @@ -1565,15 +1568,15 @@ void RMGfxSourceBuffer8AA::CalculateAA(void) { } } - src = m_buf; + src = _buf; srcaa = MegaAABuf; - for (y = 0; y < m_dimy; y++) { - for (x = 0; x < m_dimx; x++) { + for (y = 0; y < _dimy; y++) { + for (x = 0; x < _dimx; x++) { if (*src != 0) { - if ((y > 0 && srcaa[-m_dimx] == 1) || - (y < m_dimy - 1 && srcaa[m_dimx] == 1) || + if ((y > 0 && srcaa[-_dimx] == 1) || + (y < _dimy - 1 && srcaa[_dimx] == 1) || (x > 0 && srcaa[-1] == 1) || - (x < m_dimx - 1 && srcaa[1] == 1)) + (x < _dimx - 1 && srcaa[1] == 1)) *srcaa = 2; } @@ -1582,23 +1585,23 @@ void RMGfxSourceBuffer8AA::CalculateAA(void) { } } - if (m_aabuf != NULL) - delete[] m_aabuf; + if (_aabuf != NULL) + delete[] _aabuf; - m_aabuf = new byte[m_dimx * m_dimy]; - CopyMemory(m_aabuf, MegaAABuf, m_dimx * m_dimy); + _aabuf = new byte[_dimx * _dimy]; + CopyMemory(_aabuf, MegaAABuf, _dimx * _dimy); } RMGfxSourceBuffer8AA::RMGfxSourceBuffer8AA() : RMGfxSourceBuffer8() { - m_aabuf = NULL; + _aabuf = NULL; } RMGfxSourceBuffer8AA::~RMGfxSourceBuffer8AA() { - if (m_aabuf != NULL) - delete[] m_aabuf; + if (_aabuf != NULL) + delete[] _aabuf; } -void RMGfxSourceBuffer8AA::DrawAA(RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMGfxSourceBuffer8AA::drawAA(RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { int x, y; byte *src; uint16 *mybuf; @@ -1610,35 +1613,35 @@ void RMGfxSourceBuffer8AA::DrawAA(RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pri // Clip the sprite x1 = prim->Dst().x1; y1 = prim->Dst().y1; - if (!Clip2D(x1, y1, u, v, width, height, false, &bigBuf)) + if (!clip2D(x1, y1, u, v, width, height, false, &bigBuf)) return; // Go forward through the RLE lines - src = m_buf; + src = _buf; for (y = 0; y < v; y++) src += READ_LE_UINT16(src); // Eliminate horizontal clipping - if (prim->IsFlipped()) { - u = m_dimx - (width + u); - x1 = (prim->Dst().x1 + m_dimx - 1) - u; + if (prim->isFlipped()) { + u = _dimx - (width + u); + x1 = (prim->Dst().x1 + _dimx - 1) - u; } -// width = m_dimx; -// x1=prim->Dst().x1; +// width = _dimx; +// x1 = prim->Dst().x1; // Poisition into the destination buffer buf = bigBuf; - buf += y1 * bigBuf.Dimx(); + buf += y1 * bigBuf.getDimx(); - if (prim->IsFlipped()) + if (prim->isFlipped()) step = -1; else step = 1; // Loop - buf += bigBuf.Dimx(); // Skip the first line + buf += bigBuf.getDimx(); // Skip the first line for (y = 1; y < height - 1; y++) { /* if (prim->IsFlipped()) @@ -1648,10 +1651,10 @@ void RMGfxSourceBuffer8AA::DrawAA(RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pri mybuf = &buf[x1]; for (x = 0; x < width; x++, mybuf += step) - if (m_aabuf[(y + v) * m_dimx + x + u] == 2 && x != 0 && x != width - 1) { - r = GETRED(mybuf[1]) + GETRED(mybuf[-1]) + GETRED(mybuf[-bigBuf.Dimx()]) + GETRED(mybuf[bigBuf.Dimx()]); - g = GETGREEN(mybuf[1]) + GETGREEN(mybuf[-1]) + GETGREEN(mybuf[-bigBuf.Dimx()]) + GETGREEN(mybuf[bigBuf.Dimx()]); - b = GETBLUE(mybuf[1]) + GETBLUE(mybuf[-1]) + GETBLUE(mybuf[-bigBuf.Dimx()]) + GETBLUE(mybuf[bigBuf.Dimx()]); + if (_aabuf[(y + v) * _dimx + x + u] == 2 && x != 0 && x != width - 1) { + r = GETRED(mybuf[1]) + GETRED(mybuf[-1]) + GETRED(mybuf[-bigBuf.getDimx()]) + GETRED(mybuf[bigBuf.getDimx()]); + g = GETGREEN(mybuf[1]) + GETGREEN(mybuf[-1]) + GETGREEN(mybuf[-bigBuf.getDimx()]) + GETGREEN(mybuf[bigBuf.getDimx()]); + b = GETBLUE(mybuf[1]) + GETBLUE(mybuf[-1]) + GETBLUE(mybuf[-bigBuf.getDimx()]) + GETBLUE(mybuf[bigBuf.getDimx()]); r += GETRED(mybuf[0]); g += GETGREEN(mybuf[0]); @@ -1669,15 +1672,15 @@ void RMGfxSourceBuffer8AA::DrawAA(RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pri } // Skip to the next line - buf += bigBuf.Dimx(); + buf += bigBuf.getDimx(); } // Position into the destination buffer buf = bigBuf; - buf += y1 * bigBuf.Dimx(); + buf += y1 * bigBuf.getDimx(); // Looppone - buf += bigBuf.Dimx(); + buf += bigBuf.getDimx(); for (y = 1; y < height - 1; y++) { /* if (prim->IsFlipped()) @@ -1687,10 +1690,10 @@ void RMGfxSourceBuffer8AA::DrawAA(RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pri mybuf = &buf[x1]; for (x = 0; x < width; x++, mybuf += step) - if (m_aabuf[(y + v) * m_dimx + x + u] == 1 && x != 0 && x != width - 1) { - r = GETRED(mybuf[1]) + GETRED(mybuf[-1]) + GETRED(mybuf[-bigBuf.Dimx()]) + GETRED(mybuf[bigBuf.Dimx()]); - g = GETGREEN(mybuf[1]) + GETGREEN(mybuf[-1]) + GETGREEN(mybuf[-bigBuf.Dimx()]) + GETGREEN(mybuf[bigBuf.Dimx()]); - b = GETBLUE(mybuf[1]) + GETBLUE(mybuf[-1]) + GETBLUE(mybuf[-bigBuf.Dimx()]) + GETBLUE(mybuf[bigBuf.Dimx()]); + if (_aabuf[(y + v) * _dimx + x + u] == 1 && x != 0 && x != width - 1) { + r = GETRED(mybuf[1]) + GETRED(mybuf[-1]) + GETRED(mybuf[-bigBuf.getDimx()]) + GETRED(mybuf[bigBuf.getDimx()]); + g = GETGREEN(mybuf[1]) + GETGREEN(mybuf[-1]) + GETGREEN(mybuf[-bigBuf.getDimx()]) + GETGREEN(mybuf[bigBuf.getDimx()]); + b = GETBLUE(mybuf[1]) + GETBLUE(mybuf[-1]) + GETBLUE(mybuf[-bigBuf.getDimx()]) + GETBLUE(mybuf[bigBuf.getDimx()]); r += GETRED(mybuf[0]) * 2; g += GETGREEN(mybuf[0]) * 2; @@ -1708,20 +1711,20 @@ void RMGfxSourceBuffer8AA::DrawAA(RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pri } // Skippa alla linea successiva - buf += bigBuf.Dimx(); + buf += bigBuf.getDimx(); } } -void RMGfxSourceBuffer8AA::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMGfxSourceBuffer8AA::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_2(RMGfxSourceBuffer8::Draw, bigBuf, prim); - DrawAA(bigBuf, prim); + CORO_INVOKE_2(RMGfxSourceBuffer8::draw, bigBuf, prim); + drawAA(bigBuf, prim); CORO_END_CODE; } @@ -1735,36 +1738,36 @@ RMGfxSourceBuffer8RLEByteAA::~RMGfxSourceBuffer8RLEByteAA() { } -void RMGfxSourceBuffer8RLEByteAA::PrepareImage(void) { - RMGfxSourceBuffer::PrepareImage(); - CalculateAA(); - CompressRLE(); +void RMGfxSourceBuffer8RLEByteAA::prepareImage(void) { + RMGfxSourceBuffer::prepareImage(); + calculateAA(); + compressRLE(); } -void RMGfxSourceBuffer8RLEByteAA::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMGfxSourceBuffer8RLEByteAA::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_2(RMGfxSourceBuffer8RLE::Draw, bigBuf, prim); + CORO_INVOKE_2(RMGfxSourceBuffer8RLE::draw, bigBuf, prim); if (GLOBALS.bCfgAntiAlias) - DrawAA(bigBuf, prim); + drawAA(bigBuf, prim); CORO_END_CODE; } -int RMGfxSourceBuffer8RLEByteAA::Init(const byte *buf, int dimx, int dimy, bool bLoadPalette) { - return RMGfxSourceBuffer8RLE::Init(buf, dimx, dimy, bLoadPalette); +int RMGfxSourceBuffer8RLEByteAA::init(const byte *buf, int dimx, int dimy, bool bLoadPalette) { + return RMGfxSourceBuffer8RLE::init(buf, dimx, dimy, bLoadPalette); } -void RMGfxSourceBuffer8RLEByteAA::Init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) { - RMGfxSourceBuffer8RLE::Init(ds, dimx, dimy, bLoadPalette); +void RMGfxSourceBuffer8RLEByteAA::init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) { + RMGfxSourceBuffer8RLE::init(ds, dimx, dimy, bLoadPalette); if (!bNeedRLECompress) { // Load the anti-aliasing mask - m_aabuf = new byte[dimx * dimy]; - ds.Read(m_aabuf, dimx * dimy); + _aabuf = new byte[dimx * dimy]; + ds.Read(_aabuf, dimx * dimy); } } @@ -1773,36 +1776,36 @@ RMGfxSourceBuffer8RLEWordAA::~RMGfxSourceBuffer8RLEWordAA() { } -void RMGfxSourceBuffer8RLEWordAA::PrepareImage(void) { - RMGfxSourceBuffer::PrepareImage(); - CalculateAA(); - CompressRLE(); +void RMGfxSourceBuffer8RLEWordAA::prepareImage(void) { + RMGfxSourceBuffer::prepareImage(); + calculateAA(); + compressRLE(); } -void RMGfxSourceBuffer8RLEWordAA::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMGfxSourceBuffer8RLEWordAA::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - CORO_INVOKE_2(RMGfxSourceBuffer8RLE::Draw, bigBuf, prim); + CORO_INVOKE_2(RMGfxSourceBuffer8RLE::draw, bigBuf, prim); if (GLOBALS.bCfgAntiAlias) - DrawAA(bigBuf, prim); + drawAA(bigBuf, prim); CORO_END_CODE; } -int RMGfxSourceBuffer8RLEWordAA::Init(byte *buf, int dimx, int dimy, bool bLoadPalette) { - return RMGfxSourceBuffer8RLE::Init(buf, dimx, dimy, bLoadPalette); +int RMGfxSourceBuffer8RLEWordAA::init(byte *buf, int dimx, int dimy, bool bLoadPalette) { + return RMGfxSourceBuffer8RLE::init(buf, dimx, dimy, bLoadPalette); } -void RMGfxSourceBuffer8RLEWordAA::Init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) { - RMGfxSourceBuffer8RLE::Init(ds, dimx, dimy, bLoadPalette); +void RMGfxSourceBuffer8RLEWordAA::init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette) { + RMGfxSourceBuffer8RLE::init(ds, dimx, dimy, bLoadPalette); if (!bNeedRLECompress) { // Load the anti-aliasing mask - m_aabuf = new byte[dimx * dimy]; - ds.Read(m_aabuf, dimx * dimy); + _aabuf = new byte[dimx * dimy]; + ds.Read(_aabuf, dimx * dimy); } } @@ -1812,46 +1815,46 @@ void RMGfxSourceBuffer8RLEWordAA::Init(RMDataStream &ds, int dimx, int dimy, boo \****************************************************************************/ RMGfxSourceBuffer16::RMGfxSourceBuffer16(bool bTrasp0) { - m_bTrasp0 = bTrasp0; + _bTrasp0 = bTrasp0; } RMGfxSourceBuffer16::~RMGfxSourceBuffer16() { } -void RMGfxSourceBuffer16::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMGfxSourceBuffer16::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { int x, y; uint16 *buf = bigBuf; - uint16 *raw = (uint16 *)m_buf; + uint16 *raw = (uint16 *)_buf; int dimx, dimy; int u, v; int x1, y1; - dimx = m_dimx; - dimy = m_dimy; + dimx = _dimx; + dimy = _dimy; u = 0; v = 0; x1 = 0; y1 = 0; - if (prim->HaveSrc()) { + if (prim->haveSrc()) { u = prim->Src().x1; v = prim->Src().y1; dimx = prim->Src().Width(); dimy = prim->Src().Height(); } - if (prim->HaveDst()) { + if (prim->haveDst()) { x1 = prim->Dst().x1; y1 = prim->Dst().y1; } - if (!Clip2D(x1, y1, u, v, dimx, dimy, true, &bigBuf)) + if (!clip2D(x1, y1, u, v, dimx, dimy, true, &bigBuf)) return; - raw += v * m_dimx + u; - buf += y1 * bigBuf.Dimx() + x1; + raw += v * _dimx + u; + buf += y1 * bigBuf.getDimx() + x1; - if (m_bTrasp0) { + if (_bTrasp0) { for (y = 0; y < dimy; y++) { for (x = 0; x < dimx;) { while (x < dimx && raw[x] == 0) @@ -1863,14 +1866,14 @@ void RMGfxSourceBuffer16::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimi } } - raw += m_dimx; - buf += bigBuf.Dimx(); + raw += _dimx; + buf += bigBuf.getDimx(); } } else { for (y = 0; y < dimy; y++) { Common::copy(raw, raw + dimx, buf); - buf += bigBuf.Dimx(); - raw += m_dimx; + buf += bigBuf.getDimx(); + raw += _dimx; } } } @@ -1878,16 +1881,16 @@ void RMGfxSourceBuffer16::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimi void RMGfxSourceBuffer16::PrepareImage(void) { // Colour space conversion if necessary! int i; - uint16 *buf = (uint16 *)m_buf; + uint16 *buf = (uint16 *)_buf; - for (i = 0; i < m_dimx * m_dimy; i++) + for (i = 0; i < _dimx * _dimy; i++) WRITE_LE_UINT16(&buf[i], FROM_LE_16(buf[i]) & 0x7FFF); } RMGfxSourceBuffer16::RMGfxSourceBuffer16(int dimx, int dimy, bool bUseDDraw) : RMGfxBuffer(dimx, dimy, 16, bUseDDraw) { - SetPriority(0); + setPriority(0); } @@ -1901,14 +1904,14 @@ int RMGfxSourceBuffer16::Bpp() { } void RMGfxSourceBuffer16::Create(int dimx, int dimy, bool bUseDDraw) { - RMGfxBuffer::Create(dimx, dimy, 16, bUseDDraw); + RMGfxBuffer::create(dimx, dimy, 16, bUseDDraw); } /****************************************************************************\ * RMGfxBox Methods \****************************************************************************/ -void RMGfxBox::RemoveThis(CORO_PARAM, bool &result) { +void RMGfxBox::removeThis(CORO_PARAM, bool &result) { result = true; } @@ -1919,21 +1922,21 @@ void RMGfxBox::SetColor(byte r, byte g, byte b) { wFillColor = (r << 10) | (g << 5) | b; } -void RMGfxBox::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMGfxBox::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { int i, j; uint16 *buf = bigBuf; RMRect rcDst; // It takes the destination rectangle rcDst = prim->Dst(); - buf += rcDst.y1 * bigBuf.Dimx() + rcDst.x1; + buf += rcDst.y1 * bigBuf.getDimx() + rcDst.x1; // Loop through the pixels for (j = 0; j < rcDst.Height(); j++) { for (i = 0; i < rcDst.Width(); i++) *buf ++ = wFillColor; - buf += bigBuf.Dimx() - rcDst.Width(); + buf += bigBuf.getDimx() - rcDst.Width(); } } @@ -1947,12 +1950,12 @@ int RMGfxClearTask::Priority() { return 1; } -void RMGfxClearTask::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *) { +void RMGfxClearTask::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *) { // Clean the target buffer - Common::fill((byte *)bigBuf, (byte *)bigBuf + (bigBuf.Dimx() * bigBuf.Dimy() * 2), 0x0); + Common::fill((byte *)bigBuf, (byte *)bigBuf + (bigBuf.getDimx() * bigBuf.getDimy() * 2), 0x0); } -void RMGfxClearTask::RemoveThis(CORO_PARAM, bool &result) { +void RMGfxClearTask::removeThis(CORO_PARAM, bool &result) { // The task is fine to be removed result = true; } diff --git a/engines/tony/gfxcore.h b/engines/tony/gfxcore.h index ffeb7724b2..51d27b7311 100644 --- a/engines/tony/gfxcore.h +++ b/engines/tony/gfxcore.h @@ -58,10 +58,10 @@ class RMGfxClearTask; // Task */ class RMGfxBuffer { protected: - int m_dimx, m_dimy; - byte *m_buf; - byte *m_origBuf; - bool m_bUseDDraw; + int _dimx, _dimy; + byte *_buf; + byte *_origBuf; + bool _bUseDDraw; public: RMGfxBuffer(); @@ -69,27 +69,27 @@ public: virtual ~RMGfxBuffer(); // Attributes - int Dimx() { - return m_dimx; + int getDimx() { + return _dimx; } - int Dimy() { - return m_dimy; + int getDimy() { + return _dimy; } // Creation - virtual void Create(int dimx, int dimy, int nBpp, bool bUseDDraw = false); - virtual void Destroy(void); + virtual void create(int dimx, int dimy, int nBpp, bool bUseDDraw = false); + virtual void destroy(void); // Buffer access - void Lock(void); - void Unlock(void); + void lock(void); + void unlock(void); // These are valid only if the buffer is locked operator byte *(); operator void *(); // Getting the offset for a given Y position - void OffsetY(int nLines, int nBpp); + void offsetY(int nLines, int nBpp); }; /** @@ -97,116 +97,116 @@ public: */ class RMGfxPrimitive { public: - RMGfxTask *m_task; + RMGfxTask *_task; protected: - RMRect m_src; - RMRect m_dst; + RMRect _src; + RMRect _dst; - bool m_bStretch; - byte m_bFlag; + bool _bStretch; + byte _bFlag; public: RMGfxPrimitive() { - m_bFlag = 0; - m_task = NULL; - m_src.SetEmpty(); - m_dst.SetEmpty(); + _bFlag = 0; + _task = NULL; + _src.SetEmpty(); + _dst.SetEmpty(); } RMGfxPrimitive(RMGfxTask *task) { - m_task = task; - m_bFlag = 0; + _task = task; + _bFlag = 0; } RMGfxPrimitive(RMGfxTask *task, const RMRect &src, RMRect &dst) { - m_task = task; - m_src = src; - m_dst = dst; - m_bFlag = 0; - m_bStretch = (src.Width() != dst.Width() || src.Height() != dst.Height()); + _task = task; + _src = src; + _dst = dst; + _bFlag = 0; + _bStretch = (src.Width() != dst.Width() || src.Height() != dst.Height()); } RMGfxPrimitive(RMGfxTask *task, const RMPoint &src, RMRect &dst) { - m_task = task; - m_src.TopLeft() = src; - m_dst = dst; - m_bFlag = 0; + _task = task; + _src.TopLeft() = src; + _dst = dst; + _bFlag = 0; } RMGfxPrimitive(RMGfxTask *task, const RMPoint &src, RMPoint &dst) { - m_task = task; - m_src.TopLeft() = src; - m_dst.TopLeft() = dst; - m_bFlag = 0; + _task = task; + _src.TopLeft() = src; + _dst.TopLeft() = dst; + _bFlag = 0; } RMGfxPrimitive(RMGfxTask *task, const RMRect &src, RMPoint &dst) { - m_task = task; - m_src = src; - m_dst.TopLeft() = dst; - m_bFlag = 0; + _task = task; + _src = src; + _dst.TopLeft() = dst; + _bFlag = 0; } RMGfxPrimitive(RMGfxTask *task, const RMRect &dst) { - m_task = task; - m_dst = dst; - m_src.SetEmpty(); - m_bFlag = 0; + _task = task; + _dst = dst; + _src.SetEmpty(); + _bFlag = 0; } RMGfxPrimitive(RMGfxTask *task, const RMPoint &dst) { - m_task = task; - m_dst.TopLeft() = dst; - m_src.SetEmpty(); - m_bFlag = 0; + _task = task; + _dst.TopLeft() = dst; + _src.SetEmpty(); + _bFlag = 0; } virtual ~RMGfxPrimitive() { } - void SetFlag(byte bFlag) { - m_bFlag = bFlag; + void setFlag(byte bFlag) { + _bFlag = bFlag; } - void SetTask(RMGfxTask *task) { - m_task = task; + void setTask(RMGfxTask *task) { + _task = task; } - void SetSrc(const RMRect &src) { - m_src = src; + void setSrc(const RMRect &src) { + _src = src; } - void SetSrc(const RMPoint &src) { - m_src.TopLeft() = src; + void setSrc(const RMPoint &src) { + _src.TopLeft() = src; } - void SetDst(const RMRect &dst) { - m_dst = dst; + void setDst(const RMRect &dst) { + _dst = dst; } - void SetDst(const RMPoint &dst) { - m_dst.TopLeft() = dst; + void setDst(const RMPoint &dst) { + _dst.TopLeft() = dst; } - void SetStrecth(bool bStretch) { - m_bStretch = bStretch; + void setStrecth(bool bStretch) { + _bStretch = bStretch; } - bool HaveDst() { - return !m_dst.IsEmpty(); + bool haveDst() { + return !_dst.IsEmpty(); } RMRect &Dst() { - return m_dst; + return _dst; } - bool HaveSrc() { - return !m_src.IsEmpty(); + bool haveSrc() { + return !_src.IsEmpty(); } RMRect &Src() { - return m_src; + return _src; } // Flags - bool IsFlipped() { - return m_bFlag & 1; + bool isFlipped() { + return _bFlag & 1; } // Duplicate - virtual RMGfxPrimitive *Duplicate() { + virtual RMGfxPrimitive *duplicate() { return new RMGfxPrimitive(*this); } }; @@ -217,25 +217,25 @@ public: */ class RMGfxTask { protected: - int m_nPrior; - int m_nInList; + int _nPrior; + int _nInList; public: // Standard constructor RMGfxTask(); virtual ~RMGfxTask() { } - virtual int Priority(); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) = 0; - virtual void RemoveThis(CORO_PARAM, bool &result); + virtual int priority(); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) = 0; + virtual void removeThis(CORO_PARAM, bool &result); // Registration virtual void Register(void) { - m_nInList++; + _nInList++; } virtual void Unregister(void) { - m_nInList--; - assert(m_nInList >= 0); + _nInList--; + assert(_nInList >= 0); } }; @@ -246,7 +246,7 @@ public: class RMGfxTaskSetPrior : public RMGfxTask { public: virtual ~RMGfxTaskSetPrior() { } - void SetPriority(int nPrior); + void setPriority(int nPrior); }; @@ -258,8 +258,8 @@ public: virtual ~RMGfxClearTask() { } int Priority(); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); - virtual void RemoveThis(CORO_PARAM, bool &result); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void removeThis(CORO_PARAM, bool &result); }; @@ -274,8 +274,8 @@ public: virtual ~RMGfxBox() { } void SetColor(byte r, byte g, byte b); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); - virtual void RemoveThis(CORO_PARAM, bool &result); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void removeThis(CORO_PARAM, bool &result); }; @@ -285,17 +285,17 @@ public: class RMGfxSourceBuffer : public virtual RMGfxBuffer, public RMGfxTaskSetPrior { public: // Load the data for the surface - virtual int Init(uint32 resID, int dimx, int dimy, bool bLoadPalette = false); - virtual int Init(const byte *buf, int dimx, int dimy, bool bLoadPalette = false); - virtual void Init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette = false); + virtual int init(uint32 resID, int dimx, int dimy, bool bLoadPalette = false); + virtual int init(const byte *buf, int dimx, int dimy, bool bLoadPalette = false); + virtual void init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette = false); virtual ~RMGfxSourceBuffer(); protected: - virtual void PrepareImage(void); - bool Clip2D(int &x1, int &y1, int &u, int &v, int &width, int &height, bool bUseSrc, RMGfxTargetBuffer *buf); - void OffsetY(int nLines) { - RMGfxBuffer::OffsetY(nLines, Bpp()); + virtual void prepareImage(void); + bool clip2D(int &x1, int &y1, int &u, int &v, int &width, int &height, bool bUseSrc, RMGfxTargetBuffer *buf); + void offsetY(int nLines) { + RMGfxBuffer::offsetY(nLines, Bpp()); } public: @@ -309,7 +309,7 @@ public: class RMGfxSourceBuffer16 : public RMGfxSourceBuffer { protected: virtual void PrepareImage(void); - bool m_bTrasp0; + bool _bTrasp0; public: RMGfxSourceBuffer16(bool bUseTrasp = false); @@ -320,7 +320,7 @@ public: void Create(int dimx, int dimy, bool bUseDDraw = false); int Bpp(); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); }; @@ -330,22 +330,22 @@ public: class RMGfxSourceBufferPal : public RMGfxSourceBuffer { protected: // The size of the palette is (1 << Bpp()) * 4 - byte m_pal[256 * 3]; - uint16 m_palFinal[256]; + byte _pal[256 * 3]; + uint16 _palFinal[256]; // Post process to prepare the palette for drawing - virtual void PreparePalette(void); + virtual void preparePalette(void); public: virtual ~RMGfxSourceBufferPal(); - virtual int Init(const byte *buf, int dimx, int dimy, bool bLoadPalette = false); - virtual void Init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette = false); + virtual int init(const byte *buf, int dimx, int dimy, bool bLoadPalette = false); + virtual void init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette = false); - int LoadPaletteWA(uint32 resID, bool bSwapped = false); - int LoadPaletteWA(const byte *buf, bool bSwapped = false); - int LoadPalette(uint32 resID); - int LoadPalette(const byte *buf); + int loadPaletteWA(uint32 resID, bool bSwapped = false); + int loadPaletteWA(const byte *buf, bool bSwapped = false); + int loadPalette(uint32 resID); + int loadPalette(const byte *buf); }; @@ -354,7 +354,7 @@ public: */ class RMGfxSourceBuffer8 : public RMGfxSourceBufferPal { protected: - bool m_bTrasp0; + bool _bTrasp0; public: RMGfxSourceBuffer8(bool bTrasp0 = true); @@ -362,10 +362,10 @@ public: virtual ~RMGfxSourceBuffer8(); // Initialisation - void Create(int dimx, int dimy, bool bUseDDraw = false); + void create(int dimx, int dimy, bool bUseDDraw = false); int Bpp(); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); }; @@ -374,11 +374,11 @@ public: */ class RMGfxSourceBuffer8AB : public RMGfxSourceBuffer8 { protected: - int CalcTrasp(int f, int b); + int calcTrasp(int f, int b); public: virtual ~RMGfxSourceBuffer8AB(); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); }; @@ -403,29 +403,29 @@ protected: virtual void RLEDecompressLineFlipped(uint16 *dst, byte *src, int nStartSkip, int nLength) = 0; // Perform image compression in RLE - void CompressRLE(void); + void compressRLE(void); protected: // Overriding initialisation methods - virtual void PrepareImage(void); - virtual void PreparePalette(void); + virtual void prepareImage(void); + virtual void preparePalette(void); public: RMGfxSourceBuffer8RLE(); virtual ~RMGfxSourceBuffer8RLE(); // Overload of the initialisation method - virtual void Init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette = false); - virtual int Init(const byte *buf, int dimx, int dimy, bool bLoadPalette = false); + virtual void init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette = false); + virtual int init(const byte *buf, int dimx, int dimy, bool bLoadPalette = false); // Draw image with RLE decompression - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // Sets the color that will be alpha blended - void SetAlphaBlendColor(int color); + void setAlphaBlendColor(int color); // Warn if the data is already compressed - void SetAlreadyCompressed(void); + void setAlreadyCompressed(void); }; class RMGfxSourceBuffer8RLEByte : public RMGfxSourceBuffer8RLE { @@ -470,50 +470,50 @@ class RMGfxSourceBuffer8AA : public virtual RMGfxSourceBuffer8 { protected: static byte MegaAABuf[]; static byte MegaAABuf2[]; - byte *m_aabuf; + byte *_aabuf; // Calculate the buffer for the anti-aliasing - void CalculateAA(void); + void calculateAA(void); // Draw the AA - void DrawAA(RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + void drawAA(RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); protected: - void PrepareImage(void); + void prepareImage(void); public: RMGfxSourceBuffer8AA(); virtual ~RMGfxSourceBuffer8AA(); // Draw with anti-aliasing - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); }; class RMGfxSourceBuffer8RLEByteAA : public RMGfxSourceBuffer8RLEByte, public RMGfxSourceBuffer8AA { protected: - void PrepareImage(void); + void prepareImage(void); public: - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // Overloaded initialisation methods - virtual void Init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette = false); - virtual int Init(const byte *buf, int dimx, int dimy, bool bLoadPalette = false); + virtual void init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette = false); + virtual int init(const byte *buf, int dimx, int dimy, bool bLoadPalette = false); virtual ~RMGfxSourceBuffer8RLEByteAA(); }; class RMGfxSourceBuffer8RLEWordAA : public RMGfxSourceBuffer8RLEWord, public RMGfxSourceBuffer8AA { protected: - void PrepareImage(void); + void prepareImage(void); public: - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // Overloaded initialisation methods - virtual void Init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette = false); - virtual int Init(byte *buf, int dimx, int dimy, bool bLoadPalette = false); + virtual void init(RMDataStream &ds, int dimx, int dimy, bool bLoadPalette = false); + virtual int init(byte *buf, int dimx, int dimy, bool bLoadPalette = false); virtual ~RMGfxSourceBuffer8RLEWordAA(); }; @@ -531,7 +531,7 @@ public: void Create(int dimx, int dimy, bool bUseDDraw = false); int Bpp(); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); }; @@ -557,34 +557,34 @@ private: protected: OTList *otlist; - int m_otSize; + int _otSize; public: RMGfxTargetBuffer(); virtual ~RMGfxTargetBuffer(); // management of the OT list - void ClearOT(void); - void DrawOT(CORO_PARAM); - void AddPrim(RMGfxPrimitive *prim); // The pointer must be delted + void clearOT(void); + void drawOT(CORO_PARAM); + void addPrim(RMGfxPrimitive *prim); // The pointer must be delted // Adds a task to clear the screen - void AddClearTask(void); + void addClearTask(void); operator byte *() { - return m_buf; + return _buf; } operator void *() { - return (void *)m_buf; + return (void *)_buf; } operator uint16 *() { // FIXME: This may not be endian safe - return (uint16 *)m_buf; + return (uint16 *)_buf; } // Offseting buffer - void OffsetY(int nLines) { - RMGfxBuffer::OffsetY(nLines, 16); + void offsetY(int nLines) { + RMGfxBuffer::offsetY(nLines, 16); } }; @@ -598,7 +598,7 @@ public: RMGfxWoodyBuffer(int dimx, int dimy, bool bUseDDraw = false); virtual ~RMGfxWoodyBuffer(); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); }; } // End of namespace Tony diff --git a/engines/tony/gfxengine.cpp b/engines/tony/gfxengine.cpp index dd448fdc93..2d1c0663a6 100644 --- a/engines/tony/gfxengine.cpp +++ b/engines/tony/gfxengine.cpp @@ -61,8 +61,8 @@ void ExitAllIdles(CORO_PARAM, const void *param) { RMGfxEngine::RMGfxEngine() { // Create big buffer where the frame will be rendered - _bigBuf.Create(RM_BBX, RM_BBY, 16); - _bigBuf.OffsetY(RM_SKIPY); + _bigBuf.create(RM_BBX, RM_BBY, 16); + _bigBuf.offsetY(RM_SKIPY); _csMainLoop = NULL; _nCurLoc = 0; @@ -84,7 +84,7 @@ RMGfxEngine::RMGfxEngine() { RMGfxEngine::~RMGfxEngine() { // Close the buffer - _bigBuf.Destroy(); + _bigBuf.destroy(); g_system->deleteMutex(_csMainLoop); } @@ -312,7 +312,7 @@ SKIPCLICKSINISTRO: // ********************** // Draw the list in the OT // ********************** - CORO_INVOKE_0(_bigBuf.DrawOT); + CORO_INVOKE_0(_bigBuf.drawOT); #define FSTEP (480/32) @@ -454,7 +454,7 @@ void RMGfxEngine::unloadLocation(CORO_PARAM, bool bDoOnExit, uint32 *result) { _bLocationLoaded = false; - _bigBuf.ClearOT(); + _bigBuf.clearOT(); _loc.Unload(); if (result != NULL) @@ -468,9 +468,9 @@ void RMGfxEngine::init() { RMResRaw *raw; RMGfxSourceBuffer16 *load = NULL; INIT_GFX16_FROMRAW(20038, load); - _bigBuf.AddPrim(new RMGfxPrimitive(load)); - _bigBuf.DrawOT(Common::nullContext); - _bigBuf.ClearOT(); + _bigBuf.addPrim(new RMGfxPrimitive(load)); + _bigBuf.drawOT(Common::nullContext); + _bigBuf.clearOT(); delete load; _vm->_window.GetNewFrame(*this, NULL); @@ -502,7 +502,7 @@ void RMGfxEngine::init() { _point.Init(); // Initialise Tony - _tony.Init(); + _tony.init(); _tony.LinkToBoxes(&_vm->_theBoxes); // Initialise the inventory and the interface @@ -519,7 +519,7 @@ void RMGfxEngine::init() { } void RMGfxEngine::close(void) { - _bigBuf.ClearOT(); + _bigBuf.clearOT(); _inter.Close(); _inv.Close(); diff --git a/engines/tony/gfxengine.h b/engines/tony/gfxengine.h index 695c5af58f..69d36cbbc0 100644 --- a/engines/tony/gfxengine.h +++ b/engines/tony/gfxengine.h @@ -121,7 +121,7 @@ public: // Link to graphic task void linkGraphicTask(RMGfxTask *task) { - _bigBuf.AddPrim(new RMGfxPrimitive(task)); + _bigBuf.addPrim(new RMGfxPrimitive(task)); }; // Manage a location diff --git a/engines/tony/inventory.cpp b/engines/tony/inventory.cpp index 5fb375da81..9b8f346aaf 100644 --- a/engines/tony/inventory.cpp +++ b/engines/tony/inventory.cpp @@ -79,7 +79,7 @@ void RMInventory::Init(void) { // Create the main buffer Create(RM_SX, 68); - SetPriority(185); + setPriority(185); // Setup the inventory m_nInv = 0; @@ -122,7 +122,7 @@ void RMInventory::Init(void) { assert(raw.IsValid()); - m_items[i].pointer[j].Init((const byte *)raw, raw.Width(), raw.Height(), true); + m_items[i].pointer[j].init((const byte *)raw, raw.Width(), raw.Height(), true); curres++; } } @@ -156,8 +156,8 @@ void RMInventory::Init(void) { // Prepare initial inventory Prepare(); - DrawOT(Common::nullContext); - ClearOT(); + drawOT(Common::nullContext); + clearOT(); } void RMInventory::Close(void) { @@ -172,7 +172,7 @@ void RMInventory::Close(void) { m_items = NULL; } - Destroy(); + destroy(); } void RMInventory::Reset(void) { @@ -180,7 +180,7 @@ void RMInventory::Reset(void) { EndCombine(); } -void RMInventory::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMInventory::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; RMPoint pos; RMPoint pos2; @@ -191,12 +191,12 @@ 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)); + prim->setDst(RMPoint(0, m_curPutY)); else - prim->SetDst(RMPoint(0, m_curPutY)); + prim->setDst(RMPoint(0, m_curPutY)); g_system->lockMutex(m_csModifyInterface); - CORO_INVOKE_2(RMGfxWoodyBuffer::Draw, bigBuf, prim); + CORO_INVOKE_2(RMGfxWoodyBuffer::draw, bigBuf, prim); g_system->unlockMutex(m_csModifyInterface); if (m_state == SELECTING) { @@ -209,19 +209,19 @@ void RMInventory::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr _ctx->pos2.Set((m_nSelectObj + 1) * 64 + 34, 119 - 4); } - _ctx->p = new RMGfxPrimitive(prim->m_task, _ctx->pos); - _ctx->p2 = new RMGfxPrimitive(prim->m_task, _ctx->pos2); + _ctx->p = new RMGfxPrimitive(prim->_task, _ctx->pos); + _ctx->p2 = new RMGfxPrimitive(prim->_task, _ctx->pos2); // Draw the mini interface - CORO_INVOKE_2(miniInterface.Draw, bigBuf, _ctx->p); + CORO_INVOKE_2(miniInterface.draw, bigBuf, _ctx->p); if (GLOBALS.bCfgInterTips) { if (miniAction == 1) // Examine - CORO_INVOKE_2(m_hints[0].Draw, bigBuf, _ctx->p2); + CORO_INVOKE_2(m_hints[0].draw, bigBuf, _ctx->p2); else if (miniAction == 2) // Talk - CORO_INVOKE_2(m_hints[1].Draw, bigBuf, _ctx->p2); + CORO_INVOKE_2(m_hints[1].draw, bigBuf, _ctx->p2); else if (miniAction == 3) // Use - CORO_INVOKE_2(m_hints[2].Draw, bigBuf, _ctx->p2); + CORO_INVOKE_2(m_hints[2].draw, bigBuf, _ctx->p2); } delete _ctx->p; @@ -249,8 +249,8 @@ void RMInventory::RemoveItem(int code) { m_nInv--; Prepare(); - DrawOT(Common::nullContext); - ClearOT(); + drawOT(Common::nullContext); + clearOT(); g_system->unlockMutex(m_csModifyInterface); return; } @@ -270,8 +270,8 @@ void RMInventory::AddItem(int code) { m_inv[m_nInv++] = code - 10000; Prepare(); - DrawOT(Common::nullContext); - ClearOT(); + drawOT(Common::nullContext); + clearOT(); g_system->unlockMutex(m_csModifyInterface); } } @@ -285,8 +285,8 @@ void RMInventory::ChangeItemStatus(uint32 code, uint32 dwStatus) { m_items[code - 10000].status = dwStatus; Prepare(); - DrawOT(Common::nullContext); - ClearOT(); + drawOT(Common::nullContext); + clearOT(); g_system->unlockMutex(m_csModifyInterface); } } @@ -297,14 +297,14 @@ void RMInventory::Prepare(void) { 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))); + addPrim(new RMGfxPrimitive(&m_items[m_inv[i - 1 + m_curPos]].icon, RMPoint(i * 64, 0))); else - AddPrim(new RMGfxPrimitive(&m_items[0].icon, RMPoint(i * 64, 0))); + addPrim(new RMGfxPrimitive(&m_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(&m_items[29].icon, RMPoint(0, 0))); + addPrim(new RMGfxPrimitive(&m_items[28].icon, RMPoint(640 - 64, 0))); } bool RMInventory::MiniActive(void) { @@ -364,8 +364,8 @@ bool RMInventory::LeftClick(const RMPoint &mpos, int &nCombineObj) { } Prepare(); - DrawOT(Common::nullContext); - ClearOT(); + drawOT(Common::nullContext); + clearOT(); g_system->unlockMutex(m_csModifyInterface); } // Click the left arrow @@ -385,8 +385,8 @@ bool RMInventory::LeftClick(const RMPoint &mpos, int &nCombineObj) { } Prepare(); - DrawOT(Common::nullContext); - ClearOT(); + drawOT(Common::nullContext); + clearOT(); g_system->unlockMutex(m_csModifyInterface); } @@ -430,8 +430,8 @@ void RMInventory::RightClick(const RMPoint &mpos) { } Prepare(); - DrawOT(Common::nullContext); - ClearOT(); + drawOT(Common::nullContext); + clearOT(); g_system->unlockMutex(m_csModifyInterface); } else if ((m_state == OPENED) && m_bBlinkingLeft) { assert(m_curPos > 0); @@ -450,8 +450,8 @@ void RMInventory::RightClick(const RMPoint &mpos) { } Prepare(); - DrawOT(Common::nullContext); - ClearOT(); + drawOT(Common::nullContext); + clearOT(); g_system->unlockMutex(m_csModifyInterface); } } @@ -484,7 +484,7 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo if (m_state != CLOSED) { // Clean up the OT list g_system->lockMutex(m_csModifyInterface); - ClearOT(); + clearOT(); // DoFrame makes all the objects currently in the inventory be displayed // @@@ Maybe we should do all takeable objects? Please does not help @@ -662,8 +662,8 @@ void RMInventory::DoFrame(RMGfxTargetBuffer &bigBuf, RMPointer &ptr, RMPoint mpo miniInterface.DoFrame(&bigBuf, false); } - if ((m_state != CLOSED) && !m_nInList) { - bigBuf.AddPrim(new RMGfxPrimitive(this)); + if ((m_state != CLOSED) && !_nInList) { + bigBuf.addPrim(new RMGfxPrimitive(this)); } } @@ -744,8 +744,8 @@ int RMInventory::LoadState(byte *state) { m_items[28].icon.SetPattern(1); Prepare(); - DrawOT(Common::nullContext); - ClearOT(); + drawOT(Common::nullContext); + clearOT(); return GetSaveStateSize(); } @@ -781,7 +781,7 @@ int RMInterface::OnWhichBox(RMPoint pt) { return -1; } -void RMInterface::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMInterface::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; int h; CORO_END_CONTEXT(_ctx); @@ -789,13 +789,13 @@ void RMInterface::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr CORO_BEGIN_CODE(_ctx); prim->Dst().TopLeft() = m_openStart; - CORO_INVOKE_2(RMGfxSourceBuffer8RLEByte::Draw, bigBuf, prim); + CORO_INVOKE_2(RMGfxSourceBuffer8RLEByte::draw, bigBuf, prim); // Check if there is a draw hot zone _ctx->h = OnWhichBox(m_mpos); if (_ctx->h != -1) { prim->Dst().TopLeft() = m_openStart; - CORO_INVOKE_2(m_hotzone[_ctx->h].Draw, bigBuf, prim); + CORO_INVOKE_2(m_hotzone[_ctx->h].draw, bigBuf, prim); if (m_lastHotZone != _ctx->h) { m_lastHotZone = _ctx->h; @@ -804,7 +804,7 @@ void RMInterface::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr if (GLOBALS.bCfgInterTips) { prim->Dst().TopLeft() = m_openStart + RMPoint(70, 177); - CORO_INVOKE_2(m_hints[_ctx->h].Draw, bigBuf, prim); + CORO_INVOKE_2(m_hints[_ctx->h].draw, bigBuf, prim); } } else m_lastHotZone = -1; @@ -815,8 +815,8 @@ void RMInterface::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr void RMInterface::DoFrame(RMGfxTargetBuffer &bigBuf, RMPoint mousepos) { // If needed, add to the OT schedule list - if (!m_nInList && m_bActive) - bigBuf.AddPrim(new RMGfxPrimitive(this)); + if (!_nInList && m_bActive) + bigBuf.addPrim(new RMGfxPrimitive(this)); m_mpos = mousepos; } @@ -826,14 +826,14 @@ void RMInterface::Clicked(const RMPoint &mousepos) { m_openPos = mousepos; // Calculate the top left corner of the interface - m_openStart = m_openPos - RMPoint(m_dimx / 2, m_dimy / 2); + m_openStart = m_openPos - RMPoint(_dimx / 2, _dimy / 2); m_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 + m_dimx > RM_SX) m_openStart.x = RM_SX - m_dimx; - if (m_openStart.y + m_dimy > RM_SY) m_openStart.y = RM_SY - m_dimy; + 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; // Play the sound effect _vm->playUtilSFX(0); @@ -890,16 +890,16 @@ void RMInterface::Init(void) { RMResRaw inter(RES_I_INTERFACE); RMRes pal(RES_I_INTERPPAL); - SetPriority(191); + setPriority(191); - RMGfxSourceBuffer::Init(inter, inter.Width(), inter.Height()); - LoadPaletteWA(RES_I_INTERPAL); + RMGfxSourceBuffer::init(inter, inter.Width(), inter.Height()); + loadPaletteWA(RES_I_INTERPAL); 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); + m_hotzone[i].init(part, part.Width(), part.Height()); + m_hotzone[i].loadPaletteWA(pal); } m_hotbbox[0].SetRect(126, 123, 159, 208); // Take @@ -935,10 +935,10 @@ void RMInterface::Init(void) { void RMInterface::Close(void) { int i; - Destroy(); + destroy(); for (i = 0; i < 5; i++) - m_hotzone[i].Destroy(); + m_hotzone[i].destroy(); } } // End of namespace Tony diff --git a/engines/tony/inventory.h b/engines/tony/inventory.h index a5f02603e7..87ccaa33b4 100644 --- a/engines/tony/inventory.h +++ b/engines/tony/inventory.h @@ -101,7 +101,7 @@ public: virtual void RemoveThis(CORO_PARAM, bool &result); // Overload the drawing of the inventory - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // Method for determining whether the inventory currently has the focus bool HaveFocus(const RMPoint &mpos); @@ -193,7 +193,7 @@ public: bool GetPalesati(void); // Overloaded Draw - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); }; } // End of namespace Tony diff --git a/engines/tony/loc.cpp b/engines/tony/loc.cpp index 601ae3f09b..1a7933a03d 100644 --- a/engines/tony/loc.cpp +++ b/engines/tony/loc.cpp @@ -356,15 +356,15 @@ void RMSprite::ReadFromStream(RMDataStream &ds, bool bLOX) { ds += 32; // Create buffer and read - m_buf->Init(ds, dimx, dimy); + m_buf->init(ds, dimx, dimy); } -void RMSprite::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { - m_buf->Draw(coroParam, bigBuf, prim); +void RMSprite::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { + m_buf->draw(coroParam, bigBuf, prim); } void RMSprite::SetPalette(byte *buf) { - ((RMGfxSourceBufferPal *)m_buf)->LoadPalette(buf); + ((RMGfxSourceBufferPal *)m_buf)->loadPalette(buf); } RMSprite::RMSprite() { @@ -500,9 +500,9 @@ RMGfxSourceBuffer *RMItem::NewItemSpriteBuffer(int dimx, int dimy, bool bPreRLE) else spr = new RMGfxSourceBuffer8RLEByteAA; - spr->SetAlphaBlendColor(m_FXparm); + spr->setAlphaBlendColor(m_FXparm); if (bPreRLE) - spr->SetAlreadyCompressed(); + spr->setAlreadyCompressed(); } else { if (dimx == -1 || dimx > 255) spr = new RMGfxSourceBuffer8RLEWord; @@ -510,7 +510,7 @@ RMGfxSourceBuffer *RMItem::NewItemSpriteBuffer(int dimx, int dimy, bool bPreRLE) spr = new RMGfxSourceBuffer8RLEByte; if (bPreRLE) - spr->SetAlreadyCompressed(); + spr->setAlreadyCompressed(); } return spr; @@ -675,8 +675,8 @@ bool RMItem::DoFrame(RMGfxTargetBuffer *bigBuf, bool bAddToList) { } // If we are not in the OT list, add ourselves - if (!m_nInList && bAddToList) - bigBuf->AddPrim(NewItemPrimitive()); + if (!_nInList && bAddToList) + bigBuf->addPrim(NewItemPrimitive()); return oldSprite != m_nCurSprite; } @@ -685,7 +685,7 @@ RMPoint RMItem::CalculatePos(void) { return m_pos + m_patterns[m_nCurPattern].Pos(); } -void RMItem::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMItem::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -696,7 +696,7 @@ void RMItem::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { return; // Set the flag - prim->SetFlag(m_bCurFlag); + prim->setFlag(m_bCurFlag); // Offset direction for scrolling prim->Dst().Offset(-m_curScroll); @@ -706,10 +706,10 @@ void RMItem::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { prim->Dst().Offset(CalculatePos()); // No stretching, please - prim->SetStrecth(false); + prim->setStrecth(false); // Now we turn to the generic surface drawing routines - CORO_INVOKE_2(m_sprites[m_nCurSprite].Draw, bigBuf, prim); + CORO_INVOKE_2(m_sprites[m_nCurSprite].draw, bigBuf, prim); CORO_END_CODE; } @@ -867,7 +867,7 @@ int RMWipe::Priority(void) { void RMWipe::Unregister(void) { RMGfxTask::Unregister(); - assert(m_nInList == 0); + assert(_nInList == 0); CoroScheduler.setEvent(m_hUnregistered); } @@ -919,7 +919,7 @@ void RMWipe::InitFade(int type) { void RMWipe::DoFrame(RMGfxTargetBuffer &bigBuf) { if (m_bMustRegister) { - bigBuf.AddPrim(new RMGfxPrimitive(this)); + bigBuf.addPrim(new RMGfxPrimitive(this)); m_bMustRegister = false; } @@ -934,18 +934,18 @@ void RMWipe::DoFrame(RMGfxTargetBuffer &bigBuf) { } } -void RMWipe::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMWipe::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); if (m_bFading) { - CORO_INVOKE_2(m_wip0r.Draw, bigBuf, prim); + CORO_INVOKE_2(m_wip0r.draw, bigBuf, prim); } if (m_bEndFade) - Common::fill((byte *)bigBuf, (byte *)bigBuf + bigBuf.Dimx() * bigBuf.Dimy() * 2, 0x0); + Common::fill((byte *)bigBuf, (byte *)bigBuf + bigBuf.getDimx() * bigBuf.getDimy() * 2, 0x0); CORO_END_CODE; } @@ -1332,7 +1332,7 @@ RMPoint RMCharacter::NearestHotSpot(int sourcebox, int destbox) { return puntocaldo; } -void RMCharacter::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMCharacter::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -1341,7 +1341,7 @@ void RMCharacter::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *pr if (bDrawNow) { prim->Dst() += m_fixedScroll; - CORO_INVOKE_2(RMItem::Draw, bigBuf, prim); + CORO_INVOKE_2(RMItem::draw, bigBuf, prim); } CORO_END_CODE; @@ -2072,7 +2072,7 @@ bool RMLocation::Load(RMDataStream &ds) { }; // Initialise the surface, loading the palette if necessary - m_buf->Init(ds, dimx, dimy, true); + m_buf->init(ds, dimx, dimy, true); // Check the size of the location // assert(dimy!=512); @@ -2119,7 +2119,7 @@ bool RMLocation::LoadLOX(RMDataStream &ds) { m_buf = new RMGfxSourceBuffer16; // Initialise the surface, loading in the palette if necessary - m_buf->Init(ds, dimx, dimy, true); + m_buf->init(ds, dimx, dimy, true); // Number of items ds >> m_nItems; @@ -2138,21 +2138,21 @@ bool RMLocation::LoadLOX(RMDataStream &ds) { /** * Draw method overloaded from RMGfxSourceBUffer8 */ -void RMLocation::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMLocation::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); // Set the position of the source scrolling - if (m_buf->Dimy() > RM_SY || m_buf->Dimx() > RM_SX) { - prim->SetSrc(RMRect(m_curScroll, m_curScroll + RMPoint(640, 480))); + if (m_buf->getDimy() > RM_SY || m_buf->getDimx() > RM_SX) { + prim->setSrc(RMRect(m_curScroll, m_curScroll + RMPoint(640, 480))); } - prim->SetDst(m_fixedScroll); + prim->setDst(m_fixedScroll); // Invoke the drawing method fo the image class, which will draw the location background - CORO_INVOKE_2(m_buf->Draw, bigBuf, prim); + CORO_INVOKE_2(m_buf->draw, bigBuf, prim); CORO_END_CODE; } @@ -2165,8 +2165,8 @@ void RMLocation::DoFrame(RMGfxTargetBuffer *bigBuf) { int i; // If the location is not in the OT list, add it in - if (!m_nInList) - bigBuf->AddPrim(new RMGfxPrimitive(this)); + if (!_nInList) + bigBuf->addPrim(new RMGfxPrimitive(this)); // Process all the location items for (i = 0; i < m_nItems; i++) @@ -2231,7 +2231,7 @@ void RMLocation::UpdateScrolling(const RMPoint &ptShowThis) { m_curScroll.x = ptShowThis.x - 250; } else if (m_curScroll.x + RM_SX - 250 < ptShowThis.x) { m_curScroll.x = ptShowThis.x + 250 - RM_SX; - } else if (ABS(m_curScroll.x + RM_SX / 2 - ptShowThis.x) > 32 && m_buf->Dimx() > RM_SX) { + } else if (ABS(m_curScroll.x + RM_SX / 2 - ptShowThis.x) > 32 && m_buf->getDimx() > RM_SX) { if (m_curScroll.x + RM_SX / 2 < ptShowThis.x) m_curScroll.x++; else @@ -2242,17 +2242,21 @@ void RMLocation::UpdateScrolling(const RMPoint &ptShowThis) { m_curScroll.y = ptShowThis.y - 180; } else if (m_curScroll.y + RM_SY - 180 < ptShowThis.y) { m_curScroll.y = ptShowThis.y + 180 - RM_SY; - } else if (ABS(m_curScroll.y + RM_SY / 2 - ptShowThis.y) > 16 && m_buf->Dimy() > RM_SY) { + } else if (ABS(m_curScroll.y + RM_SY / 2 - ptShowThis.y) > 16 && m_buf->getDimy() > RM_SY) { if (m_curScroll.y + RM_SY / 2 < ptShowThis.y) m_curScroll.y++; else m_curScroll.y--; } - if (m_curScroll.x < 0) m_curScroll.x = 0; - if (m_curScroll.y < 0) m_curScroll.y = 0; - if (m_curScroll.x + RM_SX > m_buf->Dimx()) m_curScroll.x = m_buf->Dimx() - RM_SX; - if (m_curScroll.y + RM_SY > m_buf->Dimy()) m_curScroll.y = m_buf->Dimy() - RM_SY; + if (m_curScroll.x < 0) + m_curScroll.x = 0; + if (m_curScroll.y < 0) + m_curScroll.y = 0; + if (m_curScroll.x + RM_SX > m_buf->getDimx()) + m_curScroll.x = m_buf->getDimx() - RM_SX; + if (m_curScroll.y + RM_SY > m_buf->getDimy()) + m_curScroll.y = m_buf->getDimy() - RM_SY; if (oldScroll != m_curScroll) for (int i = 0; i < m_nItems; i++) @@ -2268,10 +2272,14 @@ void RMLocation::SetFixedScroll(const RMPoint &scroll) { void RMLocation::SetScrollPosition(const RMPoint &scroll) { RMPoint pt = scroll; - if (pt.x < 0) pt.x = 0; - if (pt.y < 0) pt.y = 0; - if (pt.x + RM_SX > m_buf->Dimx()) pt.x = m_buf->Dimx() - RM_SX; - if (pt.y + RM_SY > m_buf->Dimy()) pt.y = m_buf->Dimy() - RM_SY; + if (pt.x < 0) + pt.x = 0; + if (pt.y < 0) + pt.y = 0; + if (pt.x + RM_SX > m_buf->getDimx()) + pt.x = m_buf->getDimx() - RM_SX; + if (pt.y + RM_SY > m_buf->getDimy()) + pt.y = m_buf->getDimy() - RM_SY; m_curScroll = pt; diff --git a/engines/tony/loc.h b/engines/tony/loc.h index 612e7b5d3e..c11dac4782 100644 --- a/engines/tony/loc.h +++ b/engines/tony/loc.h @@ -186,7 +186,7 @@ public: void Init(RMGfxSourceBuffer *buf); friend RMDataStream &operator>>(RMDataStream &ds, RMSprite &sprite); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); void SetPalette(byte *lpBuf); void GetSizeFromStream(RMDataStream &ds, int *dimx, int *dimy); void LOXGetSizeFromStream(RMDataStream &ds, int *dimx, int *dimy); @@ -254,7 +254,7 @@ public: virtual void RemoveThis(CORO_PARAM, bool &result); // Overloaded Draw - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // Overloaded priority: it's based on Z ordering virtual int Priority() { @@ -460,7 +460,7 @@ public: void DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int loc); // Overloaded draw - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // TRUE if you just stopped bool EndOfPath() { @@ -510,7 +510,7 @@ public: virtual ~RMWipe(); void DoFrame(RMGfxTargetBuffer &bigBuf); - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); void InitFade(int type); void CloseFade(void); @@ -566,7 +566,7 @@ public: void Unload(void); // Overloaded draw - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // Prepare a frame by drawing the location and all it's items void DoFrame(RMGfxTargetBuffer *bigBuf); diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp index 98171b2544..cc323eb5d2 100644 --- a/engines/tony/tony.cpp +++ b/engines/tony/tony.cpp @@ -104,14 +104,14 @@ Common::ErrorCode TonyEngine::init() { _startTime = g_system->getMillis(); // Init static class fields - RMText::InitStatics(); - RMTony::InitStatics(); + RMText::initStatics(); + RMTony::initStatics(); // Reset the scheduler CoroScheduler.reset(); // Initialise the graphics window - _window.Init(); + _window.init(); // Initialise the function list Common::fill(_funcList, _funcList + 300, (LPCUSTOMFUNCTION)NULL); diff --git a/engines/tony/tonychar.cpp b/engines/tony/tonychar.cpp index 419f5a251f..f135cff7c3 100644 --- a/engines/tony/tonychar.cpp +++ b/engines/tony/tonychar.cpp @@ -40,7 +40,7 @@ namespace Tony { bool RMTony::m_bAction = false; -void RMTony::InitStatics() { +void RMTony::initStatics() { m_bAction = false; } @@ -82,13 +82,13 @@ RMGfxSourceBuffer *RMTony::NewItemSpriteBuffer(int dimx, int dimy, bool bPreRLE) assert(m_cm == CM_256); spr = new RMGfxSourceBuffer8RLEByteAA; - spr->SetAlphaBlendColor(1); + spr->setAlphaBlendColor(1); if (bPreRLE) - spr->SetAlreadyCompressed(); + spr->setAlreadyCompressed(); return spr; } -void RMTony::Init(void) { +void RMTony::init(void) { RMRes tony(0); RMRes body(9999); RMDataStream ds; @@ -125,7 +125,7 @@ void RMTony::Init(void) { void RMTony::Close(void) { // Disalloca @@@ Deallocation of missing item - m_ombra.Destroy(); + m_ombra.destroy(); } void RMTony::DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int curLoc) { @@ -135,8 +135,8 @@ void RMTony::DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int curLoc) { CORO_BEGIN_CODE(_ctx); - if (!m_nInList && m_bShow) - bigBuf->AddPrim(new RMGfxPrimitive(this)); + if (!_nInList && m_bShow) + bigBuf->addPrim(new RMGfxPrimitive(this)); SetSpeed(GLOBALS.nCfgTonySpeed); @@ -172,7 +172,7 @@ void RMTony::Hide(bool bShowOmbra) { } -void RMTony::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { +void RMTony::draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { CORO_BEGIN_CONTEXT; CORO_END_CONTEXT(_ctx); @@ -185,7 +185,7 @@ void RMTony::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { prim->Dst().Offset(-44, -134); if (m_bPastorella) prim->Dst().Offset(1, 4); - CORO_INVOKE_2(RMCharacter::Draw, bigBuf, prim); + CORO_INVOKE_2(RMCharacter::draw, bigBuf, prim); } if (m_bIsTalking || m_bIsStaticTalk) { @@ -195,7 +195,7 @@ void RMTony::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { prim->Dst().Offset(m_pos); prim->Dst().Offset(-44, -134); prim->Dst() += m_nBodyOffset; - CORO_INVOKE_2(m_body.Draw, bigBuf, prim); + CORO_INVOKE_2(m_body.draw, bigBuf, prim); } if (!m_bCorpoDavanti) { @@ -203,7 +203,7 @@ void RMTony::Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim) { prim->Dst().Offset(-44, -134); if (m_bPastorella) prim->Dst().Offset(0, 3); - CORO_INVOKE_2(RMCharacter::Draw, bigBuf, prim); + CORO_INVOKE_2(RMCharacter::draw, bigBuf, prim); } } diff --git a/engines/tony/tonychar.h b/engines/tony/tonychar.h index a1c7fc152b..e7b4227fc5 100644 --- a/engines/tony/tonychar.h +++ b/engines/tony/tonychar.h @@ -358,11 +358,11 @@ public: }; public: - static void InitStatics(); + static void initStatics(); RMTony(); // Initialise Tony - void Init(void); + void init(void); // Free all memory void Close(void); @@ -371,7 +371,7 @@ public: void DoFrame(CORO_PARAM, RMGfxTargetBuffer *bigBuf, int curLoc); // Draw method, which controls chararacter display - virtual void Draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); + virtual void draw(CORO_PARAM, RMGfxTargetBuffer &bigBuf, RMGfxPrimitive *prim); // Show or hide void Show(void); diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp index 6b61d25ea2..5d73443167 100644 --- a/engines/tony/window.cpp +++ b/engines/tony/window.cpp @@ -51,7 +51,7 @@ RMWindow::~RMWindow() { /** * Initialises the graphics window */ -void RMWindow::Init() { +void RMWindow::init() { Graphics::PixelFormat pixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0); initGraphics(RM_SX, RM_SY, true, &pixelFormat); diff --git a/engines/tony/window.h b/engines/tony/window.h index 0f614fca97..70e74eb54d 100644 --- a/engines/tony/window.h +++ b/engines/tony/window.h @@ -79,8 +79,8 @@ public: ~RMWindow(); // Initialisation - void Init(/*HINSTANCE hInst*/); - void InitDirectDraw(void); + void init(/*HINSTANCE hInst*/); + void initDirectDraw(void); void Close(void); // Drawing |