PETKA: fixed compilation

This commit is contained in:
Andrei Prykhodko 2019-08-25 21:58:00 +03:00 committed by Eugene Sandulenko
parent 1599f21861
commit 139bb33f32
11 changed files with 42 additions and 39 deletions

@ -97,6 +97,17 @@ enum Opcode {
class QMessageObject;
struct QMessage {
QMessage() {}
QMessage(uint16 objId, uint16 opcode, uint16 arg1, int16 arg2, int16 arg3, QMessageObject *sender, int unk) {
this->objId = objId;
this->opcode = opcode;
this->arg1 = arg1;
this->arg2 = arg2;
this->arg3 = arg3;
this->sender = sender;
this->unk = unk;
}
uint16 objId;
uint16 opcode;
uint16 arg1;

@ -95,7 +95,7 @@ void BigDialogue::loadSpeechesInfo() {
char *curr = str;
file->read(str, file->size() - file->pos());
for (uint i = 0; i < _speeches.size(); ++i) {
_speeches[i].text = Common::convertToU32String(curr, Common::CodePage::kWindows1251);
_speeches[i].text = Common::convertToU32String(curr, Common::kWindows1251);
curr += strlen(curr) + 1;
}
delete[] str;

@ -53,7 +53,7 @@ protected:
private:
Common::Rect _bounds;
Common::Array<Common::Array<Common::Rect>> _msk;
Common::Array<Common::Array<Common::Rect> > _msk;
};
};

@ -110,7 +110,7 @@ void DialogInterface::sub_4155D0(int a) {
if (talkerId != talkerId2) {
sendMsg(kSay);
}
g_vm->getQSystem()->_mainInterface->setText(info->text, _talker->_dialogColor);
//g_vm->getQSystem()->_mainInterface->setText(info->text, _talker->_dialogColor);
_field18 = 1;
break;
}
@ -129,15 +129,7 @@ void DialogInterface::sub_4155D0(int a) {
void DialogInterface::sendMsg(uint16 opcode) {
if (_talker) {
QMessage msg;
msg.objId = _talker->_id;
msg.opcode = opcode;
msg.arg1 = 0;
msg.arg2 = 0;
msg.arg3 = 0;
msg.unk = 0;
msg.sender = nullptr;
_talker->processMessage(msg);
_talker->processMessage(QMessage(_talker->_id, opcode, 0, 0, 0, nullptr, 0));
}
}

@ -40,12 +40,12 @@ namespace Petka {
// ПАНЕЛЬ УПРАВЛЕНИЯ
const char *const kPanelObjName = "\xCF\xC0\xCD\xC5\xCB\xDC\x20\xD3\xCF\xD0\xC0\xC2\xCB\xC5\xCD\xC8\xDF";
const Common::Point kObjectsPoints[] = {{0, 2}, {5, 70}, {5, 136}, {22, 328},
{87, 224}, {118, 395}, {467, 71}, {432, 144},
{428, 29}, {434, 170}, {297, 214}, {470, 139},
{318, 87}, {468, 172}, {262, 31}, {231, 137},
{0, 0}, {0, 0}, {0, 0}, {0, 0},
{0, 0}, {0, 0}, {0, 0}, {0, 0}};
const Common::Point kObjectsPoints[] = {Common::Point(0, 2), Common::Point(5, 70), Common::Point(5, 136), Common::Point(22, 328),
Common::Point(87, 224), Common::Point(118, 395), Common::Point(467, 71), Common::Point(432, 144),
Common::Point(428, 29), Common::Point(434, 170), Common::Point(297, 214), Common::Point(470, 139),
Common::Point(318, 87), Common::Point(468, 172), Common::Point(262, 31), Common::Point(231, 137),
Common::Point(0, 0), Common::Point(0, 0), Common::Point(0, 0), Common::Point(0, 0),
Common::Point(0, 0), Common::Point(0, 0), Common::Point(0, 0), Common::Point(0, 0)};
const uint kNewGameButtonIndex = 1;
const uint kLoadButtonIndex = 2;

@ -30,9 +30,9 @@
namespace Petka {
const uint kFirstSaveLoadPageId = 4990;
const Common::Rect kSavesRects[] = {{43, 84, 151, 166}, {43, 209, 151, 291},
{43, 335, 151, 417}, {358, 75, 466, 157},
{360, 200, 468, 282}, {359, 325, 467, 407}};
const Common::Rect kSavesRects[] = {Common::Rect(43, 84, 151, 166), Common::Rect(43, 209, 151, 291),
Common::Rect(43, 335, 151, 417), Common::Rect(358, 75, 466, 157),
Common::Rect(360, 200, 468, 282), Common::Rect(359, 325, 467, 407)};
const Common::Rect kNextPageRect(596, 403, 624, 431);
const Common::Rect kPrevPageRect(10, 414, 38, 442);

@ -56,7 +56,7 @@ void InterfaceStartup::start() {
QObjectBG *bg = (QObjectBG *)g_vm->getQSystem()->findObject(kStartupObjName);
_objs.push_back(bg);
Sound *s = g_vm->soundMgr()->addSound(g_vm->resMgr()->findSoundName(bg->_musicId), Audio::Mixer::SoundType::kMusicSoundType);
Sound *s = g_vm->soundMgr()->addSound(g_vm->resMgr()->findSoundName(bg->_musicId), Audio::Mixer::kMusicSoundType);
s->play(true);
const Common::Array<BGInfo> &infos = g_vm->getQSystem()->_mainInterface->_bgs;

@ -192,7 +192,7 @@ void QObjectPetka::updateWalk() {
_isWalking = false;
setPos(_destX, _destY);
QMessage msg {_id, kSet, (uint16)_imageId, 1, 0, nullptr, 0};
QMessage msg(_id, kSet, (uint16)_imageId, 1, 0, nullptr, 0);
if (_heroReaction) {
uint i;
for (i = 0; i < _heroReaction->messages.size(); ++i) {
@ -204,10 +204,10 @@ void QObjectPetka::updateWalk() {
initSurface();
processMessage(QMessage {_id, kAnimate, 0, 0, 0, nullptr, 0});
processMessage(QMessage(_id, kAnimate, 0, 0, 0, nullptr, 0));
_heroReaction->messages.push_back(msg);
_heroReaction->messages.push_back(QMessage {_id, kAnimate, 1, 0, 0, nullptr, 0});
_heroReaction->messages.push_back(QMessage(_id, kAnimate, 1, 0, 0, nullptr, 0));
break;
}
}
@ -227,7 +227,7 @@ void QObjectPetka::setReactionAfterWalk(uint index, QReaction **reaction, QMessa
stopWalk();
QMessage msg {_id, kWalked, 0, 0, 0, sender, 0};
QMessage msg(_id, kWalked, 0, 0, 0, sender, 0);
_heroReaction = new QReaction();
_sender = sender;
@ -252,7 +252,7 @@ void QObjectPetka::stopWalk() {
_isWalking = false;
_msgProcessingPaused = false;
Common::List<QMessage> &list = g_vm->getQSystem()->_messages;
Common::List<QMessage> &list = g_vm->getQSystem()->_messages;
for (Common::List<QMessage>::iterator it = list.begin(); it != list.end();) {
if (it->opcode == kWalked && it->objId == _id) {
it->objId = -1;
@ -264,7 +264,7 @@ void QObjectPetka::stopWalk() {
_heroReaction = nullptr;
if (!_field7C) {
QMessage msg {_id, kSet, (uint16)_imageId, 1, 0, nullptr, 0};
QMessage msg(_id, kSet, (uint16)_imageId, 1, 0, nullptr, 0);
processMessage(msg);
}
}

@ -34,8 +34,8 @@ namespace Petka {
// Полоска в чемодане
const char *const kPoloska = "\xCF\xEE\xEB\xEE\xF1\xEA\xE0\x20\xE2\x20\xF7\xE5\xEC\xEE\xE4\xE0\xED\xE5";
const Common::Point itemsLocation[] = {{120, 145}, {240, 145}, {360, 145},
{100, 220}, {240, 220}, {380, 220}};
const Common::Point itemsLocation[] = {Common::Point(120, 145), Common::Point(240, 145), Common::Point(360, 145),
Common::Point(100, 220), Common::Point(240, 220), Common::Point(380, 220)};
QObjectCase::QObjectCase() {
_itemIndex = 0;

@ -35,12 +35,12 @@ namespace Petka {
const uint kFirstCursorId = 5001;
const uint kCaseButtonIndex = 0;
const Common::Rect kButtonsRects[] = {{70, 74, 112, 112},
{68, 0, 114, 41},
{151, 51, 180, 97},
{138, 125, 179, 166},
{55, 145, 96, 175},
{11, 79, 40, 118}};
const Common::Rect kButtonsRects[] = {Common::Rect(70, 74, 112, 112),
Common::Rect(68, 0, 114, 41),
Common::Rect(151, 51, 180, 97),
Common::Rect(138, 125, 179, 166),
Common::Rect(55, 145, 96, 175),
Common::Rect(11, 79, 40, 118)};
static uint findButtonIndex(int16 x, int16 y) {
uint i = 0;

@ -86,7 +86,7 @@ static void readObject(QMessageObject &obj, Common::SeekableReadStream &stream,
if (castIni.getKey(obj._name, "all", rgbString)) {
int r, g, b;
sscanf(rgbString.c_str(), "%d %d %d", &r, &g, &b);
obj._dialogColor = Graphics::RGBToColor<Graphics::ColorMasks<888>>((byte)r, (byte)g, (byte)b);
obj._dialogColor = Graphics::RGBToColor<Graphics::ColorMasks<888> >((byte)r, (byte)g, (byte)b);
}
}
@ -181,12 +181,12 @@ void QSystem::addMessage(const QMessage &msg) {
}
void QSystem::addMessage(uint16 objId, uint16 opcode, int16 arg1, int16 arg2, int16 arg3, int32 unk, QMessageObject *sender) {
_messages.push_back({objId, opcode, arg1, arg2, arg3, sender, unk});
_messages.push_back(QMessage(objId, opcode, arg1, arg2, arg3, sender, unk));
}
void QSystem::addMessageForAllObjects(uint16 opcode, int16 arg1, int16 arg2, int16 arg3, int32 unk, QMessageObject *sender) {
for (uint i = 0; i < _allObjects.size(); ++i) {
_messages.push_back({_allObjects[i]->_id, opcode, arg1, arg2, arg3, sender, unk});
_messages.push_back(QMessage(_allObjects[i]->_id, opcode, arg1, arg2, arg3, sender, unk));
}
}