DREAMWEB: Remove getDestInfo() from locationPic

This allows to move some more functions into DreamBase
This commit is contained in:
Filippos Karapetis 2011-12-25 19:48:49 +02:00
parent 95ffd7f4ce
commit 6dbc930b18
4 changed files with 22 additions and 27 deletions

View file

@ -181,6 +181,9 @@ public:
void readCityPic(); void readCityPic();
void readDestIcon(); void readDestIcon();
void showCity(); void showCity();
void locationPic();
void selectLocation();
void newPlace();
// from object.cpp // from object.cpp
void obIcons(); void obIcons();
@ -569,6 +572,7 @@ public:
void edensCDPlayer(); void edensCDPlayer();
void hotelBell(); void hotelBell();
void playGuitar(); void playGuitar();
void useElevator1();
void useElevator2(); void useElevator2();
void useElevator3(); void useElevator3();
void useElevator4(); void useElevator4();

View file

@ -24,7 +24,7 @@
namespace DreamGen { namespace DreamGen {
void DreamGenContext::newPlace() { void DreamBase::newPlace() {
if (data.byte(kNeedtotravel) == 1) { if (data.byte(kNeedtotravel) == 1) {
data.byte(kNeedtotravel) = 0; data.byte(kNeedtotravel) = 0;
selectLocation(); selectLocation();
@ -34,8 +34,7 @@ void DreamGenContext::newPlace() {
} }
} }
// TODO: Move to DreamBase once getDestInfo is moved void DreamBase::selectLocation() {
void DreamGenContext::selectLocation() {
data.byte(kInmaparea) = 0; data.byte(kInmaparea) = 0;
clearBeforeLoad(); clearBeforeLoad();
data.byte(kGetback) = 0; data.byte(kGetback) = 0;
@ -142,7 +141,20 @@ void DreamBase::putUnderCentre() {
multiPut(mapStore(), 58, 72, 254, 110); multiPut(mapStore(), 58, 72, 254, 110);
} }
// TODO: put Locationpic here void DreamBase::locationPic() {
byte destFlag = data.byte(553 + data.byte(kDestpos));
if (destFlag >= 6)
showFrame(tempGraphics2(), 104, 138 + 14, destFlag - 6, 0); // Second slot
else
showFrame(tempGraphics(), 104, 138 + 14, destFlag + 4, 0);
if (data.byte(kDestpos) == data.byte(kReallocation))
showFrame(tempGraphics(), 104, 140 + 14, 3, 0); // Currently in this location
uint16 offset = kTextstart + getSegment(data.word(kTraveltext)).word(data.byte(kDestpos) * 2);
const uint8 *string = getSegment(data.word(kTraveltext)).ptr(offset, 0);
DreamBase::printDirect(string, 50, 20, 241, 241 & 1);
}
// TODO: put Getdestinfo here // TODO: put Getdestinfo here
@ -270,20 +282,4 @@ void DreamBase::readCityPic() {
loadIntoTemp("DREAMWEB.G04"); loadIntoTemp("DREAMWEB.G04");
} }
void DreamGenContext::locationPic() {
getDestInfo();
byte destFlag = es.byte(si);
if (destFlag >= 6)
showFrame(tempGraphics2(), 104, 138 + 14, destFlag - 6, 0); // Second slot
else
showFrame(tempGraphics(), 104, 138 + 14, destFlag + 4, 0);
if (data.byte(kDestpos) == data.byte(kReallocation))
showFrame(tempGraphics(), 104, 140 + 14, 3, 0); // Currently in this location
uint16 offset = kTextstart + getSegment(data.word(kTraveltext)).word(data.byte(kDestpos) * 2);
const uint8 *string = getSegment(data.word(kTraveltext)).ptr(offset, 0);
DreamBase::printDirect(string, 50, 20, 241, 241 & 1);
}
} // End of namespace DreamGen } // End of namespace DreamGen

View file

@ -123,7 +123,6 @@
void autoLook(); void autoLook();
void doLook(); void doLook();
void enterSymbol(); void enterSymbol();
void useElevator1();
void useKey(); void useKey();
void useObject(); void useObject();
void singleKey(uint8 key, uint16 x, uint16 y); void singleKey(uint8 key, uint16 x, uint16 y);
@ -162,7 +161,6 @@
void decide(); void decide();
void showGun(); void showGun();
void endGame(); void endGame();
void newPlace();
void monkSpeaking(); void monkSpeaking();
void rollEndCredits2(); void rollEndCredits2();
void triggerMessage(uint16 index); void triggerMessage(uint16 index);
@ -188,9 +186,7 @@
void inToInv(); void inToInv();
void outOfInv(); void outOfInv();
void selectOpenOb(); void selectOpenOb();
void selectLocation();
void reExFromInv(); void reExFromInv();
void locationPic();
void useOpened(); void useOpened();
void outOfOpen(); void outOfOpen();
void swapWithOpen(); void swapWithOpen();

View file

@ -39,7 +39,7 @@ void DreamGenContext::useRoutine() {
static const UseListEntry kUseList[] = { static const UseListEntry kUseList[] = {
{ &DreamGenContext::useMon, "NETW" }, { &DreamGenContext::useMon, "NETW" },
{ &DreamGenContext::useElevator1, "ELVA" }, { &DreamBase::useElevator1, "ELVA" },
{ &DreamBase::useElevator2, "ELVB" }, { &DreamBase::useElevator2, "ELVB" },
{ &DreamBase::useElevator3, "ELVC" }, { &DreamBase::useElevator3, "ELVC" },
{ &DreamBase::useElevator4, "ELVE" }, { &DreamBase::useElevator4, "ELVE" },
@ -242,8 +242,7 @@ void DreamBase::playGuitar() {
putBackObStuff(); putBackObStuff();
} }
// TODO: Move to DreamBase once selectLocation (in reality, getDestInfo) is moved void DreamBase::useElevator1() {
void DreamGenContext::useElevator1() {
showFirstUse(); showFirstUse();
selectLocation(); selectLocation();
data.byte(kGetback) = 1; data.byte(kGetback) = 1;