2016-02-23 20:59:57 -05:00
|
|
|
/* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-02-25 08:48:21 -05:00
|
|
|
#include "titanic/core/game_object.h"
|
|
|
|
#include "titanic/core/resource_key.h"
|
2016-02-23 20:59:57 -05:00
|
|
|
|
|
|
|
namespace Titanic {
|
|
|
|
|
2016-02-24 23:14:49 -05:00
|
|
|
CGameObject::CGameObject(): CNamedItem() {
|
2016-03-21 20:53:49 -04:00
|
|
|
_bounds = Rect(0, 0, 15, 15);
|
2016-02-24 23:14:49 -05:00
|
|
|
_field34 = 0;
|
|
|
|
_field38 = 0;
|
|
|
|
_field3C = 0;
|
|
|
|
_field40 = 0;
|
|
|
|
_field44 = 0xF0;
|
|
|
|
_field48 = 0xF0;
|
|
|
|
_field4C = 0xFF;
|
|
|
|
_field50 = 0;
|
|
|
|
_field54 = 0;
|
|
|
|
_field58 = 0;
|
|
|
|
_field5C = 1;
|
|
|
|
_field60 = 0;
|
2016-03-19 18:19:45 -04:00
|
|
|
_cursorId = 1;
|
2016-02-24 23:14:49 -05:00
|
|
|
_field78 = 0;
|
|
|
|
_field8C = -1;
|
|
|
|
_field90 = 0;
|
|
|
|
_field94 = 0;
|
|
|
|
_field98 = 0;
|
|
|
|
_field9C = 0;
|
|
|
|
_fieldA0 = 0;
|
|
|
|
_fieldA4 = 0;
|
|
|
|
_fieldA8 = nullptr;
|
|
|
|
_fieldB8 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CGameObject::save(SimpleFile *file, int indent) const {
|
|
|
|
file->writeNumberLine(7, indent);
|
|
|
|
error("TODO: CGameObject::save");
|
|
|
|
|
|
|
|
CNamedItem::save(file, indent);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CGameObject::load(SimpleFile *file) {
|
|
|
|
int val = file->readNumber();
|
|
|
|
CResourceKey resourceKey;
|
|
|
|
|
|
|
|
switch (val) {
|
|
|
|
case 7:
|
|
|
|
_clipList2.load(file);
|
|
|
|
_field8C = file->readNumber();
|
|
|
|
// Deliberate fall-through
|
|
|
|
|
|
|
|
case 6:
|
2016-03-19 18:19:45 -04:00
|
|
|
val = _cursorId = file->readNumber();
|
2016-02-24 23:14:49 -05:00
|
|
|
// Deliberate fall-through
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
_clipList1.load(file);
|
|
|
|
// Deliberate fall-through
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
_field60 = file->readNumber();
|
|
|
|
// Deliberate fall-through
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
_field40 = file->readNumber();
|
|
|
|
// Deliberate fall-through
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
_string = file->readString();
|
|
|
|
// Deliberate fall-through
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
_bounds = file->readRect();
|
|
|
|
_field34 = file->readFloat();
|
|
|
|
_field38 = file->readFloat();
|
|
|
|
_field3C = file->readFloat();
|
|
|
|
_field44 = file->readNumber();
|
|
|
|
_field48 = file->readNumber();
|
|
|
|
_field4C = file->readNumber();
|
|
|
|
_fieldB8 = file->readNumber();
|
|
|
|
_field5C = file->readNumber();
|
|
|
|
_field50 = file->readNumber();
|
|
|
|
_field54 = file->readNumber();
|
|
|
|
_field58 = file->readNumber();
|
|
|
|
|
|
|
|
resourceKey.load(file);
|
|
|
|
_fieldA8 = nullptr;
|
|
|
|
val = file->readNumber();
|
|
|
|
if (val) {
|
|
|
|
_string = resourceKey.getString();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
CNamedItem::load(file);
|
|
|
|
}
|
|
|
|
|
2016-03-14 20:03:32 -04:00
|
|
|
void CGameObject::fn2() {
|
|
|
|
error("TODO");
|
|
|
|
}
|
|
|
|
|
2016-03-21 20:53:49 -04:00
|
|
|
bool CGameObject::checkPoint(const Point &pt, int v0, int v1) {
|
2016-03-19 18:19:45 -04:00
|
|
|
warning("TODO: CGameObject::checkPoint");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-03-21 22:44:55 -04:00
|
|
|
void CGameObject::draw(CScreenManager *screenManager) {
|
|
|
|
warning("TODO: CGameObject::draw");
|
|
|
|
}
|
|
|
|
|
2016-02-23 20:59:57 -05:00
|
|
|
} // End of namespace Titanic
|