MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / DrawSmallStringExt

Method DrawSmallStringExt

neo/renderer/RenderSystem.cpp:411–439  ·  view source on GitHub ↗

================== idRenderSystemLocal::DrawSmallString[Color] Draws a multi-colored string with a drop shadow, optionally forcing to a fixed color. Coordinates are at 640 by 480 virtual resolution ================== */

Source from the content-addressed store, hash-verified

409==================
410*/
411void idRenderSystemLocal::DrawSmallStringExt( int x, int y, const char *string, const idVec4 &setColor, bool forceColor, const idMaterial *material ) {
412 idVec4 color;
413 const unsigned char *s;
414 int xx;
415
416 // draw the colored text
417 s = (const unsigned char*)string;
418 xx = x;
419 SetColor( setColor );
420 while ( *s ) {
421 if ( idStr::IsColor( (const char*)s ) ) {
422 if ( !forceColor ) {
423 if ( *(s+1) == C_COLOR_DEFAULT ) {
424 SetColor( setColor );
425 } else {
426 color = idStr::ColorForIndex( *(s+1) );
427 color[3] = setColor[3];
428 SetColor( color );
429 }
430 }
431 s += 2;
432 continue;
433 }
434 DrawSmallChar( xx, y, *s, material );
435 xx += SMALLCHAR_WIDTH;
436 s++;
437 }
438 SetColor( colorWhite );
439}
440
441/*
442=====================

Callers 5

PrintLoadingMessageMethod · 0.80
SCR_DrawTextLeftAlignFunction · 0.80
SCR_DrawTextRightAlignFunction · 0.80
SCR_DrawFPSFunction · 0.80
DrawMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected