25 #include "common/util.h" 26 #include "queen/structs.h" 36 static void talk(
const char *filename,
int personInRoom,
char *cutawayFilename,
QueenEngine *vm);
42 static void getString(
const byte *ptr, uint16 &offset,
char *str,
int maxLength,
int align = 2);
49 MAX_STRING_LENGTH = 255,
50 MAX_STRING_SIZE = (MAX_STRING_LENGTH + 1),
51 MAX_TEXT_WIDTH = (320-18),
56 OPTION_TEXT_MARGIN = 24
63 SPEAK_FACE_RIGHT = -2,
64 SPEAK_FACE_FRONT = -3,
75 int16 dialogueNodeValue1;
80 struct SpeechParameters {
82 signed char state,faceDirection;
83 signed char body,bf,rf,af;
84 const char *animation;
110 int16 _itemNumber[2];
113 uint16 _person1PtrOff;
116 uint16 _cutawayPtrOff;
119 uint16 _person2PtrOff;
128 DialogueNode _dialogueTree[18][6];
131 char _person2String[MAX_STRING_SIZE];
133 int _oldSelectedSentenceIndex;
134 int _oldSelectedSentenceValue;
136 char _talkString[5][MAX_STRING_SIZE];
137 char _joeVoiceFilePrefix[5][MAX_STRING_SIZE];
139 static const SpeechParameters _speechParameters[];
145 void talk(
const char *filename,
int personInRoom,
char *cutawayFilename);
147 byte *loadDialogFile(
const char *filename);
150 void load(
const char *filename);
156 void findDialogueString(uint16 offset, int16
id, int16 max,
char *str);
162 bool hasTalkedTo() {
return talkSelected()->hasTalkedTo; }
165 void setHasTalkedTo() { talkSelected()->hasTalkedTo =
true; }
168 int16 selectedValue(
int index) {
169 return talkSelected()->values[index-1];
173 void selectedValue(
int index, int16 value) {
174 talkSelected()->values[index-1] = value;
178 void disableSentence(
int oldLevel,
int selectedSentence);
181 int16 selectSentence();
184 bool speak(
const char *sentence,
Person *person,
const char *voiceFilePrefix);
187 int getSpeakCommand(
const Person *person,
const char *sentence,
unsigned &index);
191 const char *segmentStart,
195 const char *voiceFilePrefix,
198 void headStringAnimation(
const SpeechParameters *parameters,
int bobNum,
int bankNum);
200 void stringAnimation(
const SpeechParameters *parameters,
int startFrame,
int bankNum);
202 void defaultAnimation(
205 const SpeechParameters *parameters,
209 int countSpaces(
const char *segment);
212 const SpeechParameters *findSpeechParameters(
217 int splitOption(
const char *str,
char optionText[5][MAX_STRING_SIZE]);
219 int splitOptionHebrew(
const char *str,
char optionText[5][MAX_STRING_SIZE]);
221 int splitOptionDefault(
const char *str,
char optionText[5][MAX_STRING_SIZE]);
Definition: structs.h:543
static void getString(const byte *ptr, uint16 &offset, char *str, int maxLength, int align=2)
Read a string from ptr and update offset.
static bool speak(const char *sentence, Person *person, const char *voiceFilePrefix, QueenEngine *vm)
Public interface to speak a sentence.
Definition: structs.h:555
static void talk(const char *filename, int personInRoom, char *cutawayFilename, QueenEngine *vm)
Public interface to run a talk from a file.