本文整理汇总了C++中SCR_DrawStringExt函数的典型用法代码示例。如果您正苦于以下问题:C++ SCR_DrawStringExt函数的具体用法?C++ SCR_DrawStringExt怎么用?C++ SCR_DrawStringExt使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SCR_DrawStringExt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SCR_DrawDemoRecording
/*
=================
SCR_DrawDemoRecording
=================
*/
void SCR_DrawDemoRecording( void ) {
#if !defined RTCW_ET
char string[1024];
int pos;
#endif // RTCW_XX
if ( !clc.demorecording ) {
return;
}
#if !defined RTCW_ET
pos = FS_FTell( clc.demofile );
sprintf( string, "RECORDING %s: %ik", clc.demoName, pos / 1024 );
#else
//bani
Cvar_Set( "cl_demooffset", va( "%d", FS_FTell( clc.demofile ) ) );
#endif // RTCW_XX
#if defined RTCW_SP
SCR_DrawStringExt( 320 - strlen( string ) * 4, 20, 8, string, g_color_table[7], qtrue );
#elif defined RTCW_MP
SCR_DrawStringExt( 5, 470, 8, string, g_color_table[7], qtrue );
#endif // RTCW_XX
}
示例2: MV_DrawConnectingInfo
void MV_DrawConnectingInfo( void )
{ // Versioninfo when loading...
int yPos = 5;
int line = 17;
char txtbuf[128];
Com_sprintf(txtbuf, sizeof(txtbuf), "^1[ ^7JK2MV " JK2MV_VERSION " " CPUSTRING " ^1]");
SCR_DrawStringExt(320 - SCR_Strlen(txtbuf) * 4, yPos + (line * 0), 8, txtbuf, g_color_table[7], qfalse);
Com_sprintf(txtbuf, sizeof(txtbuf), "Game-Version^1: ^71.%02d", (int)MV_GetCurrentGameversion());
SCR_DrawStringExt((int)(320 - SCR_Strlen(txtbuf) * 3.5), yPos + (line * 1), 7, txtbuf, g_color_table[7], qfalse);
}
示例3: SCR_DrawVoipMeter
/*
=================
SCR_DrawVoipMeter
=================
*/
void SCR_DrawVoipMeter( void ) {
char buffer[16];
char string[256];
int limit, i;
if (!cl_voipShowMeter->integer)
return; // player doesn't want to show meter at all.
else if (!cl_voipSend->integer)
return; // not recording at the moment.
else if (clc.state != CA_ACTIVE)
return; // not connected to a server.
else if (!clc.voipEnabled)
return; // server doesn't support VoIP.
else if (clc.demoplaying)
return; // playing back a demo.
else if (!cl_voip->integer)
return; // client has VoIP support disabled.
limit = (int) (clc.voipPower * 10.0f);
if (limit > 10)
limit = 10;
for (i = 0; i < limit; i++)
buffer[i] = '*';
while (i < 10)
buffer[i++] = ' ';
buffer[i] = '\0';
sprintf( string, "VoIP: [%s]", buffer );
SCR_DrawStringExt( 320 - strlen( string ) * 4, 10, 8, string, g_color_table[7], qtrue, qfalse );
}
示例4: SCR_DrawBigString
void SCR_DrawBigString( int x, int y, const char *s, float alpha ) {
float color[4];
color[0] = color[1] = color[2] = 1.0;
color[3] = alpha;
SCR_DrawStringExt( x, y, BIGCHAR_WIDTH, s, color, qfalse );
}
示例5: SCR_DrawClock
/*
=================
SCR_DrawClock
=================
*/
static void SCR_DrawClock( void ) {
qtime_t myTime;
char string[16];
if (Cvar_VariableValue ("cl_drawclock")) {
Com_RealTime( &myTime );
Com_sprintf( string, sizeof ( string ), "%02i:%02i:%02i", myTime.tm_hour, myTime.tm_min, myTime.tm_sec );
SCR_DrawStringExt( 320 - strlen( string ) * 4, 11, 8, string, g_color_table[ColorIndex(COLOR_CYAN)], qtrue, qfalse );
}
}
示例6: SCR_DrawDemoRecording
/*
=================
SCR_DrawDemoRecording
=================
*/
void SCR_DrawDemoRecording( void ) {
char string[1024];
int pos;
if ( !clc.demorecording ) {
return;
}
if ( clc.spDemoRecording ) {
return;
}
pos = FS_FTell( clc.demofile );
#ifdef URBAN_TERROR
sprintf( string, "REC: %.10s...: %iKB", clc.demoName, pos / 1024 );
SCR_DrawStringExt( 320 - strlen( string ) * 4, 1, 8, string, g_color_table[ColorIndex(COLOR_RED)], qtrue, qfalse );
#else
sprintf( string, "RECORDING %s: %ik", clc.demoName, pos / 1024 );
SCR_DrawStringExt( 320 - strlen( string ) * 4, 20, 8, string, g_color_table[7], qtrue, qfalse );
#endif
}
示例7: SCR_StopWatch
void SCR_StopWatch (void) {
static unsigned long long int time, last_recorded, time_paused;
static int ms, sec, min, h;
char stopwatch[1024]; //fix its size, again
int posx, posy, posxx, posyy, size;
posx = clu.cl_stopwatchposx->integer;
posy = clu.cl_stopwatchposy->integer;
size = clu.cl_stopwatchsize->integer;
//using cls.realtime - affected by /timescale - on purpose
if (sw.cmd == ZERO || !sw.cmd) { // || initially
time = 0;
last_recorded = cls.realtime; //to allow for zeroed realtime
sw.state = ZEROED;
time_paused = 0;
} else if (sw.cmd == PLAY) {
time = time_paused + cls.realtime - last_recorded;
sw.state = PLAYING;
} else if (sw.cmd == PAUSE && sw.state == PLAYING) {
//time remains unchanged from here on
time_paused = time;
last_recorded = cls.realtime;
sw.state = PAUSED;
} else if (sw.cmd == PAUSE && sw.state == PAUSED) {
last_recorded = cls.realtime; //keep track of time when paused for later use
}
//cheers to gigahertz205
//don't make it unreadable with resultant numbers, that's what compilers are for
h = time / (1000*60*60);
min = (time % (1000*60*60)) / (1000*60);
sec = ((time % (1000*60*60)) % (1000*60)) / 1000;
ms = ((time % (1000*60*60)) % (1000*60)) % 1000;
Com_sprintf( stopwatch, sizeof ( stopwatch ), "%0i:%02i:%02i:%03i",h,min,sec,ms);
if (posx >= 0 && posx < 21)
posxx = posx * 30;
else
posxx = 0;
if (posy >= 0 && posy < 24)
posyy = posy * 20;
else
posyy = 0;
SCR_DrawStringExt(posxx, posyy, size, stopwatch, g_color_table[3], qtrue, qtrue);
}
示例8: SCR_DrawDemoRecording
/*
=================
SCR_DrawDemoRecording
=================
*/
void SCR_DrawDemoRecording( void ) {
char string[1024];
int pos;
if ( !clc.demorecording ) {
return;
}
if ( clc.spDemoRecording ) {
return;
}
pos = FS_FTell( clc.demofile );
#ifdef OPEN_ARENA
// This is what is used in most ioUrT clients to avoid huge names
sprintf( string, "REC: %.10s...: %iKB", clc.demoName, pos / 1024 );
SCR_DrawStringExt( 320 - strlen( string ) * 4, 1, 8, string, g_color_table[ColorIndex(COLOR_RED)], qtrue, qfalse );
#else
sprintf( string, "RECORDING %s: %ik", clc.demoName, pos / 1024 );
SCR_DrawStringExt( 320 - strlen( string ) * 4, 20, 8, string, g_color_table[7], qtrue, qfalse );
#endif
}
示例9: SCR_DrawDemoRecording
void SCR_DrawDemoRecording( void ) {
char string[1024];
int pos;
if ( !clc.demorecording ) {
return;
}
if ( clc.spDemoRecording ) {
return;
}
pos = FS_FTell( clc.demofile );
sprintf( string, "RECORDING %s: %ik", clc.demoName, pos / 1024 );
SCR_DrawStringExt( ((int)SCREEN_WIDTH/2) - (int)strlen( string ) * 4, 20, 8, string, &g_color_table[ColorIndex(COLOR_WHITE)], qtrue, qfalse );
}
示例10: SCR_DrawDemoRecording
/*
=================
SCR_DrawDemoRecording
=================
*/
void SCR_DrawDemoRecording( void ) {
char string[1024];
int pos;
if ( !clc.demorecording ) {
return;
}
if ( clc.spDemoRecording ) {
return;
}
pos = FS_FTell( clc.demofile );
sprintf( string, "RECORDING %s: %ik", clc.demoName, pos / 1024 );
SCR_DrawStringExt( 320 - strlen( string ) * 4, 20, 8, string, ColorForIndex(ColorIndex(COLOR_WHITE)), qtrue, qfalse );
}
示例11: SCR_DrawDemoRecording
/*
=================
SCR_DrawDemoRecording
=================
*/
void SCR_DrawDemoRecording( void ) {
char string[1024];
int pos;
if ( !clc.demorecording ) {
return;
}
if ( clc.spDemoRecording ) {
return;
}
pos = FS_FTell( clc.demofile );
sprintf( string, "RECORDING %s: %ik", clc.demoName, pos / 1024 );
SCR_DrawStringExt( 320 - strlen( string ) * 4, 20, 8, string, g_color_table[7], qtrue );
}
示例12: SCR_DrawVoipSender
/*
=================
SCR_DrawVoipSender
=================
*/
void SCR_DrawVoipSender( void ) {
char string[256];
char teamColor;
// Little bit of a hack here, but its the only thing i could come up with :|
if( cls.voipTime < cls.realtime )
return;
if (!cl_voipShowSender->integer)
return; // They don't want this on :(
else if (cls.state != CA_ACTIVE)
return; // not connected to a server.
else if (!cl_connectedToVoipServer)
return; // server doesn't support VoIP.
else if (clc.demoplaying)
return; // playing back a demo.
else if (!cl_voip->integer)
return; // client has VoIP support disabled.
switch (atoi(Info_ValueForKey(cl.gameState.stringData +
cl.gameState.stringOffsets[CS_PLAYERS + cls.voipSender], "t")))
{
case TEAM_ALIENS: teamColor = '1'; break;
case TEAM_HUMANS: teamColor = '4'; break;
default: teamColor = '3';
}
sprintf(string, "VoIP: ^%c%s", teamColor, Info_ValueForKey(cl.gameState.stringData +
cl.gameState.stringOffsets[CS_PLAYERS + cls.voipSender], "n"));
switch (cl_voipSenderPos->integer)
{
case 0:
SCR_DrawStringExt(320 - strlen( string ) * -8, 365, 8, string, g_color_table[7], qfalse, qfalse);
break;
case 1:
SCR_DrawStringExt(320 - strlen( string ) * 17, 365, 8, string, g_color_table[7], qfalse, qfalse);
break;
case 2:
SCR_DrawStringExt(320 - strlen( string ) * -9, 100, 8, string, g_color_table[7], qfalse, qfalse);
break;
case 3:
SCR_DrawStringExt(320 - strlen( string ) * 4, 30, 8, string, g_color_table[7], qfalse, qfalse);
break;
case 4:
SCR_DrawStringExt(320 - strlen( string ) * 4, 400, 8, string, g_color_table[7], qfalse, qfalse);
break;
case 5:
default:
SCR_DrawStringExt(320 - strlen( string ) * -8, 380, 8, string, g_color_table[7], qfalse, qfalse);
break;
}
}
示例13: SCR_DrawDemoRecording
/*
=================
SCR_DrawDemoRecording
=================
*/
void SCR_DrawDemoRecording( void ) {
const float ratio = cls.ratioFix;
char string[1024];
int pos;
if ( !clc.demorecording ) {
return;
}
if ( clc.spDemoRecording ) {
return;
}
if (cl_drawRecording->integer >= 2 && cls.recordingShader) {
static const float width = 60.0f, height = 15.0f;
re.SetColor(NULL);
re.DrawStretchPic(0*ratio, SCREEN_HEIGHT-height, width*ratio, height, 0, 0, 1, 1, cls.recordingShader);
} else if (cl_drawRecording->integer) {
pos = FS_FTell( clc.demofile );
sprintf( string, "RECORDING %s: %ik", clc.demoName, pos / 1024 );
SCR_DrawStringExt( 320 - (int)strlen( string ) * 4, 20, 8, string, g_color_table[7], qtrue );
}
}
示例14: SCR_DrawVoipSender
/*
=================
SCR_DrawVoipSender
=================
*/
void SCR_DrawVoipSender( void ) {
char string[256];
// Little bit of a hack here, but its the only thing i could come up with :|
if( cls.voipTime < cls.realtime )
return;
if (!cl_voipShowSender->integer)
return; // They don't want this on :(
else if (cls.state != CA_ACTIVE)
return; // not connected to a server.
else if (clc.demoplaying)
return; // playing back a demo.
else if (!cl_voip->integer)
return; // client has VoIP support disabled.
sprintf(string, "Client speaking: %s", Info_ValueForKey(cl.gameState.stringData +
cl.gameState.stringOffsets[CS_PLAYERS + cls.voipSender], "n"));
// I hardcoded the display to be on the left side of the screen, and not to move
SCR_DrawStringExt( 6, 310, 12, string, g_color_table[7], false, false );
}
示例15: SCR_DrawDemoRecording
/////////////////////////////////////////////////////////////////////
// Name : SCR_DrawDemoRecording
// Description : Draw the demo recording string
/////////////////////////////////////////////////////////////////////
void SCR_DrawDemoRecording(void) {
int pos;
char string[1024];
if (!clc.demorecording) {
return;
}
if (clc.spDemoRecording) {
return;
}
pos = FS_FTell(clc.demofile);
Com_sprintf(string, sizeof(string), "%s[%sRECORDING%s][%s%iKB%s]", S_COLOR_WHITE,
(((int)(cls.realtime >> 10) & 1) || (!cl_demoBlink->integer)) ? S_COLOR_RED : S_COLOR_WHITE,
S_COLOR_WHITE, S_COLOR_YELLOW, pos / 1024, S_COLOR_WHITE);
// draw the demo notification on screen
SCR_DrawStringExt(320 - (SCR_GetSmallStringWidth(string) / 2), 4, SMALLCHAR_WIDTH,
string, g_color_table[7], qfalse);
}