コード例 #1
0
ファイル: main.cpp プロジェクト: WangCrystal/pindrop
void DemoState::AdvanceFrame(float delta_time) {
  HandleInput();
  UpdateIcons(delta_time);
  audio_engine_.AdvanceFrame(delta_time);
  RemoveInvalidSounds();
  SDL_RenderClear(renderer_);
  DrawInstructions();
  DrawIcons();
  SDL_RenderPresent(renderer_);
  SDL_Delay(kDelayMilliseconds);
}
コード例 #2
0
ファイル: 3D_INTER.C プロジェクト: Pickle/bstone
void	CheckHighScore (long score,word other)
{
	word		i,j;
	int			n;
	HighScore	myscore;
	US_CursorStruct TermCursor = {'@',0,HIGHLIGHT_TEXT_COLOR,2};


   // Check for cheaters

   if (DebugOk)
	{
   	SD_PlaySound(NOWAYSND);
      return;
   }

	strcpy(myscore.name,"");
	myscore.score = score;
	myscore.episode = gamestate.episode;
	myscore.completed = other;
	myscore.ratio = ShowStats(0,0,ss_justcalc,&gamestuff.level[gamestate.mapon].stats);

	for (i = 0,n = -1;i < MaxScores;i++)
	{
		if ((myscore.score > Scores[i].score) ||	((myscore.score == Scores[i].score)
			&& (myscore.completed > Scores[i].completed)))
		{
			for (j = MaxScores;--j > i;)
				Scores[j] = Scores[j - 1];
			Scores[i] = myscore;
			n = i;
			break;
		}
	}

	StartCPMusic (ROSTER_MUS);
	DrawHighScores ();

	VW_FadeIn ();

	if (n != -1)
	{
		//
		// got a high score
		//

		DrawInstructions(IT_ENTER_HIGHSCORE);
		SETFONTCOLOR(HIGHLIGHT_TEXT_COLOR,TERM_BACK_COLOR);
		PrintY = 68+(SCORE_Y_SPACING * n);
		PrintX = 45;
		use_custom_cursor = true;
		allcaps = true;
		US_CustomCursor = TermCursor;
		US_LineInput(PrintX,PrintY,Scores[n].name,nil,true,MaxHighName,100);
	}
	else
	{
		IN_ClearKeysDown ();
		IN_UserInput(500);
	}

   StopMusic();
	use_custom_cursor = false;
}
コード例 #3
0
ファイル: 3D_INTER.C プロジェクト: Pickle/bstone
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 ();
}