From 5c902685fc2f3f97ee3fd9250480801ac849bf02 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 31 Mar 2016 13:05:17 -0400 Subject: TITANIC: Rename CPetGraphic to CPetGfxElement to avoid naming clash --- engines/titanic/module.mk | 2 +- .../titanic/pet_control/pet_control_list_item.h | 4 +- engines/titanic/pet_control/pet_control_sub10.h | 6 +- engines/titanic/pet_control/pet_control_sub5.h | 12 +-- .../titanic/pet_control/pet_conversation_section.h | 24 +++--- engines/titanic/pet_control/pet_frame.h | 16 ++-- engines/titanic/pet_control/pet_gfx_element.cpp | 90 ++++++++++++++++++++++ engines/titanic/pet_control/pet_gfx_element.h | 70 +++++++++++++++++ engines/titanic/pet_control/pet_graphic.cpp | 90 ---------------------- engines/titanic/pet_control/pet_graphic.h | 70 ----------------- engines/titanic/pet_control/pet_remote_section.h | 24 +++--- engines/titanic/pet_control/pet_rooms_section.h | 2 +- 12 files changed, 205 insertions(+), 205 deletions(-) create mode 100644 engines/titanic/pet_control/pet_gfx_element.cpp create mode 100644 engines/titanic/pet_control/pet_gfx_element.h delete mode 100644 engines/titanic/pet_control/pet_graphic.cpp delete mode 100644 engines/titanic/pet_control/pet_graphic.h (limited to 'engines') diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index 4eebf04aaf..9f9257db75 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -385,7 +385,7 @@ MODULE_OBJS := \ pet_control/pet_conversation_section.o \ pet_control/pet_element.o \ pet_control/pet_frame.o \ - pet_control/pet_graphic.o \ + pet_control/pet_gfx_element.o \ pet_control/pet_inventory_section.o \ pet_control/pet_rooms_section.o \ pet_control/pet_remote_section.o \ diff --git a/engines/titanic/pet_control/pet_control_list_item.h b/engines/titanic/pet_control/pet_control_list_item.h index e8210714c1..caa9a0d6b1 100644 --- a/engines/titanic/pet_control/pet_control_list_item.h +++ b/engines/titanic/pet_control/pet_control_list_item.h @@ -24,13 +24,13 @@ #define TITANIC_PET_CONTROL_LIST_ITEM_H #include "titanic/core/list.h" -#include "titanic/pet_control/pet_graphic.h" +#include "titanic/pet_control/pet_gfx_element.h" namespace Titanic { class CPetControlListItem : public ListItem { protected: - CPetGraphic _val; + CPetGfxElement _val; int _field30; public: CPetControlListItem() : _field30(0) {} diff --git a/engines/titanic/pet_control/pet_control_sub10.h b/engines/titanic/pet_control/pet_control_sub10.h index a6f863cb15..e31937865b 100644 --- a/engines/titanic/pet_control/pet_control_sub10.h +++ b/engines/titanic/pet_control/pet_control_sub10.h @@ -37,9 +37,9 @@ protected: int _field1C; int _field20; int _field24; - CPetGraphic _val1; - CPetGraphic _val2; - CPetGraphic _val3; + CPetGfxElement _val1; + CPetGfxElement _val2; + CPetGfxElement _val3; public: CPetControlSub10(); diff --git a/engines/titanic/pet_control/pet_control_sub5.h b/engines/titanic/pet_control/pet_control_sub5.h index f82a1eb3f1..088ba6fd27 100644 --- a/engines/titanic/pet_control/pet_control_sub5.h +++ b/engines/titanic/pet_control/pet_control_sub5.h @@ -25,20 +25,20 @@ #include "titanic/pet_control/pet_section.h" #include "titanic/pet_control/pet_control_sub12.h" -#include "titanic/pet_control/pet_graphic.h" +#include "titanic/pet_control/pet_gfx_element.h" namespace Titanic { class CPetControlSub5 : public CPetSection { private: - CPetGraphic _val1; - CPetGraphic _val2; - CPetGraphic _val3; - CPetGraphic _val4; + CPetGfxElement _val1; + CPetGfxElement _val2; + CPetGfxElement _val3; + CPetGfxElement _val4; int _field98; int _field9C; int _fieldA0; - CPetGraphic _valArray1[6]; + CPetGfxElement _valArray1[6]; int _field17C; int _field18C; CPetControlSub12 _sub12; diff --git a/engines/titanic/pet_control/pet_conversation_section.h b/engines/titanic/pet_control/pet_conversation_section.h index 15d57e7272..863a0d99e2 100644 --- a/engines/titanic/pet_control/pet_conversation_section.h +++ b/engines/titanic/pet_control/pet_conversation_section.h @@ -25,24 +25,24 @@ #include "titanic/pet_control/pet_section.h" #include "titanic/pet_control/pet_control_sub12.h" -#include "titanic/pet_control/pet_graphic.h" +#include "titanic/pet_control/pet_gfx_element.h" namespace Titanic { class CPetConversationSection : public CPetSection { private: - CPetGraphic _val1; - CPetGraphic _val2; - CPetGraphic _val3; - CPetGraphic _valArray1[3]; - CPetGraphic _val4; - CPetGraphic _val5; - CPetGraphic _val6; + CPetGfxElement _val1; + CPetGfxElement _val2; + CPetGfxElement _val3; + CPetGfxElement _valArray1[3]; + CPetGfxElement _val4; + CPetGfxElement _val5; + CPetGfxElement _val6; int _field14C; - CPetGraphic _val7; - CPetGraphic _val8; - CPetGraphic _val9; - CPetGraphic _valArray2[9]; + CPetGfxElement _val7; + CPetGfxElement _val8; + CPetGfxElement _val9; + CPetGfxElement _valArray2[9]; int _field30C; CPetControlSub12 _sub1; CPetControlSub12 _sub2; diff --git a/engines/titanic/pet_control/pet_frame.h b/engines/titanic/pet_control/pet_frame.h index e307a73901..83543ef87c 100644 --- a/engines/titanic/pet_control/pet_frame.h +++ b/engines/titanic/pet_control/pet_frame.h @@ -24,7 +24,7 @@ #define TITANIC_PET_FRAME_H #include "titanic/pet_control/pet_section.h" -#include "titanic/pet_control/pet_graphic.h" +#include "titanic/pet_control/pet_gfx_element.h" namespace Titanic { @@ -32,13 +32,13 @@ class CPetFrame : public CPetSection { private: static int _indexes[6]; - CPetGraphic _modeButtons[6]; - CPetGraphic _titles[6]; - CPetGraphic _modeBackground; - CPetGraphic _val2; - CPetGraphic _val3; - CPetGraphic _background; - CPetGraphic _indent[7]; + CPetGfxElement _modeButtons[6]; + CPetGfxElement _titles[6]; + CPetGfxElement _modeBackground; + CPetGfxElement _val2; + CPetGfxElement _val3; + CPetGfxElement _background; + CPetGfxElement _indent[7]; private: /** * Called to set the owning PET instance and set some initial state diff --git a/engines/titanic/pet_control/pet_gfx_element.cpp b/engines/titanic/pet_control/pet_gfx_element.cpp new file mode 100644 index 0000000000..bec54b9c28 --- /dev/null +++ b/engines/titanic/pet_control/pet_gfx_element.cpp @@ -0,0 +1,90 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "common/textconsole.h" +#include "titanic/core/game_object.h" +#include "titanic/pet_control/pet_element.h" +#include "titanic/pet_control/pet_control.h" + +namespace Titanic { + +void CPetGfxElement::setup(PetElementMode mode, const CString &name, + CPetControl *petControl) { + switch (mode) { + case MODE_0: + _object0 = petControl->getHiddenObject(name); + break; + case MODE_1: + _object1 = petControl->getHiddenObject(name); + break; + case MODE_2: + _object2 = petControl->getHiddenObject(name); + break; + default: + break; + } +} + +void CPetGfxElement::setup() { + error("TODO"); +} + +void CPetGfxElement::draw(CScreenManager *screenManager) { + draw(screenManager, Common::Point(_bounds.left, _bounds.top)); +} + +void CPetGfxElement::draw(CScreenManager *screenManager, const Common::Point &destPos) { + CGameObject *obj = getObject(); + if (!obj) + obj = _object0; + + if (obj) + obj->draw(screenManager, destPos); +} + +void CPetGfxElement::getBounds(Rect *rect) { + if (rect) { + CGameObject *obj = getObject(); + if (!obj) + obj = _object0; + + if (obj && obj->getSurface45()) + *rect = _bounds; + else + rect->clear(); + } +} + +CGameObject *CPetGfxElement::getObject() const { + switch (_mode) { + case MODE_0: + return _object0; + case MODE_1: + return _object1; + case MODE_2: + return _object2; + default: + return nullptr; + } +} + +} // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_gfx_element.h b/engines/titanic/pet_control/pet_gfx_element.h new file mode 100644 index 0000000000..47720cf81a --- /dev/null +++ b/engines/titanic/pet_control/pet_gfx_element.h @@ -0,0 +1,70 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PET_GFX_ELEMENT_H +#define TITANIC_PET_GFX_ELEMENT_H + +#include "titanic/pet_control/pet_element.h" + +namespace Titanic { + +class CPetGfxElement: public CPetElement { +protected: + CGameObject *_object0; + CGameObject *_object1; + CGameObject *_object2; +public: + CPetGfxElement() : CPetElement(), _object0(nullptr), _object1(nullptr), + _object2(nullptr) {} + + /** + * Load an object into the element + */ + virtual void setup(PetElementMode mode, const CString &name, + CPetControl *petControl); + + virtual void setup(); + + /** + * Draw the item + */ + virtual void draw(CScreenManager *screenManager); + + /** + * Draw the item + */ + virtual void draw(CScreenManager *screenManager, const Common::Point &destPos); + + /** + * Get the bounds for the element + */ + virtual void getBounds(Rect *rect); + + /** + * Get the game object associated with this item + */ + virtual CGameObject *getObject() const; +}; + +} // End of namespace Titanic + +#endif /* TITANIC_PET_GFX_ELEMENT_H */ diff --git a/engines/titanic/pet_control/pet_graphic.cpp b/engines/titanic/pet_control/pet_graphic.cpp deleted file mode 100644 index c9fd5f5af1..0000000000 --- a/engines/titanic/pet_control/pet_graphic.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "common/textconsole.h" -#include "titanic/core/game_object.h" -#include "titanic/pet_control/pet_graphic.h" -#include "titanic/pet_control/pet_control.h" - -namespace Titanic { - -void CPetGraphic::loadObject(PetElementMode mode, const CString &name, - CPetControl *petControl) { - switch (mode) { - case MODE_0: - _object0 = petControl->getHiddenObject(name); - break; - case MODE_1: - _object1 = petControl->getHiddenObject(name); - break; - case MODE_2: - _object2 = petControl->getHiddenObject(name); - break; - default: - break; - } -} - -void CPetGraphic::proc2() { - error("TODO"); -} - -void CPetGraphic::draw(CScreenManager *screenManager) { - draw(screenManager, Common::Point(_bounds.left, _bounds.top)); -} - -void CPetGraphic::draw(CScreenManager *screenManager, const Common::Point &destPos) { - CGameObject *obj = getObject(); - if (!obj) - obj = _object0; - - if (obj) - obj->draw(screenManager, destPos); -} - -void CPetGraphic::getBounds(Rect *rect) { - if (rect) { - CGameObject *obj = getObject(); - if (!obj) - obj = _object0; - - if (obj && obj->getSurface45()) - *rect = _bounds; - else - rect->clear(); - } -} - -CGameObject *CPetGraphic::getObject() const { - switch (_mode) { - case MODE_0: - return _object0; - case MODE_1: - return _object1; - case MODE_2: - return _object2; - default: - return nullptr; - } -} - -} // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_graphic.h b/engines/titanic/pet_control/pet_graphic.h deleted file mode 100644 index 8b9c495205..0000000000 --- a/engines/titanic/pet_control/pet_graphic.h +++ /dev/null @@ -1,70 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef TITANIC_PET_GRAPHIC_H -#define TITANIC_PET_GRAPHIC_H - -#include "titanic/pet_control/pet_element.h" - -namespace Titanic { - -class CPetGraphic: public CPetElement { -protected: - CGameObject *_object0; - CGameObject *_object1; - CGameObject *_object2; -public: - CPetGraphic() : CPetElement(), _object0(nullptr), _object1(nullptr), - _object2(nullptr) {} - - /** - * Load an object into the element - */ - virtual void loadObject(PetElementMode mode, const CString &name, - CPetControl *petControl); - - virtual void proc2(); - - /** - * Draw the item - */ - virtual void draw(CScreenManager *screenManager); - - /** - * Draw the item - */ - virtual void draw(CScreenManager *screenManager, const Common::Point &destPos); - - /** - * Get the bounds for the element - */ - virtual void getBounds(Rect *rect); - - /** - * Get the game object associated with this item - */ - virtual CGameObject *getObject() const; -}; - -} // End of namespace Titanic - -#endif /* TITANIC_PET_GRAPHIC_H */ diff --git a/engines/titanic/pet_control/pet_remote_section.h b/engines/titanic/pet_control/pet_remote_section.h index 6a3d1cd429..562579dc50 100644 --- a/engines/titanic/pet_control/pet_remote_section.h +++ b/engines/titanic/pet_control/pet_remote_section.h @@ -26,24 +26,24 @@ #include "titanic/pet_control/pet_section.h" #include "titanic/pet_control/pet_control_sub10.h" #include "titanic/pet_control/pet_control_sub12.h" -#include "titanic/pet_control/pet_graphic.h" +#include "titanic/pet_control/pet_gfx_element.h" namespace Titanic { class CPetRemoteSection : public CPetSection { private: CPetControlSub10 _sub10; - CPetGraphic _val1; - CPetGraphic _val2; - CPetGraphic _val3; - CPetGraphic _val4; - CPetGraphic _val5; - CPetGraphic _val6; - CPetGraphic _val7; - CPetGraphic _val8; - CPetGraphic _val9; - CPetGraphic _val10; - CPetGraphic _val11; + CPetGfxElement _val1; + CPetGfxElement _val2; + CPetGfxElement _val3; + CPetGfxElement _val4; + CPetGfxElement _val5; + CPetGfxElement _val6; + CPetGfxElement _val7; + CPetGfxElement _val8; + CPetGfxElement _val9; + CPetGfxElement _val10; + CPetGfxElement _val11; CPetControlSub12 _sub12; public: diff --git a/engines/titanic/pet_control/pet_rooms_section.h b/engines/titanic/pet_control/pet_rooms_section.h index fc26c340cf..66c6e8cc0a 100644 --- a/engines/titanic/pet_control/pet_rooms_section.h +++ b/engines/titanic/pet_control/pet_rooms_section.h @@ -42,7 +42,7 @@ private: int _field114; int _field118; int _field11C; - CPetGraphic _val1; + CPetGfxElement _val1; CPetControlSub12 _sub12; int _field1C0; int _field1C4; -- cgit v1.2.3