mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Add plStatusLog to the list of converted interface, in order to fix my log output dir screw-up
This commit is contained in:
@ -97,11 +97,17 @@ class plDebugText
|
||||
|
||||
static plDebugText &Instance( void ) { return fInstance; }
|
||||
|
||||
uint32_t CalcStringWidth( const char *string );
|
||||
uint32_t CalcStringWidth(const char *string);
|
||||
uint32_t CalcStringWidth_TEMP(const plString &string) { return CalcStringWidth(string.c_str()); }
|
||||
|
||||
void DrawString( uint16_t x, uint16_t y, const char *string, uint32_t hexColor, uint8_t style = 0 );
|
||||
void DrawString(uint16_t x, uint16_t y, const char *string, uint32_t hexColor, uint8_t style = 0);
|
||||
|
||||
void DrawString( uint16_t x, uint16_t y, const char *string, hsColorRGBA &color, uint8_t style = 0 )
|
||||
void DrawString_TEMP(uint16_t x, uint16_t y, const plString &string, uint32_t hexColor, uint8_t style = 0)
|
||||
{
|
||||
DrawString(x, y, string.c_str(), hexColor, style);
|
||||
}
|
||||
|
||||
void DrawString(uint16_t x, uint16_t y, const plString &string, hsColorRGBA &color, uint8_t style = 0)
|
||||
{
|
||||
uint32_t hex;
|
||||
uint8_t r, g, b, a;
|
||||
@ -113,12 +119,12 @@ class plDebugText
|
||||
a = (uint8_t)( color.a * 255.0 );
|
||||
hex = ( a << 24 ) | ( r << 16 ) | ( g << 8 ) | ( b );
|
||||
|
||||
DrawString( x, y, string, hex, style );
|
||||
DrawString_TEMP(x, y, string, hex, style);
|
||||
}
|
||||
|
||||
void DrawString( uint16_t x, uint16_t y, const char *string, uint8_t r = 255, uint8_t g = 255, uint8_t b = 255, uint8_t a = 255, uint8_t style = 0 )
|
||||
void DrawString(uint16_t x, uint16_t y, const plString &string, uint8_t r = 255, uint8_t g = 255, uint8_t b = 255, uint8_t a = 255, uint8_t style = 0)
|
||||
{
|
||||
DrawString( x, y, string, (uint32_t)( ( a << 24 ) | ( r << 16 ) | ( g << 8 ) | ( b ) ), style );
|
||||
DrawString_TEMP(x, y, string, (uint32_t)( ( a << 24 ) | ( r << 16 ) | ( g << 8 ) | ( b ) ), style);
|
||||
}
|
||||
|
||||
void SetDrawOnTopMode( bool enable ) { fDrawOnTopMode = enable; }
|
||||
@ -138,7 +144,7 @@ class plDebugText
|
||||
void SetManager( plDebugTextManager *m ) { fManager = m; }
|
||||
|
||||
void SetFont(const char *face, uint16_t size ) { hsStrncpy( fFontFace, face, sizeof( fFontFace ) ); fFontSize = size; }
|
||||
const char *GetFontFace( void ) { return fFontFace; }
|
||||
const char *GetFontFace( void ) { return fFontFace; }
|
||||
uint16_t GetFontSize( void ) { return fFontSize; }
|
||||
uint16_t GetFontHeight();
|
||||
|
||||
|
@ -62,7 +62,7 @@ void plStatusLogDrawer::IDrawLogNames(plStatusLog* curLog, plStatusLog* firstLog
|
||||
plStatusLog* iLog = firstLog;
|
||||
while (iLog)
|
||||
{
|
||||
width = hsMaximum(drawText.CalcStringWidth(iLog->GetFileName()) + 4, width);
|
||||
width = hsMaximum(drawText.CalcStringWidth_TEMP(iLog->GetFileName().AsString()) + 4, width);
|
||||
iLog = iLog->fNext;
|
||||
numLogs++;
|
||||
}
|
||||
@ -75,9 +75,9 @@ void plStatusLogDrawer::IDrawLogNames(plStatusLog* curLog, plStatusLog* firstLog
|
||||
while (iLog)
|
||||
{
|
||||
if (iLog == curLog)
|
||||
drawText.DrawString(2, (uint16_t)yPos, iLog->GetFileName(), 0, 255, 0);
|
||||
drawText.DrawString(2, (uint16_t)yPos, iLog->GetFileName().AsString(), 0, 255, 0);
|
||||
else
|
||||
drawText.DrawString(2, (uint16_t)yPos, iLog->GetFileName());
|
||||
drawText.DrawString(2, (uint16_t)yPos, iLog->GetFileName().AsString());
|
||||
|
||||
iLog = iLog->fNext;
|
||||
yPos += height;
|
||||
@ -110,7 +110,7 @@ void plStatusLogDrawer::Draw(plStatusLog* curLog, plStatusLog* firstLog)
|
||||
if( IGetFlags( curLog ) & plStatusLog::kFilledBackground )
|
||||
drawText.DrawRect( x, y, x + width, y + height, 0, 0, 0, 127 );
|
||||
|
||||
drawText.DrawString( x + 2, y + ( lineHt >> 1 ), IGetFilename( curLog ), 127, 127, 255, 255, plDebugText::kStyleBold );
|
||||
drawText.DrawString( x + 2, y + ( lineHt >> 1 ), IGetFilename( curLog ).AsString(), 127, 127, 255, 255, plDebugText::kStyleBold );
|
||||
drawText.DrawRect( x + 2, y + ( lineHt << 1 ) + 1,
|
||||
x + width - 8, y + ( lineHt << 1 ) + 2, 127, 127, 255, 255 );
|
||||
|
||||
|
Reference in New Issue
Block a user