Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
CConsole Class Reference

In-game console. More...

#include <CConsole.h>

Public Member Functions

 CConsole ()
 
 ~CConsole ()
 
void SetSize (float X=300, float Y=0, float W=800, float H=600)
 
void UpdateScreenSize (int w, int h)
 
void ToggleVisible ()
 
void SetVisible (bool visible)
 
void SetCursorBlinkRate (double rate)
 
void Update (const float deltaRealTime)
 
void Render ()
 
void InsertMessage (const wchar_t *szMessage,...) WPRINTF_ARGS(2)
 
void InsertChar (const int szChar, const wchar_t cooked)
 
void ReceivedChatMessage (const wchar_t *pSender, const wchar_t *szMessage)
 
void SetBuffer (const wchar_t *szMessage)
 
void UseHistoryFile (const VfsPath &filename, int historysize)
 
const wchar_tGetBuffer ()
 
void FlushBuffer ()
 
bool IsActive ()
 

Public Attributes

int m_iFontHeight
 
int m_iFontWidth
 
int m_iFontOffset
 
size_t m_charsPerPage
 

Private Member Functions

 NONCOPYABLE (CConsole)
 
void ToLower (wchar_t *szMessage, size_t iSize=0)
 
void Trim (wchar_t *szMessage, const wchar_t cChar=32, size_t iSize=0)
 
void DrawWindow (CShaderProgramPtr &shader)
 
void DrawHistory (CTextRenderer &textRenderer)
 
void DrawBuffer (CTextRenderer &textRenderer)
 
void DrawCursor (CTextRenderer &textRenderer)
 
bool IsEOB ()
 
bool IsBOB ()
 
bool IsFull ()
 
bool IsEmpty ()
 
void ProcessBuffer (const wchar_t *szLine)
 
void InsertMessageRaw (const CStrW &message)
 
void LoadHistory ()
 
void SaveHistory ()
 

Private Attributes

CMutex m_Mutex
 
float m_fX
 
float m_fY
 
float m_fHeight
 
float m_fWidth
 
float m_fVisibleFrac
 
std::deque< std::wstring > m_deqMsgHistory
 
std::deque< std::wstring > m_deqBufHistory
 
int m_iMsgHistPos
 
wchar_tm_szBuffer
 
int m_iBufferPos
 
int m_iBufferLength
 
VfsPath m_sHistoryFile
 
int m_MaxHistoryLines
 
bool m_bFocus
 
bool m_bVisible
 
bool m_bToggle
 
double m_prevTime
 
bool m_bCursorVisState
 
double m_cursorBlinkRate
 

Detailed Description

In-game console.

Thread-safety:

Definition at line 52 of file CConsole.h.

Constructor & Destructor Documentation

CConsole::CConsole ( )

Definition at line 48 of file CConsole.cpp.

CConsole::~CConsole ( )

Definition at line 69 of file CConsole.cpp.

Member Function Documentation

void CConsole::DrawBuffer ( CTextRenderer textRenderer)
private

Definition at line 290 of file CConsole.cpp.

void CConsole::DrawCursor ( CTextRenderer textRenderer)
private

Definition at line 317 of file CConsole.cpp.

void CConsole::DrawHistory ( CTextRenderer textRenderer)
private

Definition at line 267 of file CConsole.cpp.

void CConsole::DrawWindow ( CShaderProgramPtr shader)
private

Definition at line 231 of file CConsole.cpp.

void CConsole::FlushBuffer ( )

Definition at line 113 of file CConsole.cpp.

const wchar_t * CConsole::GetBuffer ( )

Definition at line 568 of file CConsole.cpp.

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

Definition at line 350 of file CConsole.cpp.

void CConsole::InsertMessage ( const wchar_t szMessage,
  ... 
)

Definition at line 508 of file CConsole.cpp.

void CConsole::InsertMessageRaw ( const CStrW &  message)
private

Definition at line 527 of file CConsole.cpp.

bool CConsole::IsActive ( )
inline

Definition at line 88 of file CConsole.h.

bool CConsole::IsBOB ( )
inlineprivate

Definition at line 137 of file CConsole.h.

bool CConsole::IsEmpty ( )
inlineprivate

Definition at line 139 of file CConsole.h.

bool CConsole::IsEOB ( )
inlineprivate

Definition at line 136 of file CConsole.h.

bool CConsole::IsFull ( )
inlineprivate

Definition at line 138 of file CConsole.h.

void CConsole::LoadHistory ( )
private

Definition at line 612 of file CConsole.cpp.

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

Definition at line 594 of file CConsole.cpp.

void CConsole::ReceivedChatMessage ( const wchar_t pSender,
const wchar_t szMessage 
)

Definition at line 660 of file CConsole.cpp.

void CConsole::Render ( )

Definition at line 190 of file CConsole.cpp.

void CConsole::SaveHistory ( )
private

Definition at line 643 of file CConsole.cpp.

void CConsole::SetBuffer ( const wchar_t szMessage)

Definition at line 574 of file CConsole.cpp.

void CConsole::SetCursorBlinkRate ( double  rate)

Definition at line 108 of file CConsole.cpp.

void CConsole::SetSize ( float  X = 300,
float  Y = 0,
float  W = 800,
float  H = 600 
)

Definition at line 75 of file CConsole.cpp.

void CConsole::SetVisible ( bool  visible)

Definition at line 96 of file CConsole.cpp.

void CConsole::ToggleVisible ( )

Definition at line 90 of file CConsole.cpp.

void CConsole::ToLower ( wchar_t szMessage,
size_t  iSize = 0 
)
private

Definition at line 121 of file CConsole.cpp.

void CConsole::Trim ( wchar_t szMessage,
const wchar_t  cChar = 32,
size_t  iSize = 0 
)
private

Definition at line 134 of file CConsole.cpp.

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

Definition at line 162 of file CConsole.cpp.

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

Definition at line 83 of file CConsole.cpp.

void CConsole::UseHistoryFile ( const VfsPath filename,
int  historysize 
)

Definition at line 586 of file CConsole.cpp.

Member Data Documentation

bool CConsole::m_bCursorVisState
private

Definition at line 125 of file CConsole.h.

bool CConsole::m_bFocus
private

Definition at line 121 of file CConsole.h.

bool CConsole::m_bToggle
private

Definition at line 123 of file CConsole.h.

bool CConsole::m_bVisible
private

Definition at line 122 of file CConsole.h.

size_t CConsole::m_charsPerPage

Definition at line 93 of file CConsole.h.

double CConsole::m_cursorBlinkRate
private

Definition at line 126 of file CConsole.h.

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

Definition at line 110 of file CConsole.h.

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

Definition at line 109 of file CConsole.h.

float CConsole::m_fHeight
private

Definition at line 102 of file CConsole.h.

float CConsole::m_fVisibleFrac
private

Definition at line 107 of file CConsole.h.

float CConsole::m_fWidth
private

Definition at line 103 of file CConsole.h.

float CConsole::m_fX
private

Definition at line 99 of file CConsole.h.

float CConsole::m_fY
private

Definition at line 100 of file CConsole.h.

int CConsole::m_iBufferLength
private

Definition at line 116 of file CConsole.h.

int CConsole::m_iBufferPos
private

Definition at line 115 of file CConsole.h.

int CConsole::m_iFontHeight

Definition at line 90 of file CConsole.h.

int CConsole::m_iFontOffset

Definition at line 92 of file CConsole.h.

int CConsole::m_iFontWidth

Definition at line 91 of file CConsole.h.

int CConsole::m_iMsgHistPos
private

Definition at line 112 of file CConsole.h.

int CConsole::m_MaxHistoryLines
private

Definition at line 119 of file CConsole.h.

CMutex CConsole::m_Mutex
private

Definition at line 97 of file CConsole.h.

double CConsole::m_prevTime
private

Definition at line 124 of file CConsole.h.

VfsPath CConsole::m_sHistoryFile
private

Definition at line 118 of file CConsole.h.

wchar_t* CConsole::m_szBuffer
private

Definition at line 114 of file CConsole.h.


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