@@ -8,49 +8,44 @@ void draw_main_screen() {
88 int rows , cols ;
99 getmaxyx (stdscr , rows , cols );
1010
11- // 더 큰 메인 윈도우 크기
11+ // 화면 중앙 계산
1212 int main_height = 25 ;
1313 int main_width = 80 ;
1414 int start_y = (rows - main_height ) / 2 ;
1515 int start_x = (cols - main_width ) / 2 ;
1616
17- WINDOW * main_win = newwin (main_height , main_width , start_y , start_x );
18- werase (main_win ); // 윈도우만 지우기
19-
17+ // stdscr에 직접 그리기
2018 // ASCII 아트 제목
21- wattron ( main_win , A_BOLD );
22- mvwprintw ( main_win , 2 , (main_width - 51 ) / 2 , " ██████╗██╗ ██╗███████╗███████╗███████╗ ██████╗" );
23- mvwprintw ( main_win , 3 , (main_width - 51 ) / 2 , "██╔════╝██║ ██║██╔════╝██╔════╝██╔════╝ ██╔═══╝" );
24- mvwprintw ( main_win , 4 , (main_width - 51 ) / 2 , "██║ ███████║█████╗ ███████╗███████╗ ██║ " );
25- mvwprintw ( main_win , 5 , (main_width - 51 ) / 2 , "██║ ██╔══██║██╔══╝ ╚════██║╚════██║ ██║ " );
26- mvwprintw ( main_win , 6 , (main_width - 51 ) / 2 , "╚██████╗██║ ██║███████╗███████║███████║██╗╚██████╗" );
27- mvwprintw ( main_win , 7 , (main_width - 51 ) / 2 , " ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚═════╝" );
28- wattroff ( main_win , A_BOLD );
19+ attron ( A_BOLD );
20+ mvprintw ( start_y + 2 , start_x + (main_width - 51 ) / 2 , " ██████╗██╗ ██╗███████╗███████╗███████╗ ██████╗" );
21+ mvprintw ( start_y + 3 , start_x + (main_width - 51 ) / 2 , "██╔════╝██║ ██║██╔════╝██╔════╝██╔════╝ ██╔═══╝" );
22+ mvprintw ( start_y + 4 , start_x + (main_width - 51 ) / 2 , "██║ ███████║█████╗ ███████╗███████╗ ██║ " );
23+ mvprintw ( start_y + 5 , start_x + (main_width - 51 ) / 2 , "██║ ██╔══██║██╔══╝ ╚════██║╚════██║ ██║ " );
24+ mvprintw ( start_y + 6 , start_x + (main_width - 51 ) / 2 , "╚██████╗██║ ██║███████╗███████║███████║██╗╚██████╗" );
25+ mvprintw ( start_y + 7 , start_x + (main_width - 51 ) / 2 , " ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝╚═╝ ╚═════╝" );
26+ attroff ( A_BOLD );
2927
3028 // 부제목
31- wattron ( main_win , A_ITALIC );
32- mvwprintw ( main_win , 9 , (main_width - 16 ) / 2 , "MULTIPLAYER GAME" );
33- wattroff ( main_win , A_ITALIC );
29+ attron ( A_ITALIC );
30+ mvprintw ( start_y + 9 , start_x + (main_width - 16 ) / 2 , "MULTIPLAYER GAME" );
31+ attroff ( A_ITALIC );
3432
3533 // 장식선
36- wattron ( main_win , COLOR_PAIR (COLOR_PAIR_BORDER ));
37- mvwprintw ( main_win , 11 , (main_width - 60 ) / 2 , "═══════════════════════════════════════════════════════════" );
38- wattroff ( main_win , COLOR_PAIR (COLOR_PAIR_BORDER ));
34+ attron ( COLOR_PAIR (COLOR_PAIR_BORDER ));
35+ mvprintw ( start_y + 11 , start_x + (main_width - 60 ) / 2 , "═══════════════════════════════════════════════════════════" );
36+ attroff ( COLOR_PAIR (COLOR_PAIR_BORDER ));
3937
4038 // 메뉴 항목들
41- wattron ( main_win , A_BOLD );
42- mvwprintw ( main_win , 14 , (main_width - 18 ) / 2 , "1. Start New Game" );
43- mvwprintw ( main_win , 16 , (main_width - 18 ) / 2 , "2. Replay " );
44- mvwprintw ( main_win , 18 , (main_width - 18 ) / 2 , "3. Exit " );
45- wattroff ( main_win , A_BOLD );
39+ attron ( A_BOLD );
40+ mvprintw ( start_y + 14 , start_x + (main_width - 18 ) / 2 , "1. Start New Game" );
41+ mvprintw ( start_y + 16 , start_x + (main_width - 18 ) / 2 , "2. Replay " );
42+ mvprintw ( start_y + 18 , start_x + (main_width - 18 ) / 2 , "3. Exit " );
43+ attroff ( A_BOLD );
4644
4745 // 하단 장식
48- wattron (main_win , COLOR_PAIR (COLOR_PAIR_BORDER ));
49- mvwprintw (main_win , 21 , (main_width - 60 ) / 2 , "═══════════════════════════════════════════════════════════" );
50- wattroff (main_win , COLOR_PAIR (COLOR_PAIR_BORDER ));
51-
52- wrefresh (main_win );
53- delwin (main_win ); // 윈도우 메모리 해제
46+ attron (COLOR_PAIR (COLOR_PAIR_BORDER ));
47+ mvprintw (start_y + 21 , start_x + (main_width - 60 ) / 2 , "═══════════════════════════════════════════════════════════" );
48+ attroff (COLOR_PAIR (COLOR_PAIR_BORDER ));
5449
5550 // 연결 상태 표시
5651 draw_connection_status ();
0 commit comments