PRIVATE: remove more pointers
This commit is contained in:
parent
b089f42329
commit
82b331decf
3 changed files with 157 additions and 132 deletions
|
@ -125,29 +125,33 @@ void fQuit(ArgArray args) {
|
||||||
void fLoadGame(ArgArray args) {
|
void fLoadGame(ArgArray args) {
|
||||||
// assert types
|
// assert types
|
||||||
debugC(1, kPrivateDebugScript, "LoadGame(%s, %s)", args[0].u.str, args[2].u.sym->name->c_str());
|
debugC(1, kPrivateDebugScript, "LoadGame(%s, %s)", args[0].u.str, args[2].u.sym->name->c_str());
|
||||||
MaskInfo *m = (MaskInfo *)malloc(sizeof(MaskInfo));
|
MaskInfo m = {};
|
||||||
m->surf = g_private->loadMask(args[0].u.str, 0, 0, true);
|
m.surf = g_private->loadMask(args[0].u.str, 0, 0, true);
|
||||||
m->cursor = args[2].u.sym->name;
|
m.cursor = *args[2].u.sym->name;
|
||||||
m->nextSetting = NULL;
|
m.nextSetting = "";
|
||||||
m->flag1 = NULL;
|
m.flag1 = NULL;
|
||||||
m->flag2 = NULL;
|
m.flag2 = NULL;
|
||||||
free(g_private->_loadGameMask);
|
if (g_private->_loadGameMask.surf)
|
||||||
|
g_private->_loadGameMask.surf->free();
|
||||||
|
delete g_private->_loadGameMask.surf;
|
||||||
g_private->_loadGameMask = m;
|
g_private->_loadGameMask = m;
|
||||||
g_private->_masks.push_front(*m);
|
g_private->_masks.push_front(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fSaveGame(ArgArray args) {
|
void fSaveGame(ArgArray args) {
|
||||||
// assert types
|
// assert types
|
||||||
debugC(1, kPrivateDebugScript, "SaveGame(%s, %s)", args[0].u.str, args[1].u.sym->name->c_str());
|
debugC(1, kPrivateDebugScript, "SaveGame(%s, %s)", args[0].u.str, args[1].u.sym->name->c_str());
|
||||||
MaskInfo *m = (MaskInfo *)malloc(sizeof(MaskInfo));
|
MaskInfo m = {};
|
||||||
m->surf = g_private->loadMask(args[0].u.str, 0, 0, true);
|
m.surf = g_private->loadMask(args[0].u.str, 0, 0, true);
|
||||||
m->cursor = args[1].u.sym->name;
|
m.cursor = *args[1].u.sym->name;
|
||||||
m->nextSetting = NULL;
|
m.nextSetting = "";
|
||||||
m->flag1 = NULL;
|
m.flag1 = NULL;
|
||||||
m->flag2 = NULL;
|
m.flag2 = NULL;
|
||||||
free(g_private->_saveGameMask);
|
if (g_private->_saveGameMask.surf)
|
||||||
|
g_private->_saveGameMask.surf->free();
|
||||||
|
delete g_private->_saveGameMask.surf;
|
||||||
g_private->_saveGameMask = m;
|
g_private->_saveGameMask = m;
|
||||||
g_private->_masks.push_front(*m);
|
g_private->_masks.push_front(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fRestartGame(ArgArray args) {
|
void fRestartGame(ArgArray args) {
|
||||||
|
@ -232,35 +236,35 @@ void fDossierChgSheet(ArgArray args) {
|
||||||
void fDossierPrevSuspect(ArgArray args) {
|
void fDossierPrevSuspect(ArgArray args) {
|
||||||
assert (args.size() == 3);
|
assert (args.size() == 3);
|
||||||
Common::String s(args[0].u.str);
|
Common::String s(args[0].u.str);
|
||||||
MaskInfo *m = (MaskInfo *)malloc(sizeof(MaskInfo));
|
MaskInfo m = {};
|
||||||
|
|
||||||
int x = args[1].u.val;
|
int x = args[1].u.val;
|
||||||
int y = args[2].u.val;
|
int y = args[2].u.val;
|
||||||
|
|
||||||
m->surf = g_private->loadMask(s, x, y, true);
|
m.surf = g_private->loadMask(s, x, y, true);
|
||||||
m->cursor = new Common::String("kExit");
|
m.cursor = "kExit";
|
||||||
m->nextSetting = NULL;
|
m.nextSetting = "";
|
||||||
m->flag1 = NULL;
|
m.flag1 = NULL;
|
||||||
m->flag2 = NULL;
|
m.flag2 = NULL;
|
||||||
g_private->_dossierPrevSuspectMask = m;
|
g_private->_dossierPrevSuspectMask = m;
|
||||||
g_private->_masks.push_front(*m);
|
g_private->_masks.push_front(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fDossierNextSuspect(ArgArray args) {
|
void fDossierNextSuspect(ArgArray args) {
|
||||||
assert (args.size() == 3);
|
assert (args.size() == 3);
|
||||||
Common::String s(args[0].u.str);
|
Common::String s(args[0].u.str);
|
||||||
MaskInfo *m = (MaskInfo *)malloc(sizeof(MaskInfo));
|
MaskInfo m = {};
|
||||||
|
|
||||||
int x = args[1].u.val;
|
int x = args[1].u.val;
|
||||||
int y = args[2].u.val;
|
int y = args[2].u.val;
|
||||||
|
|
||||||
m->surf = g_private->loadMask(s, x, y, true);
|
m.surf = g_private->loadMask(s, x, y, true);
|
||||||
m->cursor = new Common::String("kExit");
|
m.cursor = "kExit";
|
||||||
m->nextSetting = NULL;
|
m.nextSetting = "";
|
||||||
m->flag1 = NULL;
|
m.flag1 = NULL;
|
||||||
m->flag2 = NULL;
|
m.flag2 = NULL;
|
||||||
g_private->_dossierNextSuspectMask = m;
|
g_private->_dossierNextSuspectMask = m;
|
||||||
g_private->_masks.push_front(*m);
|
g_private->_masks.push_front(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fNoStopSounds(ArgArray args) {
|
void fNoStopSounds(ArgArray args) {
|
||||||
|
@ -300,28 +304,28 @@ void fInventory(ArgArray args) {
|
||||||
debugC(1, kPrivateDebugScript, "Inventory(...)");
|
debugC(1, kPrivateDebugScript, "Inventory(...)");
|
||||||
Common::String mask(b1.u.str);
|
Common::String mask(b1.u.str);
|
||||||
if (mask != "\"\"") {
|
if (mask != "\"\"") {
|
||||||
MaskInfo *m = (MaskInfo *)malloc(sizeof(MaskInfo));
|
MaskInfo m = {};
|
||||||
m->surf = g_private->loadMask(mask, 0, 0, true);
|
m.surf = g_private->loadMask(mask, 0, 0, true);
|
||||||
|
|
||||||
if (e.type == NUM)
|
if (e.type == NUM)
|
||||||
m->nextSetting = NULL;
|
m.nextSetting = "";
|
||||||
else
|
else
|
||||||
m->nextSetting = new Common::String(e.u.str);
|
m.nextSetting = *e.u.str;
|
||||||
|
|
||||||
m->cursor = new Common::String("kInventory");
|
m.cursor = "kInventory";
|
||||||
m->point = new Common::Point(0,0);
|
m.point = Common::Point(0,0);
|
||||||
|
|
||||||
if (v1.type == NAME)
|
if (v1.type == NAME)
|
||||||
m->flag1 = v1.u.sym;
|
m.flag1 = v1.u.sym;
|
||||||
else
|
else
|
||||||
m->flag1 = NULL;
|
m.flag1 = NULL;
|
||||||
|
|
||||||
if (v2.type == NAME)
|
if (v2.type == NAME)
|
||||||
m->flag2 = v2.u.sym;
|
m.flag2 = v2.u.sym;
|
||||||
else
|
else
|
||||||
m->flag2 = NULL;
|
m.flag2 = NULL;
|
||||||
|
|
||||||
g_private->_masks.push_front(*m);
|
g_private->_masks.push_front(m);
|
||||||
g_private->_toTake = true;
|
g_private->_toTake = true;
|
||||||
Common::String sound(snd.u.str);
|
Common::String sound(snd.u.str);
|
||||||
|
|
||||||
|
@ -531,14 +535,14 @@ void _fMask(ArgArray args, bool drawn) {
|
||||||
debugC(1, kPrivateDebugScript, "Mask(%s, %s, %s, %d, %d)", f, e, c->c_str(), x, y);
|
debugC(1, kPrivateDebugScript, "Mask(%s, %s, %s, %d, %d)", f, e, c->c_str(), x, y);
|
||||||
const Common::String s(f);
|
const Common::String s(f);
|
||||||
|
|
||||||
MaskInfo *m = (MaskInfo *)malloc(sizeof(MaskInfo));
|
MaskInfo m = {};
|
||||||
m->surf = g_private->loadMask(s, x, y, drawn);
|
m.surf = g_private->loadMask(s, x, y, drawn);
|
||||||
m->nextSetting = new Common::String(e);
|
m.nextSetting = e;
|
||||||
m->cursor = c;
|
m.cursor = *c;
|
||||||
m->flag1 = NULL;
|
m.flag1 = NULL;
|
||||||
m->flag2 = NULL;
|
m.flag2 = NULL;
|
||||||
m->point = new Common::Point(x,y);
|
m.point = Common::Point(x,y);
|
||||||
g_private->_masks.push_front(*m);
|
g_private->_masks.push_front(m);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -615,37 +619,40 @@ void fSoundArea(ArgArray args) {
|
||||||
|
|
||||||
debugC(1, kPrivateDebugScript, "SoundArea(%s, %s, ..)", args[0].u.str, n.c_str());
|
debugC(1, kPrivateDebugScript, "SoundArea(%s, %s, ..)", args[0].u.str, n.c_str());
|
||||||
Common::String s = args[0].u.str;
|
Common::String s = args[0].u.str;
|
||||||
|
MaskInfo m = {};
|
||||||
if (n == "kAMRadio") {
|
if (n == "kAMRadio") {
|
||||||
MaskInfo *m = (MaskInfo *)malloc(sizeof(MaskInfo));
|
m.surf = g_private->loadMask(s, 0, 0, true);
|
||||||
m->surf = g_private->loadMask(s, 0, 0, true);
|
m.cursor = *args[2].u.sym->name;
|
||||||
m->cursor = args[2].u.sym->name;
|
m.nextSetting = "";
|
||||||
m->nextSetting = NULL;
|
m.flag1 = NULL;
|
||||||
m->flag1 = NULL;
|
m.flag2 = NULL;
|
||||||
m->flag2 = NULL;
|
if (g_private->_AMRadioArea.surf)
|
||||||
free(g_private->_AMRadioArea);
|
g_private->_AMRadioArea.surf->free();
|
||||||
|
delete g_private->_AMRadioArea.surf;
|
||||||
g_private->_AMRadioArea = m;
|
g_private->_AMRadioArea = m;
|
||||||
g_private->_masks.push_front(*m);
|
g_private->_masks.push_front(m);
|
||||||
} else if (n == "kPoliceRadio") {
|
} else if (n == "kPoliceRadio") {
|
||||||
MaskInfo *m = (MaskInfo *)malloc(sizeof(MaskInfo));
|
m.surf = g_private->loadMask(s, 0, 0, true);
|
||||||
m->surf = g_private->loadMask(s, 0, 0, true);
|
m.cursor = *args[2].u.sym->name;
|
||||||
m->cursor = args[2].u.sym->name;
|
m.nextSetting = "";
|
||||||
m->nextSetting = NULL;
|
m.flag1 = NULL;
|
||||||
m->flag1 = NULL;
|
m.flag2 = NULL;
|
||||||
m->flag2 = NULL;
|
if (g_private->_policeRadioArea.surf)
|
||||||
free(g_private->_policeRadioArea);
|
g_private->_policeRadioArea.surf->free();
|
||||||
|
delete g_private->_policeRadioArea.surf;
|
||||||
g_private->_policeRadioArea = m;
|
g_private->_policeRadioArea = m;
|
||||||
g_private->_masks.push_front(*m);
|
g_private->_masks.push_front(m);
|
||||||
} else if (n == "kPhone") {
|
} else if (n == "kPhone") {
|
||||||
MaskInfo *m = (MaskInfo *)malloc(sizeof(MaskInfo));
|
m.surf = g_private->loadMask(s, 0, 0, true);
|
||||||
m->surf = g_private->loadMask(s, 0, 0, true);
|
m.cursor = *args[2].u.sym->name;
|
||||||
m->cursor = args[2].u.sym->name;
|
m.nextSetting = "";
|
||||||
m->nextSetting = NULL;
|
m.flag1 = NULL;
|
||||||
m->flag1 = NULL;
|
m.flag2 = NULL;
|
||||||
m->flag2 = NULL;
|
if (g_private->_phoneArea.surf)
|
||||||
free(g_private->_phoneArea);
|
g_private->_phoneArea.surf->free();
|
||||||
|
delete g_private->_phoneArea.surf;
|
||||||
g_private->_phoneArea = m;
|
g_private->_phoneArea = m;
|
||||||
g_private->_masks.push_front(*m);
|
g_private->_masks.push_front(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,8 +73,8 @@ PrivateEngine::PrivateEngine(OSystem *syst, const ADGameDescription *gd)
|
||||||
_repeatedMovieExit = "";
|
_repeatedMovieExit = "";
|
||||||
|
|
||||||
// Save and load
|
// Save and load
|
||||||
_saveGameMask = NULL;
|
_saveGameMask = {};
|
||||||
_loadGameMask = NULL;
|
_loadGameMask = {};
|
||||||
|
|
||||||
// Interface
|
// Interface
|
||||||
_framePath = "inface/general/inface2.bmp";
|
_framePath = "inface/general/inface2.bmp";
|
||||||
|
@ -90,9 +90,9 @@ PrivateEngine::PrivateEngine(OSystem *syst, const ADGameDescription *gd)
|
||||||
_noStopSounds = false;
|
_noStopSounds = false;
|
||||||
|
|
||||||
// Radios and phone
|
// Radios and phone
|
||||||
_policeRadioArea = NULL;
|
_policeRadioArea = {};
|
||||||
_AMRadioArea = NULL;
|
_AMRadioArea = {};
|
||||||
_phoneArea = NULL;
|
_phoneArea = {};
|
||||||
// TODO: use this as a default sound for radio
|
// TODO: use this as a default sound for radio
|
||||||
_infaceRadioPath = "inface/radio/";
|
_infaceRadioPath = "inface/radio/";
|
||||||
_phonePrefix = "inface/telephon/";
|
_phonePrefix = "inface/telephon/";
|
||||||
|
@ -101,8 +101,8 @@ PrivateEngine::PrivateEngine(OSystem *syst, const ADGameDescription *gd)
|
||||||
// Dossiers
|
// Dossiers
|
||||||
_dossierPage = 0;
|
_dossierPage = 0;
|
||||||
_dossierSuspect = 0;
|
_dossierSuspect = 0;
|
||||||
_dossierNextSuspectMask = NULL;
|
_dossierNextSuspectMask = {};
|
||||||
_dossierPrevSuspectMask = NULL;
|
_dossierPrevSuspectMask = {};
|
||||||
|
|
||||||
// Diary
|
// Diary
|
||||||
_diaryLocPrefix = "inface/diary/loclist/";
|
_diaryLocPrefix = "inface/diary/loclist/";
|
||||||
|
@ -302,20 +302,40 @@ void PrivateEngine::clearAreas() {
|
||||||
_exits.clear();
|
_exits.clear();
|
||||||
_masks.clear();
|
_masks.clear();
|
||||||
|
|
||||||
free(_loadGameMask);
|
if (_loadGameMask.surf)
|
||||||
_loadGameMask = NULL;
|
_loadGameMask.surf->free();
|
||||||
free(_saveGameMask);
|
delete _loadGameMask.surf;
|
||||||
_saveGameMask = NULL;
|
_loadGameMask = {};
|
||||||
free(_policeRadioArea);
|
|
||||||
_policeRadioArea = NULL;
|
if (_saveGameMask.surf)
|
||||||
free(_AMRadioArea);
|
_saveGameMask.surf->free();
|
||||||
_AMRadioArea = NULL;
|
delete _saveGameMask.surf;
|
||||||
free(_phoneArea);
|
_saveGameMask = {};
|
||||||
_phoneArea = NULL;
|
|
||||||
free(_dossierNextSuspectMask);
|
if (_policeRadioArea.surf)
|
||||||
_dossierNextSuspectMask = NULL;
|
_policeRadioArea.surf->free();
|
||||||
free(_dossierPrevSuspectMask);
|
delete _policeRadioArea.surf;
|
||||||
_dossierPrevSuspectMask = NULL;
|
_policeRadioArea = {};
|
||||||
|
|
||||||
|
if (_AMRadioArea.surf)
|
||||||
|
_AMRadioArea.surf->free();
|
||||||
|
delete _AMRadioArea.surf;
|
||||||
|
_AMRadioArea = {};
|
||||||
|
|
||||||
|
if (_phoneArea.surf)
|
||||||
|
_phoneArea.surf->free();
|
||||||
|
delete _phoneArea.surf;
|
||||||
|
_phoneArea = {};
|
||||||
|
|
||||||
|
if (_dossierNextSuspectMask.surf)
|
||||||
|
_dossierNextSuspectMask.surf->free();
|
||||||
|
delete _dossierNextSuspectMask.surf;
|
||||||
|
_dossierNextSuspectMask = {};
|
||||||
|
|
||||||
|
if (_dossierPrevSuspectMask.surf)
|
||||||
|
_dossierPrevSuspectMask.surf->free();
|
||||||
|
delete _dossierPrevSuspectMask.surf;
|
||||||
|
_dossierPrevSuspectMask = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrivateEngine::startPoliceBust() {
|
void PrivateEngine::startPoliceBust() {
|
||||||
|
@ -411,9 +431,9 @@ bool PrivateEngine::cursorMask(Common::Point mousePos) {
|
||||||
m = *it;
|
m = *it;
|
||||||
|
|
||||||
if (inMask(m.surf, mousePos)) {
|
if (inMask(m.surf, mousePos)) {
|
||||||
if (m.cursor != NULL) { // TODO: check this
|
if (!m.cursor.empty()) { // TODO: check this
|
||||||
inside = true;
|
inside = true;
|
||||||
changeCursor(*m.cursor);
|
changeCursor(m.cursor);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -478,14 +498,14 @@ void PrivateEngine::selectExit(Common::Point mousePos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrivateEngine::selectMask(Common::Point mousePos) {
|
void PrivateEngine::selectMask(Common::Point mousePos) {
|
||||||
Common::String *ns = NULL;
|
Common::String ns = "";
|
||||||
MaskInfo m;
|
MaskInfo m;
|
||||||
for (MaskList::iterator it = _masks.begin(); it != _masks.end(); ++it) {
|
for (MaskList::iterator it = _masks.begin(); it != _masks.end(); ++it) {
|
||||||
m = *it;
|
m = *it;
|
||||||
//debug("Testing mask %s", m.nextSetting->c_str());
|
//debug("Testing mask %s", m.nextSetting->c_str());
|
||||||
if (inMask(m.surf, mousePos)) {
|
if (inMask(m.surf, mousePos)) {
|
||||||
//debug("Inside!");
|
//debug("Inside!");
|
||||||
if (m.nextSetting != NULL) { // TODO: check this
|
if (!m.nextSetting.empty()) { // TODO: check this
|
||||||
//debug("Found Mask %s", m.nextSetting->c_str());
|
//debug("Found Mask %s", m.nextSetting->c_str());
|
||||||
ns = m.nextSetting;
|
ns = m.nextSetting;
|
||||||
}
|
}
|
||||||
|
@ -505,21 +525,20 @@ void PrivateEngine::selectMask(Common::Point mousePos) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ns != NULL) {
|
if (!ns.empty()) {
|
||||||
//debug("Mask selected %s", ns->c_str());
|
//debug("Mask selected %s", ns->c_str());
|
||||||
_nextSetting = *ns;
|
_nextSetting = ns;
|
||||||
//setNextSetting(new Common::String(*ns));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrivateEngine::selectAMRadioArea(Common::Point mousePos) {
|
void PrivateEngine::selectAMRadioArea(Common::Point mousePos) {
|
||||||
if (_AMRadioArea == NULL)
|
if (_AMRadioArea.surf == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_AMRadio.empty())
|
if (_AMRadio.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (inMask(_AMRadioArea->surf, mousePos)) {
|
if (inMask(_AMRadioArea.surf, mousePos)) {
|
||||||
Common::String sound = _infaceRadioPath + "comm_/" + _AMRadio.back() + ".wav";
|
Common::String sound = _infaceRadioPath + "comm_/" + _AMRadio.back() + ".wav";
|
||||||
playSound(sound, 1, false, false);
|
playSound(sound, 1, false, false);
|
||||||
_AMRadio.pop_back();
|
_AMRadio.pop_back();
|
||||||
|
@ -527,13 +546,13 @@ void PrivateEngine::selectAMRadioArea(Common::Point mousePos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrivateEngine::selectPoliceRadioArea(Common::Point mousePos) {
|
void PrivateEngine::selectPoliceRadioArea(Common::Point mousePos) {
|
||||||
if (_policeRadioArea == NULL)
|
if (_policeRadioArea.surf == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_policeRadio.empty())
|
if (_policeRadio.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (inMask(_policeRadioArea->surf, mousePos)) {
|
if (inMask(_policeRadioArea.surf, mousePos)) {
|
||||||
Common::String sound = _infaceRadioPath + "police/" + _policeRadio.back() + ".wav";
|
Common::String sound = _infaceRadioPath + "police/" + _policeRadio.back() + ".wav";
|
||||||
playSound(sound, 1, false, false);
|
playSound(sound, 1, false, false);
|
||||||
_policeRadio.pop_back();
|
_policeRadio.pop_back();
|
||||||
|
@ -541,7 +560,7 @@ void PrivateEngine::selectPoliceRadioArea(Common::Point mousePos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrivateEngine::checkPhoneCall() {
|
void PrivateEngine::checkPhoneCall() {
|
||||||
if (_phoneArea == NULL)
|
if (_phoneArea.surf == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_phone.empty())
|
if (_phone.empty())
|
||||||
|
@ -552,13 +571,13 @@ void PrivateEngine::checkPhoneCall() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrivateEngine::selectPhoneArea(Common::Point mousePos) {
|
void PrivateEngine::selectPhoneArea(Common::Point mousePos) {
|
||||||
if (_phoneArea == NULL)
|
if (_phoneArea.surf == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_phone.empty())
|
if (_phone.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (inMask(_phoneArea->surf, mousePos)) {
|
if (inMask(_phoneArea.surf, mousePos)) {
|
||||||
PhoneInfo i = _phone.back();
|
PhoneInfo i = _phone.back();
|
||||||
setSymbol(i.flag, i.val);
|
setSymbol(i.flag, i.val);
|
||||||
Common::String sound = _phonePrefix + i.sound + ".wav";
|
Common::String sound = _phonePrefix + i.sound + ".wav";
|
||||||
|
@ -582,16 +601,16 @@ void PrivateEngine::loadDossier() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PrivateEngine::selectDossierNextSuspect(Common::Point mousePos) {
|
bool PrivateEngine::selectDossierNextSuspect(Common::Point mousePos) {
|
||||||
if (_dossierNextSuspectMask == NULL)
|
if (_dossierNextSuspectMask.surf == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (inMask(_dossierNextSuspectMask->surf, mousePos)) {
|
if (inMask(_dossierNextSuspectMask.surf, mousePos)) {
|
||||||
if ((_dossierSuspect + 1) < _dossiers.size()) {
|
if ((_dossierSuspect + 1) < _dossiers.size()) {
|
||||||
_dossierSuspect++;
|
_dossierSuspect++;
|
||||||
_dossierPage = 0;
|
_dossierPage = 0;
|
||||||
loadDossier();
|
loadDossier();
|
||||||
drawMask(_dossierNextSuspectMask->surf);
|
drawMask(_dossierNextSuspectMask.surf);
|
||||||
drawMask(_dossierPrevSuspectMask->surf);
|
drawMask(_dossierPrevSuspectMask.surf);
|
||||||
drawScreen();
|
drawScreen();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -600,16 +619,16 @@ bool PrivateEngine::selectDossierNextSuspect(Common::Point mousePos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PrivateEngine::selectDossierPrevSuspect(Common::Point mousePos) {
|
bool PrivateEngine::selectDossierPrevSuspect(Common::Point mousePos) {
|
||||||
if (_dossierPrevSuspectMask == NULL)
|
if (_dossierPrevSuspectMask.surf == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (inMask(_dossierPrevSuspectMask->surf, mousePos)) {
|
if (inMask(_dossierPrevSuspectMask.surf, mousePos)) {
|
||||||
if (_dossierSuspect > 0) {
|
if (_dossierSuspect > 0) {
|
||||||
_dossierSuspect--;
|
_dossierSuspect--;
|
||||||
_dossierPage = 0;
|
_dossierPage = 0;
|
||||||
loadDossier();
|
loadDossier();
|
||||||
drawMask(_dossierNextSuspectMask->surf);
|
drawMask(_dossierNextSuspectMask.surf);
|
||||||
drawMask(_dossierPrevSuspectMask->surf);
|
drawMask(_dossierPrevSuspectMask.surf);
|
||||||
drawScreen();
|
drawScreen();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -618,22 +637,21 @@ bool PrivateEngine::selectDossierPrevSuspect(Common::Point mousePos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrivateEngine::selectLoadGame(Common::Point mousePos) {
|
void PrivateEngine::selectLoadGame(Common::Point mousePos) {
|
||||||
if (_loadGameMask == NULL)
|
if (_loadGameMask.surf == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (inMask(_loadGameMask->surf, mousePos)) {
|
if (inMask(_loadGameMask.surf, mousePos)) {
|
||||||
loadGameDialog();
|
loadGameDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrivateEngine::selectSaveGame(Common::Point mousePos) {
|
void PrivateEngine::selectSaveGame(Common::Point mousePos) {
|
||||||
if (_saveGameMask == NULL)
|
if (_saveGameMask.surf == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (inMask(_saveGameMask->surf, mousePos)) {
|
if (inMask(_saveGameMask.surf, mousePos)) {
|
||||||
saveGameDialog();
|
saveGameDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PrivateEngine::hasFeature(EngineFeature f) const {
|
bool PrivateEngine::hasFeature(EngineFeature f) const {
|
||||||
|
|
|
@ -84,11 +84,11 @@ typedef struct ExitInfo {
|
||||||
|
|
||||||
typedef struct MaskInfo {
|
typedef struct MaskInfo {
|
||||||
Graphics::ManagedSurface *surf;
|
Graphics::ManagedSurface *surf;
|
||||||
Common::String *nextSetting;
|
Common::String nextSetting;
|
||||||
Common::Point *point;
|
Common::Point point;
|
||||||
Symbol *flag1;
|
Symbol *flag1;
|
||||||
Symbol *flag2;
|
Symbol *flag2;
|
||||||
Common::String *cursor;
|
Common::String cursor;
|
||||||
} MaskInfo;
|
} MaskInfo;
|
||||||
|
|
||||||
typedef struct PhoneInfo {
|
typedef struct PhoneInfo {
|
||||||
|
@ -228,8 +228,8 @@ public:
|
||||||
DossierArray _dossiers;
|
DossierArray _dossiers;
|
||||||
unsigned int _dossierSuspect;
|
unsigned int _dossierSuspect;
|
||||||
unsigned int _dossierPage;
|
unsigned int _dossierPage;
|
||||||
MaskInfo *_dossierNextSuspectMask;
|
MaskInfo _dossierNextSuspectMask;
|
||||||
MaskInfo *_dossierPrevSuspectMask;
|
MaskInfo _dossierPrevSuspectMask;
|
||||||
bool selectDossierNextSuspect(Common::Point);
|
bool selectDossierNextSuspect(Common::Point);
|
||||||
bool selectDossierPrevSuspect(Common::Point);
|
bool selectDossierPrevSuspect(Common::Point);
|
||||||
void loadDossier();
|
void loadDossier();
|
||||||
|
@ -251,8 +251,8 @@ public:
|
||||||
void loadInventory(uint32, Common::Rect *, Common::Rect *);
|
void loadInventory(uint32, Common::Rect *, Common::Rect *);
|
||||||
|
|
||||||
// Save/Load games
|
// Save/Load games
|
||||||
MaskInfo *_saveGameMask;
|
MaskInfo _saveGameMask;
|
||||||
MaskInfo *_loadGameMask;
|
MaskInfo _loadGameMask;
|
||||||
|
|
||||||
int _mode;
|
int _mode;
|
||||||
bool _modified;
|
bool _modified;
|
||||||
|
@ -280,9 +280,9 @@ public:
|
||||||
|
|
||||||
// Radios
|
// Radios
|
||||||
Common::String _infaceRadioPath;
|
Common::String _infaceRadioPath;
|
||||||
MaskInfo *_AMRadioArea;
|
MaskInfo _AMRadioArea;
|
||||||
MaskInfo *_policeRadioArea;
|
MaskInfo _policeRadioArea;
|
||||||
MaskInfo *_phoneArea;
|
MaskInfo _phoneArea;
|
||||||
Common::String _phonePrefix;
|
Common::String _phonePrefix;
|
||||||
Common::String _phoneCallSound;
|
Common::String _phoneCallSound;
|
||||||
SoundList _AMRadio;
|
SoundList _AMRadio;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue