mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 17:57:14 +00:00
TITANIC: Finsihed remaining PET Remote methods
This commit is contained in:
parent
a4b746d24e
commit
934787b19b
@ -178,7 +178,19 @@ void CPetRemote::enter(PetArea oldArea) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CPetRemote::enterRoom(CRoomItem *room) {
|
void CPetRemote::enterRoom(CRoomItem *room) {
|
||||||
// TODO
|
clearGlyphs();
|
||||||
|
|
||||||
|
if (room) {
|
||||||
|
CString roomName = room->getName();
|
||||||
|
int roomIndex = roomIndexOf(roomName);
|
||||||
|
if (roomIndex != -1) {
|
||||||
|
Common::Array<uint> indexes;
|
||||||
|
if (getRemoteData(roomIndex, indexes)) {
|
||||||
|
loadGlyphs(indexes);
|
||||||
|
_items.scrollToStart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CPetText *CPetRemote::getText() {
|
CPetText *CPetRemote::getText() {
|
||||||
@ -298,17 +310,19 @@ int CPetRemote::roomIndexOf(const CString &name) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPetRemote::getRemoteData(int roomIndex, Common::Array<uint> &indexes) {
|
bool CPetRemote::getRemoteData(int roomIndex, Common::Array<uint> &indexes) {
|
||||||
const byte *p = &REMOTE_DATA[0];
|
const byte *p = &REMOTE_DATA[0];
|
||||||
for (int idx = 0; idx < TOTAL_ROOMS; ++idx) {
|
for (int idx = 0; idx < TOTAL_ROOMS; ++idx) {
|
||||||
if (*p == roomIndex) {
|
if (*p == roomIndex) {
|
||||||
for (int ctr = 0; ctr < *p; ++ctr)
|
for (int ctr = 0; ctr < *p; ++ctr)
|
||||||
indexes.push_back(p[ctr + 1]);
|
indexes.push_back(p[ctr + 1]);
|
||||||
return;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
p += *(p + 1) + 2;
|
p += *(p + 1) + 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CPetRemote::loadGlyphs(const Common::Array<uint> &indexes) {
|
bool CPetRemote::loadGlyphs(const Common::Array<uint> &indexes) {
|
||||||
|
@ -70,7 +70,7 @@ private:
|
|||||||
/**
|
/**
|
||||||
* Return a list of remote action glyph indexes for a given room
|
* Return a list of remote action glyph indexes for a given room
|
||||||
*/
|
*/
|
||||||
void getRemoteData(int roomIndex, Common::Array<uint> &indexes);
|
bool getRemoteData(int roomIndex, Common::Array<uint> &indexes);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear the list of rooms glyphs
|
* Clear the list of rooms glyphs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user