mirror of
https://github.com/ENSL/NS.git
synced 2024-12-13 06:00:49 +00:00
64 lines
1.3 KiB
C++
64 lines
1.3 KiB
C++
|
#include "hud.h"
|
||
|
#include "cl_dll/cl_util.h"
|
||
|
|
||
|
float gTextR = 1;
|
||
|
float gTextG = 1;
|
||
|
float gTextB = 1;
|
||
|
|
||
|
void DrawSetTextColor(float r, float g, float b )
|
||
|
{
|
||
|
gTextR = r;
|
||
|
gTextG = g;
|
||
|
gTextB = b;
|
||
|
gEngfuncs.pfnDrawSetTextColor(r, g, b);
|
||
|
}
|
||
|
|
||
|
int DrawConsoleString( int x, int y, const char *string )
|
||
|
{
|
||
|
//return gEngfuncs.pfnDrawConsoleString( x, y, (char*) string );
|
||
|
|
||
|
if (string[0] == 2)
|
||
|
{
|
||
|
++string;
|
||
|
}
|
||
|
|
||
|
int result = gHUD.GetSmallFont().DrawString(x, y, string, gTextR * 255, gTextG * 255, gTextB * 255, kRenderTransAdd);
|
||
|
DrawSetTextColor(1, 1, 1);
|
||
|
|
||
|
return result;
|
||
|
|
||
|
}
|
||
|
|
||
|
void GetConsoleStringSize( const char *string, int *width, int *height )
|
||
|
{
|
||
|
|
||
|
//gEngfuncs.pfnDrawConsoleStringLen( string, width, height );
|
||
|
|
||
|
if (string[0] == 2)
|
||
|
{
|
||
|
++string;
|
||
|
}
|
||
|
|
||
|
*width = gHUD.GetSmallFont().GetStringWidth(string);
|
||
|
*height = gHUD.GetSmallFont().GetStringHeight();
|
||
|
|
||
|
}
|
||
|
|
||
|
int ConsoleStringLen( const char *string )
|
||
|
{
|
||
|
int _width, _height;
|
||
|
GetConsoleStringSize( string, &_width, &_height );
|
||
|
return _width;
|
||
|
}
|
||
|
|
||
|
void ConsolePrint( const char *string )
|
||
|
{
|
||
|
// TODO Max: implement this
|
||
|
gEngfuncs.pfnConsolePrint( string );
|
||
|
}
|
||
|
|
||
|
void CenterPrint( const char *string )
|
||
|
{
|
||
|
// TODO Max: implement this
|
||
|
gEngfuncs.pfnCenterPrint( string );
|
||
|
}
|