cleanup (removed irrevelant comments and useless XXX'ed code)

svn-id: r13214
This commit is contained in:
Gregory Montoir 2004-03-07 10:46:02 +00:00
parent f1c730d27b
commit ec5f7b87c6
15 changed files with 50 additions and 214 deletions

View File

@ -613,18 +613,11 @@ void Command::grabSelectedItem() {
}
void Command::grabSelectedNoun() {
// if the NOUN has been selected from screen then it is positive
// otherwise it has been selected from inventory and is negative
// set PARSE to TRUE, default FALSE if command half complete
// click object without a command, if DEFAULT then
// do that, otherwise do a WALK!
ObjectData *od = findObjectData(_state.noun);
if (od == NULL || od->name <= 0) {
// selected a turned off object, so just walk
clear(true);
_state.noun = 0;
// _vm->logic()->newRoom(0);
_vm->logic()->joeWalk(JWM_EXECUTE);
return;
}
@ -633,15 +626,12 @@ void Command::grabSelectedNoun() {
if (_mouseKey == Input::MOUSE_LBUTTON) {
if ((_state.commandLevel != 2 && _state.action == VERB_NONE) ||
(_state.commandLevel == 2 && _parse)) {
// action2 > 0 only if command has been constructed
// lmb pressed, just walk
_state.verb = VERB_WALK_TO;
_state.action = VERB_WALK_TO;
_cmdText.setVerb(VERB_WALK_TO);
}
} else if (_mouseKey == Input::MOUSE_RBUTTON) {
if (_cmdText.isEmpty()) {
// Ensures that Right Mkey will select correct default
_state.verb = State::findDefaultVerb(od->state);
_state.selAction = (_state.verb == VERB_NONE) ? VERB_WALK_TO : _state.verb;
_cmdText.setVerb(_state.selAction);
@ -906,7 +896,6 @@ void Command::openOrCloseAssociatedObject(Verb action, int16 otherObj) {
if (cmdList->match(action, otherObj, 0)) {
if (cmdList->setConditions) {
CmdGameState *cmdGs = _cmdGameState;
warning("Command::openOrCloseAssociatedObject() setConditions slot=%d", cmdGs[i].gameStateSlot);
uint16 j;
for (j = 1; j <= _numCmdGameState; ++j) {
if (cmdGs[j].id == i && cmdGs[j].gameStateSlot > 0) {

View File

@ -345,11 +345,6 @@ void Cutaway::changeRooms(CutawayObject &object) {
}
}
/*debug(6, "Person '%s' (%i) is %s",
_vm->logic()->objectName(objectData->name),
objectData->name,
on ? "on" : "off");*/
if (on) {
// It is needed, so ensure it's ON
objectData->name = ABS(objectData->name);
@ -668,10 +663,6 @@ byte *Cutaway::handleAnimation(byte *ptr, CutawayObject &object) {
// Unpack animation, but do not unpack moving people
if (!((objAnim[i].mx > 0 || objAnim[i].my > 0) && inRange(objAnim[i].object, 1, 3))) {
/*debug(6, "Animation - bankUnpack(%i, %i, %i);",
objAnim[i].unpackFrame,
objAnim[i].originalFrame,
objAnim[i].bank);*/
_vm->bankMan()->unpack(
objAnim[i].unpackFrame,
objAnim[i].originalFrame,
@ -773,7 +764,7 @@ void Cutaway::handlePersonRecord(
_vm->walk()->movePerson(
&p,
object.moveToX, object.moveToY,
_currentImage + 1, // XXX CI+1
_currentImage + 1,
_vm->logic()->objectData(object.objectNumber)->image
);
}
@ -1133,9 +1124,7 @@ void Cutaway::stop() {
}
if (joeRoom == _temporaryRoom &&
joeRoom != 37 && // XXX hard coded room number
joeRoom != 105 && // XXX hard coded room number
joeRoom != 106 && // XXX hard coded room number
joeRoom != 37 && joeRoom != 105 && joeRoom != 106 &&
(joeX || joeY)) {
BobSlot *joeBob = _vm->graphics()->bob(0);
@ -1175,8 +1164,6 @@ void Cutaway::updateGameState() {
if (update) {
// Show or hide an object
if (objectIndex > 0) { // Show the object
ObjectData *objectData = _vm->logic()->objectData(objectIndex);
objectData->name = ABS(objectData->name);
@ -1209,7 +1196,6 @@ void Cutaway::updateGameState() {
} // for()
}
// XXX this function could probably be useful at other places too
static char *right(char *str, int count) {
// This function does _not_ use static data (the implementation in talk.c does!)
int length = strlen(str);
@ -1239,7 +1225,6 @@ void Cutaway::talk(char *nextFilename) {
}
int Cutaway::makeComplexAnimation(int16 currentImage, Cutaway::CutawayAnim *objAnim, int frameCount) {
// function MAKE_COMPLEX_ANIM, lines 816-883 in cutaway.c
int frameIndex[256];
int i;
int bobNum = objAnim[0].object;

View File

@ -237,7 +237,7 @@ class Cutaway {
CutawayObject &object,
const char *sentence);
//! Restore QueenLogic::_objectData from _personData
//! Restore Logic::_objectData from _personData
void restorePersonData();
//! Stop the cutaway

View File

@ -35,7 +35,6 @@
namespace Queen {
Debugger::Debugger(QueenEngine *vm)
: _drawAreas(false), _vm(vm) {
@ -52,24 +51,18 @@ Debugger::Debugger(QueenEngine *vm)
DCmd_Register("song", &Debugger::Cmd_Song);
}
void Debugger::preEnter() {
// XXX mute all sounds
}
void Debugger::postEnter() {
// XXX un-mute all sounds
_vm->graphics()->setupMouseCursor();
}
bool Debugger::Cmd_Exit(int argc, const char **argv) {
_detach_now = true;
return false;
}
bool Debugger::Cmd_Help(int argc, const char **argv) {
// console normally has 39 line width
// wrap around nicely
@ -91,7 +84,6 @@ bool Debugger::Cmd_Help(int argc, const char **argv) {
return true;
}
bool Debugger::Cmd_Asm(int argc, const char **argv) {
if (argc == 2) {
uint16 sm = atoi(argv[1]);
@ -103,14 +95,12 @@ bool Debugger::Cmd_Asm(int argc, const char **argv) {
return true;
}
bool Debugger::Cmd_Areas(int argc, const char **argv) {
_drawAreas = !_drawAreas;
DebugPrintf("Room areas display %s\n", _drawAreas ? "on" : "off");
return true;
}
bool Debugger::Cmd_Bob(int argc, const char **argv) {
if (argc >= 3) {
int bobNum = atoi(argv[1]);
@ -144,7 +134,6 @@ bool Debugger::Cmd_Bob(int argc, const char **argv) {
return true;
}
bool Debugger::Cmd_GameState(int argc, const char **argv) {
uint16 slot;
switch (argc) {
@ -167,14 +156,12 @@ bool Debugger::Cmd_GameState(int argc, const char **argv) {
return true;
}
bool Debugger::Cmd_Info(int argc, const char **argv) {
DebugPrintf("Version: %s\n", _vm->resource()->JASVersion());
DebugPrintf("Audio compression: %d\n", _vm->resource()->compression());
return true;
}
bool Debugger::Cmd_Items(int argc, const char **argv) {
int n = _vm->logic()->itemDataCount();
ItemData *item = _vm->logic()->itemData(1);
@ -186,7 +173,6 @@ bool Debugger::Cmd_Items(int argc, const char **argv) {
return true;
}
bool Debugger::Cmd_PrintBobs(int argc, const char**argv) {
int i;
BobSlot *bob = _vm->graphics()->bob(0);
@ -204,7 +190,6 @@ bool Debugger::Cmd_PrintBobs(int argc, const char**argv) {
return true;
}
bool Debugger::Cmd_Room(int argc, const char **argv) {
if (argc == 2) {
uint16 roomNum = atoi(argv[1]);

View File

@ -163,6 +163,16 @@ void BobSlot::animNormal(uint16 firstFrame, uint16 lastFrame, uint16 spd, bool r
xflip = flip;
}
void BobSlot::scaleWalkSpeed(uint16 ms) {
if (!xmajor) {
ms /= 2;
}
speed = scale * ms / 100;
if (speed == 0) {
speed = 1;
}
}
void BobSlot::clear() {
active = false;
xflip = false;
@ -423,14 +433,10 @@ void Graphics::setBobText(
const char *text,
int textX, int textY,
int color, int flags) {
// function MAKE_SPEAK_BOB, lines 335-457 in talk.c
if (text[0] == '\0')
return;
// debug(0, "makeSpeakBob('%s', (%i,%i), %i, %i, %i, %i);",
// text, bob->x, bob->y, textX, textY, color, flags);
// Duplicate string and append zero if needed
char textCopy[MAX_STRING_SIZE];
@ -476,10 +482,6 @@ void Graphics::setBobText(
}
}
// Plan: write each line to Screen 2, put black outline around lines and
// pick them up as a BOB.
// Find width of widest line
int maxLineWidth = 0;
@ -537,7 +539,7 @@ void Graphics::setBobText(
for (i = 0; i < lineCount; i++) {
int lineX = x + (maxLineWidth - _vm->display()->textWidth(lines[i])) / 2;
//debug(0, "Setting text '%s' at (%i, %i)", lines[i], lineX, y + 9 * i);
debug(7, "Setting text '%s' at (%i, %i)", lines[i], lineX, y + 9 * i);
_vm->display()->setText(lineX, y + 9 * i, lines[i]);
}
}
@ -572,7 +574,7 @@ void Graphics::handleParallax(uint16 roomNum) {
case ROOM_FINAL_FIGHT:
_vm->bam()->updateFightAnimation();
break;
case ROOM_INTRO_RITA_JOE_HEADS: // CR 2 - CD-Rom pan right while Rita talks...
case ROOM_INTRO_RITA_JOE_HEADS:
_cameraBob = -1;
if (screenScroll < 80) {
_vm->display()->horizontalScroll(screenScroll + 4);
@ -584,7 +586,7 @@ void Graphics::handleParallax(uint16 roomNum) {
_bobs[21].x -= 2;
}
break;
case ROOM_INTRO_EXPLOSION: // CR 2 - CD-Rom the guys move off screen
case ROOM_INTRO_EXPLOSION:
_bobs[21].x += 2;
_bobs[21].y += 2;
break;
@ -870,12 +872,6 @@ void Graphics::setupRoomFurniture(int16 *furniture, uint16 furnitureCount) {
uint16 i;
uint16 curImage = 36 + FRAMES_JOE_XTRA;
// unpack the furniture from bank 15
// there are 3 kinds :
// - static (bobs), gamestate range = ]0;5000]
// - animated (bobs), gamestate range = ]0;5000]
// - static (paste downs), gamestate range = [5000; [
// unpack the static bobs
_numFurnitureStatic = 0;
for (i = 1; i <= furnitureCount; ++i) {
@ -977,7 +973,6 @@ void Graphics::setupRoomObjects() {
rebound = true;
}
if (pgd->firstFrame < 0) {
// XXX if(TEMPA[1]<0) bobs[CURRBOB].xflip=1;
curBob = 5 + _numFurnitureAnimated;
setupObjectAnim(pgd, curImage + 1, curBob + numObjectAnimated, pod->name > 0);
curImage += pgd->lastFrame;

View File

@ -82,6 +82,8 @@ struct BobSlot {
void animString(const AnimFrame *animBuf);
void animNormal(uint16 firstFrame, uint16 lastFrame, uint16 speed, bool rebound, bool xflip);
void scaleWalkSpeed(uint16 ms);
void clear();
};

View File

@ -123,13 +123,13 @@ class Input {
bool _fastMode;
//! The current verb received from keyboard
Verb _keyVerb; // KEYVERB
Verb _keyVerb;
//! set if a cutaway is running
bool _cutawayRunning; // CUTON
bool _cutawayRunning;
//! set this if we can quit
bool _canQuit; // inverse of CANTQUIT
bool _canQuit;
//! moved Cutaway::_quit here
bool _cutawayQuit;
@ -138,7 +138,7 @@ class Input {
bool _dialogueRunning;
//! moved Talk::_quit here
bool _talkQuit; // TALKQUIT
bool _talkQuit;
//! Set if quicksave requested
bool _quickSave;

View File

@ -52,7 +52,6 @@ void Journal::use() {
memset(_saveDescriptions, 0, sizeof(_saveDescriptions));
_vm->findGameStateDescriptions(_saveDescriptions);
_panelTextCount = 0;
_vm->display()->palFadeOut(0, 255, JOURNAL_ROOM);
prepare();
@ -289,8 +288,6 @@ void Journal::handleYesNoMode(int16 zoneNum) {
_vm->music()->stopSong();
_vm->loadGameState(currentSlot);
_vm->display()->clearTexts(0, GAME_SCREEN_HEIGHT - 1);
// XXX panelflag=1;
// XXX walkgameload=1;
_quit = true;
_quitCleanly = false;
} else {

View File

@ -64,8 +64,6 @@ Logic::~Logic() {
void Logic::initialise() {
int16 i;
// Step 1 : read queen.jas file and 'unserialize' some arrays
uint8 *jas = _vm->resource()->loadFile("QUEEN.JAS", 20);
uint8 *ptr = jas;
@ -74,14 +72,12 @@ void Logic::initialise() {
_numObjects = READ_BE_UINT16(ptr); ptr += 2;
_numDescriptions = READ_BE_UINT16(ptr); ptr += 2;
// Object data
_objectData = new ObjectData[_numObjects + 1];
memset(&_objectData[0], 0, sizeof(ObjectData));
for (i = 1; i <= _numObjects; i++) {
_objectData[i].readFromBE(ptr);
}
// Room data
_roomData = new uint16[_numRooms + 2];
_roomData[0] = 0;
for (i = 1; i <= (_numRooms + 1); i++) {
@ -89,8 +85,6 @@ void Logic::initialise() {
}
_roomData[_numRooms + 1] = _numObjects;
// SFX Name
// the following table isn't available in demo version
if (_vm->resource()->isDemo()) {
_sfxName = NULL;
} else {
@ -101,18 +95,15 @@ void Logic::initialise() {
}
}
// Item information
_numItems = READ_BE_UINT16(ptr); ptr += 2;
_numItems = READ_BE_UINT16(ptr); ptr += 2;
_itemData = new ItemData[_numItems + 1];
memset(&_itemData[0], 0, sizeof(ItemData));
for (i = 1; i <= _numItems; i++) {
_itemData[i].readFromBE(ptr);
}
// Graphic Image Data
_numGraphics = READ_BE_UINT16(ptr); ptr += 2;
_graphicData = new GraphicData[_numGraphics + 1];
memset(&_graphicData[0], 0, sizeof(GraphicData));
for (i = 1; i <= _numGraphics; i++) {
@ -121,18 +112,14 @@ void Logic::initialise() {
_vm->grid()->readDataFrom(_numObjects, _numRooms, ptr);
// Walk OFF Data
_numWalkOffs = READ_BE_UINT16(ptr); ptr += 2;
_walkOffData = new WalkOffData[_numWalkOffs + 1];
memset(&_walkOffData[0], 0, sizeof(WalkOffData));
for (i = 1; i <= _numWalkOffs; i++) {
_walkOffData[i].readFromBE(ptr);
}
// Special Object Descriptions
_numObjDesc = READ_BE_UINT16(ptr); ptr += 2;
_objectDescription = new ObjectDescription[_numObjDesc + 1];
memset(&_objectDescription[0], 0, sizeof(ObjectDescription));
for (i = 1; i <= _numObjDesc; i++) {
@ -143,9 +130,7 @@ void Logic::initialise() {
_entryObj = READ_BE_UINT16(ptr); ptr += 2;
// Furniture DATA
_numFurniture = READ_BE_UINT16(ptr); ptr += 2;
_furnitureData = new FurnitureData[_numFurniture + 1];
memset(&_furnitureData[0], 0, sizeof(_furnitureData));
for (i = 1; i <= _numFurniture; i++) {
@ -186,8 +171,6 @@ void Logic::initialise() {
delete[] jas;
// Step 2 : read queen2.jas and grab all description texts
_queen2jas = new LineReader(
(char *)_vm->resource()->loadFile("QUEEN2.JAS"),
_vm->resource()->fileSize("QUEEN2.JAS"));
@ -238,8 +221,6 @@ void Logic::initialise() {
_aFile[i] = _queen2jas->nextLine();
// Step 3 : initialise game state / variables
_vm->command()->clear(false);
_scene = 0;
memset(_gameState, 0, sizeof(_gameState));
@ -857,8 +838,6 @@ void Logic::playCutaway(const char *cutFile, char *next) {
}
void Logic::makeJoeSpeak(uint16 descNum, bool objectType) {
// makeJoeSpeak(k, false) == SPEAK(JOE_RESPstr[k],"JOE",find_cd_desc(k))
// makeJoeSpeak(k, true) == SPEAK(OBJECT_DESCRstr[k],"JOE",find_cd_desc(JOERESPMAX+k))
const char *text = objectType ? _objDescription[descNum] : _joeResponse[descNum];
if (objectType) {
descNum += JOE_RESPONSE_MAX;
@ -909,7 +888,6 @@ void Logic::inventoryRefresh() {
}
x += 35;
}
// XXX OLDVERB=VERB;
_vm->update();
}
@ -1011,10 +989,8 @@ void Logic::removeHotelItemsFromInventory() {
}
void Logic::objectCopy(int dummyObjectIndex, int realObjectIndex) {
// P3_COPY_FROM function in cutaway.c
/* Copy data from Dummy (D) object to object (K)
If COPY_FROM Object images are greater than COPY_TO Object
images then swap the objects around. */
// copy data from dummy object to real object, if COPY_FROM object
// images are greater than COPY_TO Object images then swap the objects around.
ObjectData *dummyObject = objectData(dummyObjectIndex);
ObjectData *realObject = objectData(realObjectIndex);
@ -1057,8 +1033,6 @@ void Logic::objectCopy(int dummyObjectIndex, int realObjectIndex) {
if (fromState == -1)
dummyObject->name = -ABS(dummyObject->name);
// Make sure that WALK_OFF_DATA is copied too!
for (int i = 1; i <= _numWalkOffs; i++) {
WalkOffData *walkOff = &_walkOffData[i];
if (walkOff->entryObj == (int16)dummyObjectIndex) {
@ -2117,7 +2091,6 @@ void LogicGame::useJournal() {
_vm->command()->clear(false);
_journal->use();
_vm->walk()->stopJoe();
// XXX TALKQUIT=CUTQUIT=0; Make sure that we turn off cut stuff in case we use Journal during cutaways
}
bool LogicGame::preChangeRoom() {
@ -2129,8 +2102,6 @@ bool LogicGame::preChangeRoom() {
playCutaway("copy.cut");
playCutaway("clogo.cut");
// XXX enable talking for talkie version
if (ConfMan.getBool("alt_intro") && _vm->resource()->isCD()) {
playCutaway("cintr.cut");
} else {

View File

@ -159,15 +159,12 @@ void Sound::playSong(int16 songNum) {
void Sound::saveState(byte *&ptr) {
WRITE_BE_UINT16(ptr, _lastOverride); ptr += 2;
// XXX lastmerge, lastalter, altmrgpri
}
void Sound::loadState(uint32 ver, byte *&ptr) {
_lastOverride = (int16)READ_BE_UINT16(ptr); ptr += 2;
// XXX lastmerge, lastalter, altmrgpri
}
void SBSound::playSound(byte *sound, uint32 size, bool isSpeech) {
byte flags = SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE;
_mixer->playRaw(isSpeech ? &_speechHandle : &_sfxHandle, sound, size, 11025, flags);

View File

@ -24,7 +24,6 @@
namespace Queen {
Direction State::findDirection(uint16 state) {
static const Direction sd[] = {
DIR_BACK,
@ -35,12 +34,10 @@ Direction State::findDirection(uint16 state) {
return sd[(state >> 2) & 3];
}
StateTalk State::findTalk(uint16 state) {
return (state & (1 << 9)) ? STATE_TALK_TALK : STATE_TALK_MUTE;
}
StateGrab State::findGrab(uint16 state) {
static const StateGrab sg[] = {
STATE_GRAB_NONE,
@ -51,12 +48,10 @@ StateGrab State::findGrab(uint16 state) {
return sg[state & 3];
}
StateOn State::findOn(uint16 state) {
return (state & (1 << 8)) ? STATE_ON_ON : STATE_ON_OFF;
}
Verb State::findDefaultVerb(uint16 state) {
static const Verb sdv[] = {
VERB_NONE,
@ -82,12 +77,10 @@ Verb State::findDefaultVerb(uint16 state) {
return sdv[(state >> 4) & 0xF];
}
StateUse State::findUse(uint16 state) {
return (state & (1 << 10)) ? STATE_USE : STATE_USE_ON;
}
void State::alterOn(uint16 *objState, StateOn state) {
switch (state) {
case STATE_ON_ON:
@ -99,7 +92,6 @@ void State::alterOn(uint16 *objState, StateOn state) {
}
}
void State::alterDefaultVerb(uint16 *objState, Verb v) {
uint16 val;
switch (v) {
@ -134,5 +126,4 @@ void State::alterDefaultVerb(uint16 *objState, Verb v) {
*objState = (*objState & ~0xF0) | (val << 4);
}
} // End of namespace Queen

View File

@ -81,8 +81,6 @@ void Talk::talk(const char *filename, int personInRoom, char *cutawayFilename) {
cutawayFilename[0] = '\0';
// XXX S=SUBJECT[1];
int roomStart = _vm->logic()->currentRoomData();
ObjectData *data = _vm->logic()->objectData(roomStart + personInRoom);
@ -109,7 +107,7 @@ void Talk::talk(const char *filename, int personInRoom, char *cutawayFilename) {
}
int16 oldLevel = 0;
bool personWalking = false; // OWALK in talk.c
bool personWalking = false;
// Lines 828-846 in talk.c
for (i = 1; i <= 4; i++) {
@ -268,9 +266,7 @@ void Talk::talk(const char *filename, int personInRoom, char *cutawayFilename) {
_vm->logic()->gameState(index, _dialogueTree[oldLevel][selectedSentence].gameStateValue);
// if(RETVAL = -1, then before we exit, check to see if(person
// has something final to say!
// check to see if person has something final to say
if (-1 == retval) {
findDialogueString(_person1Ptr, head, _pMax, _talkString[0]);
if (_talkString[0][0] != '\0') {
@ -351,7 +347,6 @@ void Talk::disableSentence(int oldLevel, int selectedSentence) {
}
// Cancel selected dialogue line, so that its no longer displayed
_dialogueTree[oldLevel][selectedSentence].head = -1;
_dialogueTree[oldLevel][selectedSentence].dialogueNodeValue1 = -1;
}
@ -646,8 +641,6 @@ bool Talk::speak(const char *sentence, Person *person, const char *voiceFilePref
else
_talkHead = false;
// XXX CLEAR_COMMAND(false)
for (i = 0; i < strlen(sentence); ) {
if (sentence[i] == '*') {
int segmentLength = i - segmentStart;
@ -786,12 +779,6 @@ void Talk::stringAnimation(const SpeechParameters *parameters, int startFrame, i
_vm->update();
}
// XXX #ifdef __DOS__
// XXX if (VOICETOGGLE && (sfxflag==0))
// XXX while (sfxbusy() && KEYVERB!=101)
// XXX update();
// XXX #endif
}
void Talk::defaultAnimation(
@ -814,20 +801,6 @@ void Talk::defaultAnimation(
if (segment[0] != 0) {
// XXX #ifdef __DOS__
// XXX // 02-21-95 03:44pm DOn't talk until sfx finished
// XXX if(SFXTOGGLE && VOICETOGGLE) {
// XXX if(TEXTTOGGLE==0)
// XXX blanktexts(0,150);
// XXX while(sfxbusy() && KEYVERB!=101)
// XXX update();
// XXX }
// XXX sfxflag=VOICETOGGLE ? sfxplay(SPKstr) : 1;
// XXX if((sfxflag==0) && (TEXTTOGGLE==0))
// XXX blanktexts(0,150);
// XXX #endif
// Why on earth would someone name a variable qzx?
short qzx = 0;
@ -835,10 +808,6 @@ void Talk::defaultAnimation(
int i;
for (i = 0; i < (spaces + 1) /* || sfxflag == 0*/; i++) {
// XXX #ifdef __DOS__
// XXX if(sfxflag==0 && sfxbusy())
// XXX break;
// XXX #endif
if (parameters != NULL) {
@ -1097,12 +1066,6 @@ void Talk::speakSegment(
_vm->update();
}
/* A12 = the frame pointer for the full body frame, well use this */
/* for Hot Spot reference, before we have to set up a Torso frame. */
/* This way the hot spot is at bottom of body */
// XXX A12=A1;
if (-1 == parameters->rf) {
// Setup the Torso frames
_vm->bankMan()->overpack(parameters->bf, startFrame, bankNum);
@ -1174,7 +1137,6 @@ const Talk::SpeechParameters *Talk::findSpeechParameters(
const char *name,
int state,
int faceDirection) {
// function FIND_SACTION in queen.c
const SpeechParameters *iterator = _speechParameters;
if (faceDirection == DIR_RIGHT)
faceDirection = DIR_LEFT;
@ -1276,7 +1238,6 @@ static char *removeStar(char *str) {
}
int16 Talk::selectSentence() {
// Function TALK_BOB (lines 577-739) in talk.c
int selectedSentence = 0;
int startOption = 1;
@ -1285,8 +1246,6 @@ int16 Talk::selectSentence() {
int talkZone[5];
int i;
// Change NORMAL_INK -> TALK_NORMAL_INK
_vm->display()->textCurrentColor(INK_TALK_NORMAL);
_vm->graphics()->setupArrows();
@ -1460,49 +1419,59 @@ const Talk::SpeechParameters Talk::_speechParameters[] = {
{ "JOE",0,1,1,10,2,3,"",0},
{ "JOE",0,3,3,28,2,3,"",0},
{ "JOE",0,4,5,38,1,0,"",0},
{ "JOE",1,1,1,45,-1,0,"",0},
{ "JOE",1,3,3,28,2,3,"",0},
{ "JOE",1,4,5,38,1,0,"",0},
{ "JOE",2,1,1,46,-1,0,"",0},
{ "JOE",2,3,3,28,2,3,"",0},
{ "JOE",2,4,5,38,1,0,"",0},
{ "JOE",3,1,1,47,-1,0,"",0},
{ "JOE",3,3,3,28,2,3,"",0},
{ "JOE",3,4,5,38,1,0,"",0},
{ "JOE",4,1,1,50,-1,0,"",0},
{ "JOE",4,3,3,28,2,3,"",0},
{ "JOE",4,4,5,38,1,0,"",0},
{ "JOE",5,1,2,0,0,0,"",0},
{ "JOE",5,3,4,0,0,0,"",0},
{ "JOE",5,4,6,0,0,0,"",0},
//CR - Change 48,1,0 -> 48,0,1
{ "JOE",6,1,1,48,0,1,"",0},
{ "JOE",6,3,3,28,2,3,"",0},
{ "JOE",6,4,5,38,1,0,"",0},
//CR - Change 51,1,0 -> 51,0,1
{ "JOE",7,1,1,51,0,1,"",0},
{ "JOE",7,3,3,28,2,3,"",0},
{ "JOE",7,4,5,38,1,0,"",0},
{ "JOE",8,1,1,26,0,0,"",0},
{ "JOE",8,3,3,28,2,3,"",0},
{ "JOE",8,4,5,38,1,0,"",0},
{ "JOE",9,1,1,29,0,0,"",0},
{ "JOE",9,3,3,28,0,0,"",0},
{ "JOE",9,4,5,38,0,0,"",0},
// - Look down, sad. 10,12,46
{ "JOE",10,1,1,12,0,0,"T046,010,010,010,012,012,012,012,012,012,012,012,012,012,012,012,012,012,010,000",0},
{ "JOE",10,3,3,18,0,0,"",0},
{ "JOE",10,4,5,44,0,0,"",0},
{ "JOE",11,1,1,53,-1,0,"",0},
{ "JOE",11,3,3,28,2,3,"",0},
{ "JOE",11,4,5,38,1,0,"",0},
{ "JOE",12,1,1,10,2,3,"",0},
{ "JOE",12,3,3,28,2,0,"",0},
{ "JOE",12,4,5,38,1,0,"",0},
{ "JOE",13,1,1,10,2,3,"T012,013,019,019,019,019,019,019,019,019,019,019,013,010,000",0},
{ "JOE",13,3,3,28,2,3,"",0},
{ "JOE",13,4,5,38,1,0,"",0},
// - 7/11/94, Make Joe look front
{ "JOE",14,1,1,16,2,3,"",16},
{ "JOE",14,3,3,28,2,3,"",0},
{ "JOE",14,4,5,38,1,0,"",0},
@ -1561,7 +1530,6 @@ const Talk::SpeechParameters Talk::_speechParameters[] = {
{ "LOLA",1,0,9,10,2,3,"",33},
{ "LOLA",2,0,30,33,2,3,"",33},
{ "LOLA",3,0,32,33,2,3,"",33},
//CR 2 - 22/2/95,
{ "LOLA",4,0,8,0,0,0,"",33},
{ "LOLA",5,0,31,0,0,0,"",0},
{ "LOLA",6,0,31,0,0,0,"047,048,049,050,000",33},
@ -1575,14 +1543,10 @@ const Talk::SpeechParameters Talk::_speechParameters[] = {
{ "LOLA_SHOWER",6,0,64,10,2,3,"",0},
{ "LOLA_SHOWER",7,0,31,0,0,0,"062,063,064,000",0},
// { "SECRETARY",0,0,1,12,2,0,"",12},
// Change Secretary
{ "SECRETARY",0,0,1,12,2,3,"",12},
{ "SECRETARY",1,0,1,12,2,0,"",12},
{ "SECRETARY",2,0,1,12,2,0,"",12},
// { "SPARKY",0,0,21,23,5,0,"",23},
// Change Sparky talk code
{ "SPARKY",0,0,21,23,2,3,"",23},
{ "SPARKY",1,0,21,22,0,0,"",0},
{ "SPARKY",2,0,21,22,0,0,"021,042,043,000",0},
@ -1649,8 +1613,6 @@ const Talk::SpeechParameters Talk::_speechParameters[] = {
{ "WEDGEWOOD",0,0,8,1,2,0,"",8},
{ "WEDGEWOOD",1,0,1,1,3,0,"",1},
// { "BUD",0,0,1,2,4,2,"",2},
// Change Buds talk code
{ "BUD",0,0,1,2,3,2,"",2},
{ "BUD",1,0,1,2,4,2,"T017,018,000",2},
{ "BUD",2,0,1,21,-1,0,"",2},
@ -1662,7 +1624,6 @@ const Talk::SpeechParameters Talk::_speechParameters[] = {
{ "BUD",8,0,1,17,-1,0,"",2},
{ "BUD",9,0,1,14,-1,0,"T014,008,008,003,003,008,008,003,003,010,010,012,012,000",2},
//CR 2 - Change 4,2 -> 2,3, End Frames 8 -> 2
{ "LOU",0,0,1,2,2,3,"",2},
{ "LOU",1,0,1,2,4,2,"013,014,015,016,017,018,000",2},
{ "LOU",2,0,1,2,4,2,"018,017,016,015,014,013,000",2},
@ -1748,12 +1709,10 @@ const Talk::SpeechParameters Talk::_speechParameters[] = {
{ "KLUNK",0,0,1,2,2,3,"",2},
{ "KLUNK",1,0,1,2,2,3,"019,020,021,022,001,000",2},
//CR 4 - 22/2/95, Change 017 -> 517
{ "KLUNK",2,0,1,2,2,3,"001,022,021,020,019,016,517,000",2},
{ "KLUNK",3,0,1,2,2,3,"T010,011,010,011,010,011,009,000",2},
{ "FRANK",0,0,13,14,2,3,"",14},
//CR 2 - 21/2/95, Change from Torso to normal
{ "FRANK",1,0,13,20,0,1,"",14},
{ "FRANK",2,0,13,14,2,3,"025,026,027,027,027,026,026,026,027,027,026,026,027,025,013,000",14},
{ "FRANK",3,0,28,14,2,3,"",14},
@ -1761,7 +1720,6 @@ const Talk::SpeechParameters Talk::_speechParameters[] = {
{ "DEATH",0,0,1,2,2,3,"",2},
{ "DEATH",1,0,1,2,2,3,"013,014,015,016,017,001,000",0},
{ "DEATH",2,0,1,2,2,3,"001,017,016,015,014,013,000",0},
//CR 2 - Change 024 -> 524
{ "DEATH",3,0,1,2,2,3,"T018,019,020,021,021,022,022,020,021,022,020,021,022,023,024,524,000",2},
{ "DEATH",4,0,1,2,2,3,"T025,026,027,028,028,028,028,028,028,028,028,028,029,035,000",2},
{ "DEATH",5,0,1,2,2,3,"T030,031,032,033,033,033,033,033,033,033,033,033,034,035,000",2},
@ -1837,8 +1795,6 @@ const Talk::SpeechParameters Talk::_speechParameters[] = {
{ "ANDSON-E",0,0,1,3,4,1,"",1},
{ "ANDSON-E",1,0,1,3,4,1,"002,001,000",1},
//#ifdef __DOS__
{ "JOE-H",0,0,1,1,4,4,"",1},
{ "JOE-H",1,0,1,1,2,3,"012,013,014,000",14},
{ "JOE-H",2,0,1,1,2,3,"010,011,000",11},
@ -1860,16 +1816,12 @@ const Talk::SpeechParameters Talk::_speechParameters[] = {
{ "HUGH",0,0,1,1,2,3,"",1},
{ "HUGH",1,0,7,7,2,3,"",7},
// New CD-Rom intro persons
// *01 Blink
{ "X2_JOE",0,0,1,1,2,3,"",1},
{ "X2_JOE",1,0,1,1,2,3,"001,007,008,008,007,001,000",1},
// *01 Blink
{ "X2_RITA",0,0,1,1,2,3,"",1},
{ "X2_RITA",1,0,1,1,2,3,"001,007,008,008,007,001,000",1},
// *01 Smile, *02 Blink, *03 Raise Eyebrow, *04 Anger, *05 Surprise
{ "X3_RITA",0,0,1,1,4,1,"",1},
{ "X3_RITA",1,0,1,1,4,1,"007,000",7},
{ "X3_RITA",2,0,1,1,4,1,"009,010,011,009,001,000",1},
@ -1877,47 +1829,37 @@ const Talk::SpeechParameters Talk::_speechParameters[] = {
{ "X3_RITA",4,0,1,1,4,1,"E015,000",1},
{ "X3_RITA",5,0,1,1,4,1,"E014,000",1},
// *01 Talk to Sparky, *02 Turn to Sparky, *03 Turn to Rita, *04 Close Eyes
{ "X4_JOE",0,0,1,1,3,4,"",1},
{ "X4_JOE",1,0,1,13,2,3,"",13},
{ "X4_JOE",2,0,1,1,3,4,"009,010,011,012,013,000",13},
{ "X4_JOE",3,0,1,1,3,4,"012,011,010,009,000",9},
{ "X4_JOE",4,0,1,1,3,4,"001,019,000",19},
// *01 Talk to Sparky, *02 Turn to Sparky, *03 Turn to Joe, *04 Close Eyes
{ "X4_RITA",0,0,1,1,0,1,"",1},
{ "X4_RITA",1,0,1,7,0,1,"",7},
{ "X4_RITA",2,0,1,1,3,4,"004,005,006,006,006,006,007,000",7},
{ "X4_RITA",3,0,1,1,3,4,"005,004,001,000",1},
{ "X4_RITA",4,0,1,1,3,4,"001,003,000",3},
// *01 Blink, *02 Look Right
{ "X5_SPARKY",0,0,1,1,2,3,"",1},
{ "X5_SPARKY",1,0,1,1,2,3,"001,010,011,011,001,000",1},
{ "X5_SPARKY",2,0,1,1,2,3,"001,007,008,009,000",9},
// *01 Eyes Bulge Once, *02 Eyes Bulge Big Time
{ "X6_HUGH",0,0,1,1,2,3,"",1},
{ "X6_HUGH",1,0,1,1,2,3,"007,007,007,007,,001,000",1},
{ "X6_HUGH",2,0,1,1,2,3,"008,008,008,008,008,009,009,008,008,008,009,008,000",8},
// *01 Talk to Sparky, Rub Head
{ "X10_JOE",0,0,1,2,2,3,"",2},
{ "X10_JOE",1,0,1,8,2,3,"",8},
//CR 2 - 21/2/95, Cut down rub head anim
{ "X10_JOE",2,0,1,2,2,3,"014,014,014,015,015,014,014,015,015,000",2},
{ "X10_RITA",0,0,1,2,2,3,"",2},
{ "X11_JOE",0,0,1,2,0,1,"",2},
// *01 Look at Joe
{ "X11_RITA",0,0,1,2,0,1,"",2},
{ "X11_RITA",1,0,1,2,1,0,"003,004,000",4},
//#endif
// Interview
{ "JOHN", 0, 0, 1, 2, 2, 3, "", 1 },
{ "JOHN", 1, 0, 1, 15, -1, 0, "", 1 },
{ "JOHN", 2, 0, 1, 16, -1, 0, "", 1 },

View File

@ -85,10 +85,10 @@ private:
};
struct SpeechParameters {
const char *name; // Nstr
signed char state,faceDirection; // S,F
const char *name;
signed char state,faceDirection;
signed char body,bf,rf,af;
const char *animation; // SANIMstr
const char *animation;
signed char ff;
};
@ -221,7 +221,7 @@ private:
const SpeechParameters *findSpeechParameters(
const char *name,
int state,
int faceDirection); // FIND_SACTION
int faceDirection);
int splitOption(const char *str, char optionText[5][MAX_STRING_SIZE]);

View File

@ -126,14 +126,7 @@ void Walk::animateJoe() {
// adjust Joe's movespeed according to scale
pbs->scale = pwd->area->calcScale(pbs->y);
_vm->logic()->joeScale(pbs->scale);
if (pbs->xmajor) {
pbs->speed = pbs->scale * 6 / 100;
} else {
pbs->speed = pbs->scale * 3 / 100;
}
if (pbs->speed == 0) {
pbs->speed = 1;
}
pbs->scaleWalkSpeed(6);
_vm->update(true);
if (_vm->input()->cutawayQuit() || _vm->logic()->joeWalk() == JWM_EXECUTE) {
stopJoe();
@ -252,16 +245,8 @@ void Walk::animatePerson(const MovePersonData *mpd, uint16 image, uint16 bobNum,
while (pbs->moving) {
_vm->update();
uint16 scale = pwd->area->calcScale(pbs->y);
pbs->scale = scale;
if (pbs->xmajor) {
pbs->speed = scale * mpd->moveSpeed / 100;
} else {
pbs->speed = scale * (mpd->moveSpeed / 2) / 100;
}
if (pbs->speed == 0) {
pbs->speed = 1;
}
pbs->scale = pwd->area->calcScale(pbs->y);
pbs->scaleWalkSpeed(mpd->moveSpeed);
if (_vm->input()->cutawayQuit()) {
stopPerson(bobNum);
break;
@ -306,9 +291,6 @@ int16 Walk::moveJoe(int direction, int16 endx, int16 endy, bool inCutaway) {
}
_vm->graphics()->bob(0)->animating = false;
// cyx: the NEW_ROOM = 0 is done in Command::grabCurrentSelection()
// XXX if ((CAN==-1) && (walkgameload==0)) NEW_ROOM=0;
// XXX walkgameload=0;
if (_joeMoveBlock) {
can = -2;
_joeMoveBlock = false;

View File

@ -366,7 +366,7 @@ OWALK
PERstr
PKEYstr
TALKHEAD
TALKQUIT
TALKQUIT Input::_talkQuit
TALKstr
TALK_SELECTED Logic::_talkSelected
@ -452,7 +452,7 @@ CH,
OLDG,S2,S1,ITEM,TYPE,C,
NAME,TL,TI,TS,WC,IMAGE,
D,P,LI,R
CANTQUIT
CANTQUIT !Input::_canQuit
(NO NEED TO BE GLOBAL)