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"
37class PelrockEventManager;
40const byte kCtrlSpace = 0x20;
41const byte kCtrlSpeakerId = 0x08;
42const byte kCtrlEndText = 0xFD;
43const byte kCtrlTextTerminator = 0xFC;
44const byte kCtrlDialogueMarker = 0xF1;
45const byte kCtrlDialogueMarkerOneoff = 0xFB;
46const byte kCtrlDisabledChoice = 0xFA;
47const byte kCtrlPageBreakConv = 0xF9;
48const byte kCtrlActionAndEnd = 0xF8;
49const byte kCtrlActionAndContinue = 0xEB;
50const byte kCtrlEndBranch = 0xF7;
51const byte kCtrlLineContinue = 0xF6;
52const byte kCtrlAltEndMarker1 = 0xF5;
53const byte kCtrlEndConversation = 0xF4;
54const byte kCtrlGoBack = 0xF0;
55const byte kCtrlAltSpeakerRoot = 0xFE;
57const int kChoiceHeight = 16;
58const int kMaxCharsPerLine = 47;
59const 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;
Definition: managed_surface.h:51
Definition: graphics.h:38
Definition: graphics.h:32
TextAlign
Definition: font.h:48
@ kTextAlignCenter
Center the text.
Definition: font.h:52
Definition: formatinfo.h:28
Definition: atari-screen.h:58