ns/dev/performance/source/cl_dll/cl_util.cpp
tankefugl 3e025675b3 Branched for the performance test.
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@219 67975925-1194-0748-b3d5-c16f83f1a3a1
2005-06-29 13:16:09 +00:00

64 lines
No EOL
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 );
}