void DisplayStringsInChatLogMessageList( void ) { UINT8 ubCurrentStringIndex; UINT8 ubLinesPrinted; INT16 sX, sY; UINT16 usSpacing; // Limit drawing to chat log region only, dont want any overdraw sX = gChatMessageLogRegion.iLeft + 4; SetFontDestBuffer( FRAME_BUFFER, sX , gChatMessageLogRegion.iTop + 4, gChatMessageLogRegion.iRight - 4, gChatMessageLogRegion.iBottom - 4, FALSE ); SetFont( CHAT_MESSAGE_FONT ); // no longer supports variable fonts SetFontBackground( FONT_BLACK ); SetFontShadow( DEFAULT_SHADOW ); ubCurrentStringIndex = gubCurrentChatLogMessageString; sY = gChatMessageLogRegion.iTop + 4; usSpacing = GetFontHeight( CHAT_MESSAGE_FONT ); for ( ubLinesPrinted = 0; ubLinesPrinted < MAX_CHATLOG_MESSAGES; ubLinesPrinted++ ) { // reached the end of the list? if ( ubCurrentStringIndex == gubEndOfChatLogMessageList ) { break; } // nothing stored there? if ( gChatLogMessageList[ ubCurrentStringIndex ] == NULL ) { break; } // set font color SetFontForeground( ( UINT8 )( gChatLogMessageList[ ubCurrentStringIndex ]->usColor ) ); // print this line mprintf_coded( sX, sY, gChatLogMessageList[ ubCurrentStringIndex ]->pString16 ); sY = sY + usSpacing; // next message index to print (may wrap around) ubCurrentStringIndex = ( ubCurrentStringIndex + 1 ) % 256; } // reset region to whole screen SetFontDestBuffer( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE ); }
void DisplayStringsInMapScreenMessageList( void ) { UINT8 ubCurrentStringIndex; UINT8 ubLinesPrinted; INT16 sY; UINT16 usSpacing; SetFontDestBuffer( FRAME_BUFFER, 17, 360 + 6, 407, 360 + 101, FALSE ); SetFont( MAP_SCREEN_MESSAGE_FONT ); // no longer supports variable fonts SetFontBackground( FONT_BLACK ); SetFontShadow( DEFAULT_SHADOW ); ubCurrentStringIndex = gubCurrentMapMessageString; sY = 377; usSpacing = GetFontHeight( MAP_SCREEN_MESSAGE_FONT ); for ( ubLinesPrinted = 0; ubLinesPrinted < MAX_MESSAGES_ON_MAP_BOTTOM; ubLinesPrinted++ ) { // reached the end of the list? if ( ubCurrentStringIndex == gubEndOfMapScreenMessageList ) { break; } // nothing stored there? if ( gMapScreenMessageList[ ubCurrentStringIndex ] == NULL ) { break; } // set font color SetFontForeground( ( UINT8 )( gMapScreenMessageList[ ubCurrentStringIndex ]->usColor ) ); // print this line mprintf_coded( 20, sY, gMapScreenMessageList[ ubCurrentStringIndex ]->pString16 ); sY += usSpacing; // next message index to print (may wrap around) ubCurrentStringIndex = ( ubCurrentStringIndex + 1 ) % 256; } SetFontDestBuffer( FRAME_BUFFER, 0, 0, 640, 480, FALSE ); }