Exemple #1
0
static void
towel_window_update_working_time(towel_window_t *win, int period)
{
  xcb_screensaver_query_info_cookie_t cookie;
  xcb_screensaver_query_info_reply_t *reply;
  cookie = xcb_screensaver_query_info_unchecked(win->conn, win->screen->root);
  reply = xcb_screensaver_query_info_reply(win->conn, cookie, NULL);
#if DEBUG
  fprintf(stderr, "idle: %d sec\n", ms2sec(reply->ms_since_user_input));
#endif
  win->idle_time = ms2sec(reply->ms_since_user_input);
  if (win->idle_time < period)
    win->working_time += period;
}
Exemple #2
0
void SIO_DrawBoard ()
{
	clock_t time_tmp = clock();

	// 건물 출력 여부
	SIO_TurnColor(BG);
	gotoxy(50, 25);	SIO_PrtBuilding(0);	// 0 - 5
	gotoxy(42, 25);	SIO_PrtBuilding(1);
	gotoxy(34, 25);	SIO_PrtBuilding(2);
	gotoxy(26, 25);	SIO_PrtBuilding(3);
	gotoxy(18, 25);	SIO_PrtBuilding(4);
	gotoxy(10, 25);	SIO_PrtBuilding(5);
	gotoxy(2, 25);	SIO_PrtBuilding(6);	// 6 - 11
	gotoxy(2, 21);	SIO_PrtBuilding(7);
	gotoxy(2, 17);	SIO_PrtBuilding(8);
	gotoxy(2, 13);	SIO_PrtBuilding(9);
	gotoxy(2, 9);	SIO_PrtBuilding(10);
	gotoxy(2, 5);	SIO_PrtBuilding(11);
	gotoxy(2, 1);	SIO_PrtBuilding(12);	// 12 - 17
	gotoxy(10, 1);	SIO_PrtBuilding(13);
	gotoxy(18, 1);	SIO_PrtBuilding(14);
	gotoxy(26, 1);	SIO_PrtBuilding(15);
	gotoxy(34, 1);	SIO_PrtBuilding(16);
	gotoxy(42, 1);	SIO_PrtBuilding(17);
	gotoxy(50, 1);	SIO_PrtBuilding(18);	// 18 - 23
	gotoxy(50, 5);	SIO_PrtBuilding(19);
	gotoxy(50, 9);	SIO_PrtBuilding(20);
	gotoxy(50, 13);	SIO_PrtBuilding(21);
	gotoxy(50, 17);	SIO_PrtBuilding(22);
	gotoxy(50, 21);	SIO_PrtBuilding(23);

	// 도시 이름 출력
	gotoxy(50, 26);	SIO_PrtCityName(0);	// 0 - 5
	gotoxy(42, 26);	SIO_PrtCityName(1);
	gotoxy(34, 26);	SIO_PrtCityName(2);
	gotoxy(26, 26);	SIO_PrtCityName(3);
	gotoxy(18, 26);	SIO_PrtCityName(4);
	gotoxy(10, 26);	SIO_PrtCityName(5);
	gotoxy(2, 26);	SIO_PrtCityName(6);	// 6 - 11
	gotoxy(2, 22);	SIO_PrtCityName(7);
	gotoxy(2, 18);	SIO_PrtCityName(8);
	gotoxy(2, 14);	SIO_PrtCityName(9);
	gotoxy(2, 10);	SIO_PrtCityName(10);
	gotoxy(2, 6);	SIO_PrtCityName(11);
	gotoxy(2, 2);	SIO_PrtCityName(12);	// 12 - 17
	gotoxy(10, 2);	SIO_PrtCityName(13);
	gotoxy(18, 2);	SIO_PrtCityName(14);
	gotoxy(26, 2);	SIO_PrtCityName(15);
	gotoxy(34, 2);	SIO_PrtCityName(16);
	gotoxy(42, 2);	SIO_PrtCityName(17);
	gotoxy(50, 2);	SIO_PrtCityName(18);	// 18 - 23
	gotoxy(50, 6);	SIO_PrtCityName(19);
	gotoxy(50, 10);	SIO_PrtCityName(20);
	gotoxy(50, 14);	SIO_PrtCityName(21);
	gotoxy(50, 18);	SIO_PrtCityName(22);
	gotoxy(50, 22);	SIO_PrtCityName(23);

	SIO_TurnColor(CL_BT);

	gotoxy(60, 26);	printf("%d분 %d초 경과", (int) ms2min(time_tmp - timepass), (int) ms2sec(time_tmp - timepass)); // 시간 흐름 표시
	gotoxy(60, 25); printf(" ESC : 종료");

	SIO_TurnColor(BG);
	gotoxy(12, 22);
	if (difficulty == GAME_EASY)
		printf("        KUMarble : 고연전          ");
	else if (difficulty == GAME_HARD)
		printf("     KUMarble : 통장의 고연전      ");
}