Devilution
Diablo devolved - magic behind the 1996 computer game
control.h
Go to the documentation of this file.
1 
6 #ifndef __CONTROL_H__
7 #define __CONTROL_H__
8 
9 extern BYTE *pDurIcons;
10 extern BYTE *pChrButtons;
11 extern BOOL drawhpflag;
12 extern BOOL dropGoldFlag;
13 extern BOOL panbtn[8];
14 extern BOOL chrbtn[4];
15 extern BYTE *pMultiBtns;
16 extern BYTE *pPanelButtons;
17 extern BYTE *pChrPanel;
18 extern BOOL lvlbtndown;
19 extern int dropGoldValue;
20 extern BOOL drawmanaflag;
21 extern BOOL chrbtnactive;
22 extern BYTE *pPanelText;
23 extern BYTE *pLifeBuff;
24 extern BYTE *pBtmBuff;
25 extern BYTE *pTalkBtns;
26 extern int pstrjust[4];
27 extern int pnumlines;
28 extern BOOL pinfoflag;
29 extern BOOL talkbtndown[3];
30 extern int pSpell;
31 extern BYTE *pManaBuff;
32 extern char infoclr;
33 extern BYTE *pGBoxBuff;
34 extern BYTE *pSBkBtnCel;
35 extern char tempstr[256];
36 extern BOOLEAN whisper[MAX_PLRS];
37 extern int sbooktab;
38 extern int pSplType;
39 extern int initialDropGoldIndex;
40 extern BOOL talkflag;
41 extern BYTE *pSBkIconCels;
42 extern BOOL sbookflag;
43 extern BOOL chrflag;
44 extern BOOL drawbtnflag;
45 extern BYTE *pSpellBkCel;
46 extern char infostr[256];
47 extern int numpanbtns;
48 extern BYTE *pStatusPanel;
49 extern char panelstr[4][64];
50 extern BOOL panelflag;
51 extern BYTE SplTransTbl[256];
52 extern int initialDropGoldValue;
53 extern BYTE *pSpellCels;
54 extern BOOL panbtndown;
55 extern BYTE *pTalkPanel;
56 extern BOOL spselflag;
57 
58 void DrawSpellCel(int xp, int yp, BYTE *Trans, int nCel, int w);
59 void SetSpellTrans(char t);
60 void DrawSpell();
61 void DrawSpellList();
62 void SetSpell();
63 void SetSpeedSpell(int slot);
64 void ToggleSpell(int slot);
65 void PrintChar(int sx, int sy, int nCel, char col);
66 void AddPanelString(char *str, BOOL just);
67 void ClearPanel();
68 void DrawPanelBox(int x, int y, int w, int h, int sx, int sy);
69 void InitPanelStr();
70 void SetFlaskHeight(BYTE *pCelBuff, int min, int max, int sx, int sy);
71 void DrawFlask(BYTE *pCelBuff, int w, int nSrcOff, BYTE *pBuff, int nDstOff, int h);
72 void DrawLifeFlask();
73 void UpdateLifeFlask();
74 void DrawManaFlask();
76 void UpdateManaFlask();
77 void InitControlPan();
78 void DrawCtrlPan();
79 void DrawCtrlBtns();
80 void DoSpeedBook();
81 void DoPanBtn();
82 void control_set_button_down(int btn_id);
84 void DoAutoMap();
85 void CheckPanelInfo();
86 void CheckBtnUp();
87 void FreeControlPan();
88 BOOL control_WriteStringToBuffer(BYTE *str);
89 void DrawInfoBox();
90 void PrintInfo();
91 void CPrintString(int y, char *str, BOOL center, int lines);
92 void PrintGameStr(int x, int y, const char *str, int color);
93 void DrawChr();
94 #define ADD_PlrStringXY(x, y, width, pszStr, col) MY_PlrStringXY(x, y, width, pszStr, col, 1)
95 void MY_PlrStringXY(int x, int y, int width, char *pszStr, char col, int base);
96 void CheckLvlBtn();
97 void ReleaseLvlBtn();
98 void DrawLevelUpIcon();
99 void CheckChrBtns();
100 void ReleaseChrBtns();
101 void DrawDurIcon();
102 int DrawDurIcon4Item(ItemStruct *pItem, int x, int c);
103 void RedBack();
104 char GetSBookTrans(int ii, BOOL townok);
105 void DrawSpellBook();
106 void PrintSBookStr(int x, int y, BOOL cjustflag, char *pszStr, char col);
107 void CheckSBook();
108 char *get_pieces_str(int nGold);
109 void DrawGoldSplit(int amount);
110 void control_drop_gold(char vkey);
111 void control_remove_gold(int pnum, int gold_index);
112 void control_set_gold_curs(int pnum);
113 void DrawTalkPan();
114 char *control_print_talk_msg(char *msg, int *x, int y, int just);
118 void control_type_message();
119 void control_reset_talk();
120 BOOL control_talk_last_key(int vkey);
121 BOOL control_presskeys(int vkey);
122 void control_press_enter();
123 void control_up_down(int v);
124 
125 /* rdata */
126 extern const BYTE fontframe[128];
127 extern const BYTE fontkern[68];
128 extern const int lineOffsets[5][5];
129 extern const BYTE gbFontTransTbl[256];
130 
131 /* data */
132 
133 extern char SpellITbl[MAX_SPELLS];
134 extern int PanBtnPos[8][5];
135 extern char *PanBtnHotKey[8];
136 extern char *PanBtnStr[8];
137 extern RECT32 ChrBtnsRect[4];
138 extern int SpellPages[6][7];
139 
140 #endif /* __CONTROL_H__ */
CheckChrBtns
void CheckChrBtns()
Definition: control.cpp:1590
control_set_button_down
void control_set_button_down(int btn_id)
Definition: control.cpp:939
control_drop_gold
void control_drop_gold(char vkey)
Definition: control.cpp:1926
FreeControlPan
void FreeControlPan()
Definition: control.cpp:1150
control_remove_gold
void control_remove_gold(int pnum, int gold_index)
Definition: control.cpp:1962
SetSpellTrans
void SetSpellTrans(char t)
Definition: control.cpp:230
pChrPanel
BYTE * pChrPanel
Definition: control.cpp:20
pGBoxBuff
BYTE * pGBoxBuff
Definition: control.cpp:39
CPrintString
void CPrintString(int y, char *str, BOOL center, int lines)
Definition: control.cpp:1273
control_press_enter
void control_press_enter()
Definition: control.cpp:2223
panelstr
char panelstr[4][64]
Definition: control.cpp:55
CheckSBook
void CheckSBook()
Definition: control.cpp:1864
MAX_PLRS
#define MAX_PLRS
Definition: defs.h:16
RedBack
void RedBack()
Definition: control.cpp:1715
DoAutoMap
void DoAutoMap()
Definition: control.cpp:962
pSpellCels
BYTE * pSpellCels
Definition: control.cpp:59
DrawManaFlask
void DrawManaFlask()
Definition: control.cpp:684
control_WriteStringToBuffer
BOOL control_WriteStringToBuffer(BYTE *str)
Definition: control.cpp:1170
PrintInfo
void PrintInfo()
Definition: control.cpp:1254
DrawFlask
void DrawFlask(BYTE *pCelBuff, int w, int nSrcOff, BYTE *pBuff, int nDstOff, int h)
Draws the dome of the flask that protrudes above the panel top line.
Definition: control.cpp:625
DrawSpell
void DrawSpell()
Sets the spell frame to draw and its position then draws it.
Definition: control.cpp:290
get_pieces_str
char * get_pieces_str(int nGold)
Definition: control.cpp:1891
DrawDurIcon4Item
int DrawDurIcon4Item(ItemStruct *pItem, int x, int c)
Definition: control.cpp:1680
talkbtndown
BOOL talkbtndown[3]
Definition: control.cpp:34
lvlbtndown
BOOL lvlbtndown
Definition: control.cpp:21
pstrjust
int pstrjust[4]
Definition: control.cpp:31
PrintGameStr
void PrintGameStr(int x, int y, const char *str, int color)
Definition: control.cpp:1306
DoSpeedBook
void DoSpeedBook()
Draws the "Speed Book": the rows of known spells for quick-setting a spell that show up when you clic...
Definition: control.cpp:864
initialDropGoldIndex
int initialDropGoldIndex
Definition: control.cpp:45
infoclr
char infoclr
Definition: control.cpp:37
whisper
BOOLEAN whisper[MAX_PLRS]
Definition: control.cpp:42
MY_PlrStringXY
void MY_PlrStringXY(int x, int y, int width, char *pszStr, char col, int base)
Render text string to back buffer.
Definition: control.cpp:1535
control_update_life_mana
void control_update_life_mana()
Definition: control.cpp:699
UpdateLifeFlask
void UpdateLifeFlask()
Controls the drawing of the area of the life flask within the control panel.
Definition: control.cpp:669
talkflag
BOOL talkflag
Definition: control.cpp:46
spselflag
BOOL spselflag
Definition: control.cpp:62
PrintChar
void PrintChar(int sx, int sy, int nCel, char col)
Print letter to the back buffer.
Definition: control.cpp:504
UpdateManaFlask
void UpdateManaFlask()
Controls the drawing of the area of the life flask within the control panel.
Definition: control.cpp:720
drawbtnflag
BOOL drawbtnflag
Definition: control.cpp:50
chrbtn
BOOL chrbtn[4]
Definition: control.cpp:17
pManaBuff
BYTE * pManaBuff
Definition: control.cpp:36
DrawSpellCel
void DrawSpellCel(int xp, int yp, BYTE *Trans, int nCel, int w)
Draw spell cell onto the back buffer.
Definition: control.cpp:225
pinfoflag
BOOL pinfoflag
Definition: control.cpp:33
InitPanelStr
void InitPanelStr()
InitControlPan
void InitControlPan()
Definition: control.cpp:747
SplTransTbl
BYTE SplTransTbl[256]
Definition: control.cpp:57
control_release_talk_btn
void control_release_talk_btn()
Definition: control.cpp:2111
pMultiBtns
BYTE * pMultiBtns
Definition: control.cpp:18
ItemStruct
Definition: structs.h:99
pnumlines
int pnumlines
Definition: control.cpp:32
PanBtnPos
int PanBtnPos[8][5]
Maps from panel_button_id to the position and dimensions of a panel button.
Definition: control.cpp:170
control_check_btn_press
void control_check_btn_press()
Definition: control.cpp:946
pSBkIconCels
BYTE * pSBkIconCels
Definition: control.cpp:47
fontkern
const BYTE fontkern[68]
Maps from smaltext.cel frame number to character width.
Definition: control.cpp:81
DrawLevelUpIcon
void DrawLevelUpIcon()
Definition: control.cpp:1579
SetSpeedSpell
void SetSpeedSpell(int slot)
Definition: control.cpp:453
control_talk_last_key
BOOL control_talk_last_key(int vkey)
Definition: control.cpp:2169
pChrButtons
BYTE * pChrButtons
Definition: control.cpp:13
fontframe
const BYTE fontframe[128]
Maps from font index to smaltext.cel frame number.
Definition: control.cpp:65
control_up_down
void control_up_down(int v)
Definition: control.cpp:2252
DrawDurIcon
void DrawDurIcon()
Definition: control.cpp:1663
ClearPanel
void ClearPanel()
Definition: control.cpp:559
DrawCtrlPan
void DrawCtrlPan()
Definition: control.cpp:831
RECT32
Definition: structs.h:11
DrawChr
void DrawChr()
Definition: control.cpp:1321
tempstr
char tempstr[256]
Definition: control.cpp:41
pStatusPanel
BYTE * pStatusPanel
Definition: control.cpp:54
DrawPanelBox
void DrawPanelBox(int x, int y, int w, int h, int sx, int sy)
Definition: control.cpp:565
sbookflag
BOOL sbookflag
Definition: control.cpp:48
pSBkBtnCel
BYTE * pSBkBtnCel
Definition: control.cpp:40
drawhpflag
BOOL drawhpflag
Definition: control.cpp:14
control_presskeys
BOOL control_presskeys(int vkey)
Definition: control.cpp:2190
CheckBtnUp
void CheckBtnUp()
Check if the mouse is within a control panel button that's flagged.
Definition: control.cpp:1075
DrawInfoBox
void DrawInfoBox()
Sets a string to be drawn in the info box and then draws it.
Definition: control.cpp:1190
control_print_talk_msg
char * control_print_talk_msg(char *msg, int *x, int y, int just)
Definition: control.cpp:2064
control_set_gold_curs
void control_set_gold_curs(int pnum)
Definition: control.cpp:1990
DrawTalkPan
void DrawTalkPan()
Definition: control.cpp:2002
ReleaseLvlBtn
void ReleaseLvlBtn()
Definition: control.cpp:1572
ReleaseChrBtns
void ReleaseChrBtns()
Definition: control.cpp:1628
chrbtnactive
BOOL chrbtnactive
Definition: control.cpp:25
initialDropGoldValue
int initialDropGoldValue
Definition: control.cpp:58
pSpell
int pSpell
Definition: control.cpp:35
SetSpell
void SetSpell()
Definition: control.cpp:442
panbtn
BOOL panbtn[8]
Definition: control.cpp:16
AddPanelString
void AddPanelString(char *str, BOOL just)
Definition: control.cpp:550
SpellITbl
char SpellITbl[MAX_SPELLS]
Maps from spell_id to spelicon.cel frame number.
Definition: control.cpp:130
numpanbtns
int numpanbtns
Definition: control.cpp:53
pLifeBuff
BYTE * pLifeBuff
Definition: control.cpp:28
DrawCtrlBtns
void DrawCtrlBtns()
Draws the control panel buttons in their current state.
Definition: control.cpp:841
CheckLvlBtn
void CheckLvlBtn()
Definition: control.cpp:1566
GetSBookTrans
char GetSBookTrans(int ii, BOOL townok)
Definition: control.cpp:1748
drawmanaflag
BOOL drawmanaflag
Definition: control.cpp:24
DrawLifeFlask
void DrawLifeFlask()
Draws the top dome of the life flask (that part that protrudes out of the control panel).
Definition: control.cpp:647
pDurIcons
BYTE * pDurIcons
Definition: control.cpp:12
panbtndown
BOOL panbtndown
Definition: control.cpp:60
control_reset_talk
void control_reset_talk()
Definition: control.cpp:2162
sbooktab
int sbooktab
Definition: control.cpp:43
SpellPages
int SpellPages[6][7]
Maps from spellbook page number and position to spell_id.
Definition: control.cpp:204
PanBtnHotKey
char * PanBtnHotKey[8]
Maps from panel_button_id to hotkey name.
Definition: control.cpp:183
DoPanBtn
void DoPanBtn()
Checks if the mouse cursor is within any of the panel buttons and flag it if so.
Definition: control.cpp:920
dropGoldFlag
BOOL dropGoldFlag
Definition: control.cpp:15
control_type_message
void control_type_message()
Definition: control.cpp:2143
infostr
char infostr[256]
Definition: control.cpp:52
DrawSpellList
void DrawSpellList()
Definition: control.cpp:317
control_reset_talk_msg
void control_reset_talk_msg()
lineOffsets
const int lineOffsets[5][5]
Line start position for info box text when displaying 1, 2, 3, 4 and 5 lines respectivly.
Definition: control.cpp:93
panelflag
BOOL panelflag
Definition: control.cpp:56
PanBtnStr
char * PanBtnStr[8]
Maps from panel_button_id to panel button description.
Definition: control.cpp:185
pPanelButtons
BYTE * pPanelButtons
Definition: control.cpp:19
gbFontTransTbl
const BYTE gbFontTransTbl[256]
Maps ASCII character code to font index, as used by the small, medium and large sized fonts; which co...
Definition: control.cpp:106
pSplType
int pSplType
Definition: control.cpp:44
chrflag
BOOL chrflag
Definition: control.cpp:49
ToggleSpell
void ToggleSpell(int slot)
Definition: control.cpp:467
ChrBtnsRect
RECT32 ChrBtnsRect[4]
Maps from attribute_id to the rectangle on screen used for attribute increment buttons.
Definition: control.cpp:196
pSpellBkCel
BYTE * pSpellBkCel
Definition: control.cpp:51
pPanelText
BYTE * pPanelText
Definition: control.cpp:27
control_check_talk_btn
BOOL control_check_talk_btn()
Definition: control.cpp:2086
CheckPanelInfo
void CheckPanelInfo()
Checks the mouse cursor position within the control panel and sets information strings if needed.
Definition: control.cpp:978
DrawSpellBook
void DrawSpellBook()
Definition: control.cpp:1774
pBtmBuff
BYTE * pBtmBuff
Definition: control.cpp:29
pTalkBtns
BYTE * pTalkBtns
Definition: control.cpp:30
PrintSBookStr
void PrintSBookStr(int x, int y, BOOL cjustflag, char *pszStr, char col)
Definition: control.cpp:1833
dropGoldValue
int dropGoldValue
Definition: control.cpp:23
MAX_SPELLS
#define MAX_SPELLS
Definition: defs.h:22
DrawGoldSplit
void DrawGoldSplit(int amount)
Definition: control.cpp:1901
pTalkPanel
BYTE * pTalkPanel
Definition: control.cpp:61
SetFlaskHeight
void SetFlaskHeight(BYTE *pCelBuff, int min, int max, int sx, int sy)
Draws a section of the empty flask cel on top of the panel to create the illusion of the flask gettin...
Definition: control.cpp:595