Pyrogenesis trunk
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CConsole Class Reference

In-game console. More...

#include <CConsole.h>

Collaboration diagram for CConsole:
Collaboration graph
[legend]

Public Member Functions

 CConsole ()
 
 ~CConsole ()
 
void Init ()
 
void UpdateScreenSize (int w, int h)
 
void ToggleVisible ()
 
void SetVisible (bool visible)
 
void Update (const float deltaRealTime)
 
void Render (CCanvas2D &canvas)
 
void InsertChar (const int szChar, const wchar_t cooked)
 
void InsertMessage (const std::string &message)
 
void SetBuffer (const wchar_t *szMessage)
 
const wchar_t * GetBuffer ()
 
void FlushBuffer ()
 
bool IsActive () const
 

Private Member Functions

 NONCOPYABLE (CConsole)
 
void DrawWindow (CCanvas2D &canvas)
 
void DrawHistory (CTextRenderer &textRenderer)
 
void DrawBuffer (CTextRenderer &textRenderer)
 
void DrawCursor (CTextRenderer &textRenderer)
 
bool IsEOB () const
 
bool IsBOB () const
 
bool IsFull () const
 
bool IsEmpty () const
 
void ProcessBuffer (const wchar_t *szLine)
 
void LoadHistory ()
 
void SaveHistory ()
 
void ShowQuitHotkeys ()
 

Private Attributes

std::mutex m_Mutex
 
int m_FontHeight
 
int m_FontWidth
 
int m_FontOffset
 
size_t m_CharsPerPage
 
float m_X
 
float m_Y
 
float m_Height
 
float m_Width
 
float m_VisibleFrac
 
std::deque< std::wstring > m_MsgHistory
 
std::deque< std::wstring > m_BufHistory
 
int m_MsgHistPos
 
std::unique_ptr< wchar_t[]> m_Buffer
 
int m_BufferPos
 
int m_BufferLength
 
VfsPath m_HistoryFile
 
int m_MaxHistoryLines
 
bool m_Visible
 
bool m_Toggle
 
double m_PrevTime
 
bool m_CursorVisState
 
bool m_QuitHotkeyWasShown
 
double m_CursorBlinkRate
 

Detailed Description

In-game console.

Thread-safety:

Constructor & Destructor Documentation

◆ CConsole()

CConsole::CConsole ( )

◆ ~CConsole()

CConsole::~CConsole ( )
default

Member Function Documentation

◆ DrawBuffer()

void CConsole::DrawBuffer ( CTextRenderer textRenderer)
private

◆ DrawCursor()

void CConsole::DrawCursor ( CTextRenderer textRenderer)
private

◆ DrawHistory()

void CConsole::DrawHistory ( CTextRenderer textRenderer)
private

◆ DrawWindow()

void CConsole::DrawWindow ( CCanvas2D canvas)
private

◆ FlushBuffer()

void CConsole::FlushBuffer ( )

◆ GetBuffer()

const wchar_t * CConsole::GetBuffer ( )

◆ Init()

void CConsole::Init ( )

◆ InsertChar()

void CConsole::InsertChar ( const int  szChar,
const wchar_t  cooked 
)

◆ InsertMessage()

void CConsole::InsertMessage ( const std::string &  message)

◆ IsActive()

bool CConsole::IsActive ( ) const
inline

◆ IsBOB()

bool CConsole::IsBOB ( ) const
private

◆ IsEmpty()

bool CConsole::IsEmpty ( ) const
private

◆ IsEOB()

bool CConsole::IsEOB ( ) const
private

◆ IsFull()

bool CConsole::IsFull ( ) const
private

◆ LoadHistory()

void CConsole::LoadHistory ( )
private

◆ NONCOPYABLE()

CConsole::NONCOPYABLE ( CConsole  )
private

◆ ProcessBuffer()

void CConsole::ProcessBuffer ( const wchar_t *  szLine)
private

◆ Render()

void CConsole::Render ( CCanvas2D canvas)

◆ SaveHistory()

void CConsole::SaveHistory ( )
private

◆ SetBuffer()

void CConsole::SetBuffer ( const wchar_t *  szMessage)

◆ SetVisible()

void CConsole::SetVisible ( bool  visible)

◆ ShowQuitHotkeys()

void CConsole::ShowQuitHotkeys ( )
private

◆ ToggleVisible()

void CConsole::ToggleVisible ( )

◆ Update()

void CConsole::Update ( const float  deltaRealTime)
Parameters
deltaRealTimeElapsed real time since the last frame.

◆ UpdateScreenSize()

void CConsole::UpdateScreenSize ( int  w,
int  h 
)

Member Data Documentation

◆ m_Buffer

std::unique_ptr<wchar_t[]> CConsole::m_Buffer
private

◆ m_BufferLength

int CConsole::m_BufferLength
private

◆ m_BufferPos

int CConsole::m_BufferPos
private

◆ m_BufHistory

std::deque<std::wstring> CConsole::m_BufHistory
private

◆ m_CharsPerPage

size_t CConsole::m_CharsPerPage
private

◆ m_CursorBlinkRate

double CConsole::m_CursorBlinkRate
private

◆ m_CursorVisState

bool CConsole::m_CursorVisState
private

◆ m_FontHeight

int CConsole::m_FontHeight
private

◆ m_FontOffset

int CConsole::m_FontOffset
private

◆ m_FontWidth

int CConsole::m_FontWidth
private

◆ m_Height

float CConsole::m_Height
private

◆ m_HistoryFile

VfsPath CConsole::m_HistoryFile
private

◆ m_MaxHistoryLines

int CConsole::m_MaxHistoryLines
private

◆ m_MsgHistory

std::deque<std::wstring> CConsole::m_MsgHistory
private

◆ m_MsgHistPos

int CConsole::m_MsgHistPos
private

◆ m_Mutex

std::mutex CConsole::m_Mutex
private

◆ m_PrevTime

double CConsole::m_PrevTime
private

◆ m_QuitHotkeyWasShown

bool CConsole::m_QuitHotkeyWasShown
private

◆ m_Toggle

bool CConsole::m_Toggle
private

◆ m_Visible

bool CConsole::m_Visible
private

◆ m_VisibleFrac

float CConsole::m_VisibleFrac
private

◆ m_Width

float CConsole::m_Width
private

◆ m_X

float CConsole::m_X
private

◆ m_Y

float CConsole::m_Y
private

The documentation for this class was generated from the following files: