Permalink
Browse files

STARTREK: Reorganize includes in room.h

This should avoid the costly rebuild of everything in the 'rooms/'
folder, at least sometimes...
  • Loading branch information...
Drenn1 authored and sev- committed Jul 28, 2018
1 parent 42b2281 commit 8970909318c158b18eb5612f26db1d4db941160f
Showing with 1,856 additions and 1,816 deletions.
  1. +1 −1 engines/startrek/awaymission.h
  2. +5 −1 engines/startrek/room.cpp
  3. +7 −1 engines/startrek/room.h
  4. +26 −26 engines/startrek/rooms/demon0.cpp
  5. +73 −73 engines/startrek/rooms/demon1.cpp
  6. +8 −8 engines/startrek/rooms/demon2.cpp
  7. +66 −66 engines/startrek/rooms/demon3.cpp
  8. +49 −48 engines/startrek/rooms/demon4.cpp
  9. +22 −22 engines/startrek/rooms/demon5.cpp
  10. +31 −30 engines/startrek/rooms/demon6.cpp
  11. +4 −4 engines/startrek/rooms/feather0.cpp
  12. +49 −49 engines/startrek/rooms/feather1.cpp
  13. +53 −53 engines/startrek/rooms/feather3.cpp
  14. +29 −29 engines/startrek/rooms/feather5.cpp
  15. +13 −13 engines/startrek/rooms/feather6.cpp
  16. +9 −9 engines/startrek/rooms/feather7.cpp
  17. +22 −22 engines/startrek/rooms/love0.cpp
  18. +61 −61 engines/startrek/rooms/love1.cpp
  19. +87 −87 engines/startrek/rooms/love2.cpp
  20. +59 −59 engines/startrek/rooms/love3.cpp
  21. +27 −27 engines/startrek/rooms/love4.cpp
  22. +47 −47 engines/startrek/rooms/love5.cpp
  23. +33 −33 engines/startrek/rooms/lovea.cpp
  24. +35 −35 engines/startrek/rooms/mudd0.cpp
  25. +31 −31 engines/startrek/rooms/mudd1.cpp
  26. +64 −64 engines/startrek/rooms/mudd2.cpp
  27. +79 −79 engines/startrek/rooms/mudd3.cpp
  28. +84 −84 engines/startrek/rooms/mudd4.cpp
  29. +27 −27 engines/startrek/rooms/mudd5.cpp
  30. +18 −18 engines/startrek/rooms/mudda.cpp
  31. +15 −15 engines/startrek/rooms/sins0.cpp
  32. +27 −27 engines/startrek/rooms/sins1.cpp
  33. +11 −11 engines/startrek/rooms/trial0.cpp
  34. +75 −75 engines/startrek/rooms/trial1.cpp
  35. +37 −37 engines/startrek/rooms/trial2.cpp
  36. +46 −46 engines/startrek/rooms/trial3.cpp
  37. +2 −2 engines/startrek/rooms/trial4.cpp
  38. +30 −30 engines/startrek/rooms/trial5.cpp
  39. +69 −69 engines/startrek/rooms/tug0.cpp
  40. +34 −34 engines/startrek/rooms/tug1.cpp
  41. +193 −193 engines/startrek/rooms/tug2.cpp
  42. +110 −110 engines/startrek/rooms/tug3.cpp
  43. +1 −60 engines/startrek/sound.h
  44. +87 −0 engines/startrek/soundeffects.h
@@ -180,7 +180,7 @@ struct AwayMission {

// 1: Decided to shoot them
// 2: Talked, and they surrendered immediately
// 3: They deorbited the ship (and perhps surrendered after)
// 3: They deorbited the ship (and perhaps surrendered after)
byte bridgeWinMethod; // 0x5e

bool talkedToBrigCrewman; // 0x5f
@@ -45,7 +45,7 @@

namespace StarTrek {

Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm) {
Room::Room(StarTrekEngine *vm, const Common::String &name) : _vm(vm), _awayMission(&vm->_awayMission) {
SharedPtr<FileStream> rdfFile = _vm->loadFile(name + ".RDF");

int size = rdfFile->size();
@@ -502,6 +502,10 @@ void Room::stopAllVocSounds() {
_vm->_sound->stopAllVocSounds();
}

Common::String Room::getCrewmanAnimFilename(int object, const Common::String &str) {
return _vm->getCrewmanAnimFilename(object, str);
}

void Room::spockScan(int direction, TextRef text, bool changeDirection) {
const char *dirs = "nsew";
Common::String anim = "sscan_";
@@ -27,8 +27,11 @@
#include "common/ptr.h"
#include "common/str.h"

#include "startrek/action.h"
#include "startrek/awaymission.h"
#include "startrek/fixedint.h"
#include "startrek/startrek.h"
#include "startrek/object.h"
#include "startrek/soundeffects.h"
#include "startrek/text.h"

using Common::SharedPtr;
@@ -141,6 +144,7 @@ class Room {

private:
StarTrekEngine *_vm;
AwayMission *_awayMission;

const RoomAction *_roomActionList;
int _numRoomActions;
@@ -252,6 +256,8 @@ class Room {

// Helper functions for repetitive stuff.

Common::String getCrewmanAnimFilename(int object, const Common::String &str);

/**
* If "changeDirection" is true, they remain facing that direction even after their
* animation is finished. The game is inconsistent about doing this.
@@ -31,42 +31,42 @@ void Room::demon0Tick1() {
}

void Room::demon0Tick2() {
if (_vm->_awayMission.demon.talkedToPrelate)
if (_awayMission->demon.talkedToPrelate)
return;
loadActorAnim(8, "prel", 120, 190, 0);
}

void Room::demon0Tick60() {
if (_vm->_awayMission.demon.talkedToPrelate)
if (_awayMission->demon.talkedToPrelate)
return;
loadActorAnim2(8, "prelclap", 120, 190, 0);
}

void Room::demon0Tick100() {
if (_vm->_awayMission.demon.talkedToPrelate || _vm->_awayMission.demon.prelateWelcomedCrew)
if (_awayMission->demon.talkedToPrelate || _awayMission->demon.prelateWelcomedCrew)
return;
_vm->_awayMission.demon.prelateWelcomedCrew = true;
_awayMission->demon.prelateWelcomedCrew = true;
showText(TX_SPEAKER_ANGIVEN, TX_DEM0_036);
}

void Room::demon0Tick140() {
if (_vm->_awayMission.demon.mccoyMentionedFlora)
if (_awayMission->demon.mccoyMentionedFlora)
return;

showText(TX_SPEAKER_MCCOY, TX_DEM0_016);

_vm->_awayMission.demon.mccoyMentionedFlora = true;
_awayMission->demon.mccoyMentionedFlora = true;
}

void Room::demon0TouchedWarp0() {
_vm->_awayMission.demon.enteredFrom = 1;
_vm->_awayMission.rdfStillDoDefaultAction = true;
_awayMission->demon.enteredFrom = 1;
_awayMission->rdfStillDoDefaultAction = true;
}

void Room::demon0WalkToBottomDoor() {
_vm->_awayMission.disableInput = 1;
_awayMission->disableInput = 1;
_roomVar.demon.movingToBottomDoor = true;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
_awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 243, 158, 1);
}

@@ -84,9 +84,9 @@ void Room::demon0ReachedBottomDoor() {
}

void Room::demon0WalkToTopDoor() {
_vm->_awayMission.disableInput = 1;
_awayMission->disableInput = 1;
_roomVar.demon.movingToTopDoor = true;
_vm->_awayMission.crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
_awayMission->crewDirectionsAfterWalk[OBJECT_KIRK] = DIR_E;
walkCrewman(OBJECT_KIRK, 157, 134, 2);
}

@@ -154,11 +154,11 @@ void Room::demon0TalkToPrelate() {
TX_BLANK
};

if (_vm->_awayMission.demon.talkedToPrelate)
if (_awayMission->demon.talkedToPrelate)
return;

_vm->_awayMission.demon.missionScore += 3;
_vm->_awayMission.demon.talkedToPrelate = true;
_awayMission->demon.missionScore += 3;
_awayMission->demon.talkedToPrelate = true;

const int *response = nullptr;

@@ -187,7 +187,7 @@ void Room::demon0TalkToPrelate() {

showText(thirdResponse);

if (_vm->_awayMission.demon.wasRudeToPrelate)
if (_awayMission->demon.wasRudeToPrelate)
showText(badConclusion);
else
showText(goodConclusion);
@@ -209,7 +209,7 @@ void Room::demon0UsePhaserOnSign() {
void Room::demon0UsePhaserOnShelter() {
showText(TX_SPEAKER_MCCOY, TX_DEM0_015);
showText(TX_SPEAKER_SPOCK, TX_DEM0_013);
if (!_vm->_awayMission.redshirtDead)
if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_EVERTS, TX_DEM0_040);
}

@@ -274,15 +274,15 @@ void Room::demon0TalkToRedshirt() {
}

void Room::demon0TalkToMcCoy() {
if (_vm->_awayMission.demon.talkedToPrelate) {
if (_awayMission->demon.talkedToPrelate) {
showText(TX_SPEAKER_KIRK, TX_DEM0_011);
showText(TX_SPEAKER_MCCOY, TX_DEM0_023);
showText(TX_SPEAKER_SPOCK, TX_DEM0_029);
if (!_vm->_awayMission.redshirtDead)
if (!_awayMission->redshirtDead)
showText(TX_SPEAKER_EVERTS, TX_DEM0_041);
} else {
showText(TX_SPEAKER_MCCOY, TX_DEM0_019);
if (!_vm->_awayMission.demon.askedPrelateAboutSightings) {
if (!_awayMission->demon.askedPrelateAboutSightings) {
demon0AskPrelateAboutSightings();
}
}
@@ -291,15 +291,15 @@ void Room::demon0TalkToMcCoy() {
void Room::demon0TalkToSpock() {
showText(TX_SPEAKER_SPOCK, TX_DEM0_014);

if (!_vm->_awayMission.demon.talkedToPrelate && !_vm->_awayMission.demon.askedPrelateAboutSightings)
if (!_awayMission->demon.talkedToPrelate && !_awayMission->demon.askedPrelateAboutSightings)
demon0AskPrelateAboutSightings();
}

void Room::demon0AskPrelateAboutSightings() {
showText(TX_SPEAKER_KIRK, TX_DEM0_001);
showText(TX_SPEAKER_ANGIVEN, TX_DEM0_030);

_vm->_awayMission.demon.askedPrelateAboutSightings = true;
_awayMission->demon.askedPrelateAboutSightings = true;
}

void Room::demon0UseSTricorderAnywhere() {
@@ -318,19 +318,19 @@ void Room::demon0UseMTricorderOnPrelate() {
loadActorAnim2(OBJECT_MCCOY, "mscans", -1, -1, 0);
playSoundEffectIndex(0x04);

if (_vm->_awayMission.demon.talkedToPrelate)
if (_awayMission->demon.talkedToPrelate)
showText(TX_SPEAKER_MCCOY, TX_DEM0_018);
else
showText(TX_SPEAKER_MCCOY, TX_DEM0_022);
}

// Helper functions
void Room::demon0BadResponse() {
if (_vm->_awayMission.demon.wasRudeToPrelate)
if (_awayMission->demon.wasRudeToPrelate)
return;

_vm->_awayMission.demon.missionScore -= 3;
_vm->_awayMission.demon.wasRudeToPrelate = true;
_awayMission->demon.missionScore -= 3;
_awayMission->demon.wasRudeToPrelate = true;

showText(TX_SPEAKER_ANGIVEN, TX_DEM0_033);
}
Oops, something went wrong.

0 comments on commit 8970909

Please sign in to comment.