ScummVM API documentation
speech.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * Additional copyright for this file:
8  * Copyright (C) 1999-2000 Revolution Software Ltd.
9  * This code is based on source code created by Revolution Software,
10  * used with permission.
11  *
12  * This program is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef ICB_SPEECH_H
28 #define ICB_SPEECH_H
29 
30 #include "engines/icb/common/px_array.h"
31 #include "engines/icb/common/px_string.h"
32 #include "engines/icb/common/px_common.h"
33 #include "engines/icb/string_vest.h"
34 
35 namespace ICB {
36 
37 // this sits in the _mega structure for conversation_uid - means no current conversation
38 #define NO_SPEECH_REQUEST 424242
39 
40 // goes in conversation_owners when a conversation is removed and its slot freed
41 #define DEAD_CONVERSATION 424242
42 
43 enum __speech_state {
44  __PENDING, // conversation is being set up
45  __PROCESS, // ready for next speech instruction
46  __WAITING_TO_SAY, // specific to psx really, this means the disc is spinning towards its destination, just keep going until it's finished!
47  __SAYING // text is up on screen
48 };
49 
50 enum __coms { __FACE_OBJECT, __PLAY_GENERIC_ANIM, __PLAY_CUSTOM_ANIM, __REVERSE_CUSTOM_ANIM };
51 
53 public:
54 
55  uint32 id; // object id
56 
57  uint32 param1;
58  // pxString str_param1;
59  char str_param1[ENGINE_STRING_LEN];
60 
61  __coms command;
62 
63  bool8 active;
64  uint8 padding1;
65  uint8 padding2;
66  uint8 padding3;
67 };
68 
69 #define MAX_people_talking 3
70 #define MAX_coms 3
71 
73 public:
74  __conversation() {
75  for (int32 i = 0; i < MAX_people_talking; i++)
76  subscribers_requested[i] = 0;
77 
78  total_subscribers = 0;
79  current_subscribers = 0;
80 
81  current_talker = (int32)-1;
82  count = 0;
83  }
84 
85  uint32 subscribers_requested[MAX_people_talking];
86  uint32 total_subscribers; // the number of people in the conversation
87  uint32 current_subscribers; // number of people still in at the end of the logic cycle - we can therefore tell if any have dropped out
88 
89  __conv_command coms[MAX_coms];
90 
91  char *script_pc;
92 
93  int32 current_talker; // id of person talking
94  uint32 count; // used to count down current text
95  __speech_state state; // conversation state
96 };
97 
98 // Works out how int32 some text should be displayed to allow adequate time for it to be read. We might need to
99 // tinker with the formula in here 'till we get it right.
100 extern uint32 Get_reading_time(const char *pcString);
101 
102 // Moved these from speech_psx.h, because the PC needs to be able to alter text colours now for the
103 // Remora's text.
104 void SetTextColour(uint8 r, uint8 g, uint8 b);
105 
106 // This colour is used to display voice over text (normally player's speech colour).
107 extern uint8 voice_over_red;
108 extern uint8 voice_over_green;
109 extern uint8 voice_over_blue;
110 
111 // These defaults are set to the player's text colour.
112 #define VOICE_OVER_DEFAULT_RED 255
113 #define VOICE_OVER_DEFAULT_GREEN 245
114 #define VOICE_OVER_DEFAULT_BLUE 100
115 
116 } // End of namespace ICB
117 
118 #endif
Definition: speech.h:72
Definition: actor.h:32
Definition: speech.h:52