Exemple #1
0
void DrawHighScores()
{
    int i;
    int w;
    int h;
    HighScore* s;

    ClearMScreen();
    CA_CacheScreen(BACKGROUND_SCREENPIC);
    DrawMenuTitle("HIGH SCORES");

    if (playstate != ex_title) {
        DrawInstructions(IT_HIGHSCORES);
    }

    fontnumber = 2;
    SETFONTCOLOR(ENABLED_TEXT_COLOR, TERM_BACK_COLOR);

    ShadowPrint("NAME", 86, 60);
    ShadowPrint("SCORE", 175, 60);
    ShadowPrint("MISSION", 247, 53);
    ShadowPrint("RATIO", 254, 60);

    for (i = 0, s = Scores.data(); i < MaxScores; i++, s++) {
        SETFONTCOLOR(HIGHLIGHT_TEXT_COLOR - 1, TERM_BACK_COLOR);
        //
        // name
        //
        if (*s->name) {
            ShadowPrint(s->name, 45, static_cast<int16_t>(68 + (SCORE_Y_SPACING * i)));
        }

        //
        // score
        //

        std::string buffer;

        if (s->score > 9999999) {
            SETFONTCOLOR(HIGHLIGHT_TEXT_COLOR + 1, TERM_BACK_COLOR);
        }

        buffer = std::to_string(s->score);
        ::USL_MeasureString(buffer.c_str(), &w, &h);
        ::ShadowPrint(buffer.c_str(), static_cast<int16_t>(205 - w), static_cast<int16_t>(68 + (SCORE_Y_SPACING * i))); // 235

        //
        // mission ratio
        //
        buffer = std::to_string(s->ratio);
        USL_MeasureString(buffer.c_str(), &w, &h);
        ShadowPrint(buffer.c_str(), static_cast<int16_t>(272 - w), static_cast<int16_t>(68 + (SCORE_Y_SPACING * i)));
    }

    VW_UpdateScreen();
}
Exemple #2
0
void	DrawHighScores(void)
{
	char		buffer[16],*str;
	word		i,
				w,h;
	HighScore	*s;

	ClearMScreen();
	CA_CacheScreen (BACKGROUND_SCREENPIC);
	DrawMenuTitle("HIGH SCORES");

	if (playstate != ex_title)
		DrawInstructions(IT_HIGHSCORES);

	fontnumber=2;
	SETFONTCOLOR(ENABLED_TEXT_COLOR,TERM_BACK_COLOR);

	ShadowPrint("NAME",86,60);
//	ShadowPrint("MISSION",150,60);
	ShadowPrint("SCORE",175,60);
	ShadowPrint("MISSION",247,53);
	ShadowPrint("RATIO",254,60);

	for (i = 0,s = Scores;i < MaxScores;i++,s++)
	{
		SETFONTCOLOR(HIGHLIGHT_TEXT_COLOR-1,TERM_BACK_COLOR);
		//
		// name
		//
		if (*s->name)
			ShadowPrint(s->name,45,68 + (SCORE_Y_SPACING * i));

#if 0
		//
		// mission
		//

		ltoa(s->episode+1,buffer,10);
		ShadowPrint(buffer,165,68 + (SCORE_Y_SPACING * i));
#endif

		//
		// score
		//

		if (s->score > 9999999)
			SETFONTCOLOR(HIGHLIGHT_TEXT_COLOR+1,TERM_BACK_COLOR);

		ltoa(s->score,buffer,10);
		USL_MeasureString(buffer,&w,&h);
		ShadowPrint(buffer,205 - w,68 + (SCORE_Y_SPACING * i));		// 235

		//
		// mission ratio
		//
		ltoa(s->ratio,buffer,10);
		USL_MeasureString(buffer,&w,&h);
		ShadowPrint(buffer,272-w,68 + (SCORE_Y_SPACING * i));
	}

	VW_UpdateScreen ();
}