21 #ifndef PELROCK_DIALOG_H 22 #define PELROCK_DIALOG_H 24 #include "common/stack.h" 26 #include "graphics/font.h" 28 #include "pelrock/types.h" 37 class PelrockEventManager;
40 const byte kCtrlSpace = 0x20;
41 const byte kCtrlSpeakerId = 0x08;
42 const byte kCtrlEndText = 0xFD;
43 const byte kCtrlTextTerminator = 0xFC;
44 const byte kCtrlDialogueMarker = 0xF1;
45 const byte kCtrlDialogueMarkerOneoff = 0xFB;
46 const byte kCtrlDisabledChoice = 0xFA;
47 const byte kCtrlPageBreakConv = 0xF9;
48 const byte kCtrlActionAndEnd = 0xF8;
49 const byte kCtrlActionAndContinue = 0xEB;
50 const byte kCtrlEndBranch = 0xF7;
51 const byte kCtrlLineContinue = 0xF6;
52 const byte kCtrlAltEndMarker1 = 0xF5;
53 const byte kCtrlEndConversation = 0xF4;
54 const byte kCtrlGoBack = 0xF0;
55 const byte kCtrlAltSpeakerRoot = 0xFE;
57 const int kChoiceHeight = 16;
58 const int kMaxCharsPerLine = 47;
59 const int kMaxLines = 5;
64 int currentChoiceLevel;
77 const static int kArrowWidth = 8;
78 const static int kChoicePadding = 16;
84 Sprite *_curSprite =
nullptr;
90 uint32 readTextBlock(
const byte *data, uint32 dataSize, uint32 startPos,
Common::String &outText, byte &outSpeakerId);
92 void setCurSprite(
int index);
93 bool checkAllSubBranchesExhausted(
const byte *data, uint32 dataSize, uint32 startPos,
int currentChoiceLevel);
95 uint32 skipControlBytes(
const byte *data, uint32 dataSize, uint32 position);
96 uint32 peekNextMeaningfulByte(
const byte *data, uint32 dataSize, uint32 position);
97 ConversationState initializeConversation(
const byte *data, uint32 dataSize, byte npcIndex);
99 uint32 readAndDisplayDialogue(
const byte *data, uint32 dataSize, uint32 position);
100 ConversationEndResult checkConversationEnd(
const byte *data, uint32 dataSize, uint32 position,
int currentRoot = -1);
111 void startConversation(
const byte *conversationData, uint32 dataSize, byte npcIndex,
Sprite *alfredAnimSet =
nullptr);
112 uint32 findRoot(
int npc,
int ¤tRoot, uint32 position, uint32 dataSize,
const byte *conversationData);
113 uint32 findSpeaker(byte npcIndex, uint32 dataSize,
const byte *conversationData);
126 bool _goodbyeDisabled =
false;
129 bool _dialogActive =
false;
130 bool _dismissDialog =
false;
131 bool _disableClickToAdvance =
false;
132 bool _isNPCTalking =
false;
139 #endif // PELROCK_DIALOG_H Definition: managed_surface.h:51
Center the text.
Definition: font.h:52
TextAlign
Definition: font.h:48
Definition: atari-screen.h:58
Definition: graphics.h:32
Definition: formatinfo.h:28
Definition: graphics.h:38