ns/releases/3.1.3/source/cl_dll/cl_util.cpp
puzl 860617f419 made a copy
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@376 67975925-1194-0748-b3d5-c16f83f1a3a1
2006-01-15 21:48:23 +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 );
}