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

Method DrawNotify

neo/framework/Console.cpp:1050–1094  ·  view source on GitHub ↗

================ DrawNotify Draws the last few lines of output transparently over the game top ================ */

Source from the content-addressed store, hash-verified

1048================
1049*/
1050void idConsoleLocal::DrawNotify() {
1051 int x, v;
1052 short *text_p;
1053 int i;
1054 int time;
1055 int currentColor;
1056
1057 if ( con_noPrint.GetBool() ) {
1058 return;
1059 }
1060
1061 currentColor = idStr::ColorIndex( C_COLOR_WHITE );
1062 renderSystem->SetColor( idStr::ColorForIndex( currentColor ) );
1063
1064 v = 0;
1065 for ( i = current-NUM_CON_TIMES+1; i <= current; i++ ) {
1066 if ( i < 0 ) {
1067 continue;
1068 }
1069 time = times[i % NUM_CON_TIMES];
1070 if ( time == 0 ) {
1071 continue;
1072 }
1073 time = com_frameTime - time;
1074 if ( time > con_notifyTime.GetFloat() * 1000 ) {
1075 continue;
1076 }
1077 text_p = text + (i % TOTAL_LINES)*LINE_WIDTH;
1078
1079 for ( x = 0; x < LINE_WIDTH; x++ ) {
1080 if ( ( text_p[x] & 0xff ) == ' ' ) {
1081 continue;
1082 }
1083 if ( idStr::ColorIndex(text_p[x]>>8) != currentColor ) {
1084 currentColor = idStr::ColorIndex(text_p[x]>>8);
1085 renderSystem->SetColor( idStr::ColorForIndex( currentColor ) );
1086 }
1087 renderSystem->DrawSmallChar( (x+1)*SMALLCHAR_WIDTH, v, text_p[x] & 0xff, localConsole.charSetShader );
1088 }
1089
1090 v += SMALLCHAR_HEIGHT;
1091 }
1092
1093 renderSystem->SetColor( colorCyan );
1094}
1095
1096/*
1097================

Callers

nothing calls this directly

Calls 4

DrawSmallCharMethod · 0.80
GetBoolMethod · 0.45
SetColorMethod · 0.45
GetFloatMethod · 0.45

Tested by

no test coverage detected