ScummVM API documentation
dialog.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
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*
20
*/
21
22
#ifndef DIALOG_H
23
#define DIALOG_H
24
25
#include "common/hash-str.h"
26
#include "common/hashmap.h"
27
#include "common/scummsys.h"
28
#include "common/str.h"
29
30
namespace
AGDS
{
31
class
AGDSEngine;
32
33
class
Dialog
{
34
using
DialogDefsType
=
Common::HashMap<Common::String, int, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo>
;
35
36
private
:
37
struct
Sound {
38
Common::String
Name;
39
Common::String
Sample;
40
int
Step;
41
42
Sound() : Step(1) {
43
}
44
45
Sound(
const
Common::String
&name,
const
Common::String
&sample,
int
step) : Name(name), Sample(sample), Step(step) {
46
}
47
};
48
using
SoundsType
=
Common::Array<Sound>
;
49
50
AGDSEngine
*_engine;
51
DialogDefsType
_dialogDefs;
52
Common::String
_dialogScript;
53
uint32 _dialogScriptPos;
54
Common::String
_dialogProcessName;
55
Common::String
_dialogLine;
56
57
SoundsType
_sounds;
58
Common::String
_currentDef;
59
int
_currentSoundIndex;
60
61
void
parseDialogDefs(
const
Common::String
&defs);
62
63
public
:
64
Dialog
(
AGDSEngine
*engine) : _engine(engine), _dialogScriptPos(0), _currentSoundIndex(-1) {}
65
int
textDelay(
const
Common::String
&str);
66
const
Common::String
&getNextDialogLine()
const
{
67
return
_dialogLine;
68
}
69
Common::String
getNextDialogSound();
70
71
void
load(
const
Common::String
&processName,
const
Common::String
&dialogScript,
const
Common::String
&defs);
72
bool
tick();
73
74
private
:
75
void
processSoundDirective(
const
Common::String
&line);
76
void
processDirective(
Common::String
line);
77
};
78
79
}
// End of namespace AGDS
80
81
#endif
/* AGDS_DIALOG_H */
Common::String
Definition:
str.h:59
Common::Array< Sound >
AGDS
Definition:
agds.h:58
Common::HashMap< Common::String, int, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo >
AGDS::Dialog
Definition:
dialog.h:33
AGDS::AGDSEngine
Definition:
agds.h:81
engines
agds
dialog.h
Generated on Wed Dec 10 2025 09:10:16 for ScummVM API documentation by
1.8.13