Devilution
Diablo devolved - magic behind the 1996 computer game
Macros | Functions | Variables
control.cpp File Reference
#include "all.h"

Go to the source code of this file.

Macros

#define SPLICONLENGTH   56
 
#define SPLROWICONLS   10
 
#define SPLICONLAST   43
 

Functions

void DrawSpellCel (int xp, int yp, BYTE *Trans, int nCel, int w)
 Draw spell cell onto the back buffer. More...
 
void SetSpellTrans (char t)
 
void DrawSpell ()
 Sets the spell frame to draw and its position then draws it. More...
 
void DrawSpellList ()
 
void SetSpell ()
 
void SetSpeedSpell (int slot)
 
void ToggleSpell (int slot)
 
void PrintChar (int sx, int sy, int nCel, char col)
 Print letter to the back buffer. More...
 
void AddPanelString (char *str, BOOL just)
 
void ClearPanel ()
 
void DrawPanelBox (int x, int y, int w, int h, int sx, int sy)
 
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 getting empty. More...
 
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. More...
 
void DrawLifeFlask ()
 Draws the top dome of the life flask (that part that protrudes out of the control panel). More...
 
void UpdateLifeFlask ()
 Controls the drawing of the area of the life flask within the control panel. More...
 
void DrawManaFlask ()
 
void control_update_life_mana ()
 
void UpdateManaFlask ()
 Controls the drawing of the area of the life flask within the control panel. More...
 
void InitControlPan ()
 
void DrawCtrlPan ()
 
void DrawCtrlBtns ()
 Draws the control panel buttons in their current state. More...
 
void DoSpeedBook ()
 Draws the "Speed Book": the rows of known spells for quick-setting a spell that show up when you click the spell slot at the control panel. More...
 
void DoPanBtn ()
 Checks if the mouse cursor is within any of the panel buttons and flag it if so. More...
 
void control_set_button_down (int btn_id)
 
void control_check_btn_press ()
 
void DoAutoMap ()
 
void CheckPanelInfo ()
 Checks the mouse cursor position within the control panel and sets information strings if needed. More...
 
void CheckBtnUp ()
 Check if the mouse is within a control panel button that's flagged. More...
 
void FreeControlPan ()
 
BOOL control_WriteStringToBuffer (BYTE *str)
 
void DrawInfoBox ()
 Sets a string to be drawn in the info box and then draws it. More...
 
void PrintInfo ()
 
void CPrintString (int y, char *str, BOOL center, int lines)
 
void PrintGameStr (int x, int y, const char *str, int color)
 
void DrawChr ()
 
void MY_PlrStringXY (int x, int y, int endX, char *pszStr, char col, int base)
 Render text string to back buffer. More...
 
void CheckLvlBtn ()
 
void ReleaseLvlBtn ()
 
void DrawLevelUpIcon ()
 
void CheckChrBtns ()
 
void ReleaseChrBtns ()
 
void DrawDurIcon ()
 
int DrawDurIcon4Item (ItemStruct *pItem, int x, int c)
 
void RedBack ()
 
char GetSBookTrans (int ii, BOOL townok)
 
void DrawSpellBook ()
 
void PrintSBookStr (int x, int y, BOOL cjustflag, char *pszStr, char col)
 
void CheckSBook ()
 
char * get_pieces_str (int nGold)
 
void DrawGoldSplit (int amount)
 
void control_drop_gold (char vkey)
 
void control_remove_gold (int pnum, int gold_index)
 
void control_set_gold_curs (int pnum)
 
void DrawTalkPan ()
 
char * control_print_talk_msg (char *msg, int *x, int y, int color)
 
BOOL control_check_talk_btn ()
 
void control_release_talk_btn ()
 
void control_reset_talk_msg (char *msg)
 
void control_type_message ()
 
void control_reset_talk ()
 
BOOL control_talk_last_key (int vkey)
 
BOOL control_presskeys (int vkey)
 
void control_press_enter ()
 
void control_up_down (int v)
 

Variables

DEVILUTION_BEGIN_NAMESPACE BYTE sgbNextTalkSave
 
BYTE sgbTalkSavePos
 
BYTE * pDurIcons
 
BYTE * pChrButtons
 
BOOL drawhpflag
 
BOOL dropGoldFlag
 
BOOL panbtn [8]
 
BOOL chrbtn [4]
 
BYTE * pMultiBtns
 
BYTE * pPanelButtons
 
BYTE * pChrPanel
 
BOOL lvlbtndown
 
char sgszTalkSave [8][80]
 
int dropGoldValue
 
BOOL drawmanaflag
 
BOOL chrbtnactive
 
char sgszTalkMsg [MAX_SEND_STR_LEN]
 
BYTE * pPanelText
 
BYTE * pLifeBuff
 
BYTE * pBtmBuff
 
BYTE * pTalkBtns
 
BOOL pstrjust [4]
 
int pnumlines
 
BOOL pinfoflag
 
BOOL talkbtndown [3]
 
int pSpell
 
BYTE * pManaBuff
 
char infoclr
 
int sgbPlrTalkTbl
 
BYTE * pGBoxBuff
 
BYTE * pSBkBtnCel
 
char tempstr [256]
 
BOOLEAN whisper [MAX_PLRS]
 
int sbooktab
 
int pSplType
 
int initialDropGoldIndex
 
BOOL talkflag
 
BYTE * pSBkIconCels
 
BOOL sbookflag
 
BOOL chrflag
 
BOOL drawbtnflag
 
BYTE * pSpellBkCel
 
char infostr [256]
 
int numpanbtns
 
BYTE * pStatusPanel
 
char panelstr [4][64]
 
BOOL panelflag
 
BYTE SplTransTbl [256]
 
int initialDropGoldValue
 
BYTE * pSpellCels
 
BOOL panbtndown
 
BYTE * pTalkPanel
 
BOOL spselflag
 
const BYTE fontframe [128]
 Maps from font index to smaltext.cel frame number. More...
 
const BYTE fontkern [68]
 Maps from smaltext.cel frame number to character width. More...
 
const int lineOffsets [5][5]
 Line start position for info box text when displaying 1, 2, 3, 4 and 5 lines respectivly. More...
 
const BYTE gbFontTransTbl [256]
 Maps ASCII character code to font index, as used by the small, medium and large sized fonts; which corresponds to smaltext.cel, medtexts.cel and bigtgold.cel respectively. More...
 
char SpellITbl [MAX_SPELLS]
 Maps from spell_id to spelicon.cel frame number. More...
 
int PanBtnPos [8][5]
 Maps from panel_button_id to the position and dimensions of a panel button. More...
 
char * PanBtnHotKey [8] = { "'c'", "'q'", "Tab", "Esc", "'i'", "'b'", "Enter", NULL }
 Maps from panel_button_id to hotkey name. More...
 
char * PanBtnStr [8]
 Maps from panel_button_id to panel button description. More...
 
RECT32 ChrBtnsRect [4]
 Maps from attribute_id to the rectangle on screen used for attribute increment buttons. More...
 
int SpellPages [6][7]
 Maps from spellbook page number and position to spell_id. More...
 

Detailed Description

Implementation of the character and main control panels

Definition in file control.cpp.

SPL_HBOLT
@ SPL_HBOLT
Definition: enums.h:2161
SPL_FLAME
@ SPL_FLAME
Definition: enums.h:2150
SPL_FIREBOLT
@ SPL_FIREBOLT
Definition: enums.h:2131
SPL_RESURRECT
@ SPL_RESURRECT
Definition: enums.h:2162
SPL_HEALOTHER
@ SPL_HEALOTHER
Definition: enums.h:2164
SPL_NULL
@ SPL_NULL
Definition: enums.h:2130
SPL_STONE
@ SPL_STONE
Definition: enums.h:2138
SPL_TOWN
@ SPL_TOWN
Definition: enums.h:2137
SPL_FIREWALL
@ SPL_FIREWALL
Definition: enums.h:2136
SPL_FIREBALL
@ SPL_FIREBALL
Definition: enums.h:2142
SPL_RNDTELEPORT
@ SPL_RNDTELEPORT
Definition: enums.h:2140
SPL_MANASHIELD
@ SPL_MANASHIELD
Definition: enums.h:2141
SPL_ETHEREALIZE
@ SPL_ETHEREALIZE
Definition: enums.h:2155
SPL_LIGHTNING
@ SPL_LIGHTNING
Definition: enums.h:2133
SPL_GOLEM
@ SPL_GOLEM
Definition: enums.h:2151
SPL_CHAIN
@ SPL_CHAIN
Definition: enums.h:2144
SPL_ELEMENT
@ SPL_ELEMENT
Definition: enums.h:2159
SPL_TELEKINESIS
@ SPL_TELEKINESIS
Definition: enums.h:2163
SPL_CBOLT
@ SPL_CBOLT
Definition: enums.h:2160
SPL_FLARE
@ SPL_FLARE
Definition: enums.h:2165
SPL_BONESPIRIT
@ SPL_BONESPIRIT
Definition: enums.h:2166
SPL_HEAL
@ SPL_HEAL
Definition: enums.h:2132
SPL_APOCA
@ SPL_APOCA
Definition: enums.h:2154
SPL_NOVA
@ SPL_NOVA
Definition: enums.h:2148
PANEL_TOP
#define PANEL_TOP
Definition: defs.h:134
SPL_GUARDIAN
@ SPL_GUARDIAN
Definition: enums.h:2143
SPL_FLASH
@ SPL_FLASH
Definition: enums.h:2134
SPL_TELEPORT
@ SPL_TELEPORT
Definition: enums.h:2153
PANEL_LEFT
#define PANEL_LEFT
Definition: defs.h:135
SPL_WAVE
@ SPL_WAVE
Definition: enums.h:2145