mirror of
https://github.com/ENSL/NS.git
synced 2024-12-21 10:10:50 +00:00
8552ac617c
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@1 67975925-1194-0748-b3d5-c16f83f1a3a1
64 lines
No EOL
1.3 KiB
C++
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 );
|
|
} |