Rev 4266 | Rev 4488 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 4266 | Rev 4268 | ||
|---|---|---|---|
| Line 115... | Line 115... | ||
| 115 | /** Copy from hiscore table score with index src to dest |
115 | /** Copy from hiscore table score with index src to dest |
| 116 | * |
116 | * |
| 117 | */ |
117 | */ |
| 118 | static void copyhiscore(int dest, int src) |
118 | static void copyhiscore(int dest, int src) |
| 119 | { |
119 | { |
| 120 | strcpy(scores[dest].hs_name, scores[src].hs_name); |
120 | str_cpy(scores[dest].hs_name, STR_BOUNDS(MAXLOGNAME) + 1, |
| - | 121 | scores[src].hs_name); |
|
| 121 | scores[dest].hs_score = scores[src].hs_score; |
122 | scores[dest].hs_score = scores[src].hs_score; |
| 122 | scores[dest].hs_level = scores[src].hs_level; |
123 | scores[dest].hs_level = scores[src].hs_level; |
| 123 | } |
124 | } |
| 124 | 125 | ||
| 125 | void insertscore(int score, int level) |
126 | void insertscore(int score, int level) |
| Line 129... | Line 130... | ||
| 129 | kbd_event_t ev; |
130 | kbd_event_t ev; |
| 130 | 131 | ||
| 131 | clear_screen(); |
132 | clear_screen(); |
| 132 | moveto(10 , 10); |
133 | moveto(10 , 10); |
| 133 | puts("Insert your name: "); |
134 | puts("Insert your name: "); |
| 134 | str_ncpy(scores[NUMSPOTS - 1].hs_name, "Player", MAXLOGNAME); |
135 | str_cpy(scores[NUMSPOTS - 1].hs_name, STR_BOUNDS(MAXLOGNAME) + 1, |
| - | 136 | "Player"); |
|
| 135 | i = 6; off = 6; |
137 | i = 6; off = 6; |
| 136 | 138 | ||
| 137 | moveto(10 , 28); |
139 | moveto(10 , 28); |
| 138 | printf("%s%.*s",scores[NUMSPOTS - 1].hs_name,MAXLOGNAME-i,"........................................"); |
140 | printf("%s%.*s",scores[NUMSPOTS - 1].hs_name,MAXLOGNAME-i,"........................................"); |
| 139 | 141 | ||
| Line 193... | Line 195... | ||
| 193 | 195 | ||
| 194 | void initscores(void) |
196 | void initscores(void) |
| 195 | { |
197 | { |
| 196 | int i; |
198 | int i; |
| 197 | for(i = 0; i < NUMSPOTS; i++) { |
199 | for(i = 0; i < NUMSPOTS; i++) { |
| 198 | str_ncpy(scores[i].hs_name, "HelenOS Team", MAXLOGNAME); |
200 | str_cpy(scores[i].hs_name, STR_BOUNDS(MAXLOGNAME) + 1, "HelenOS Team"); |
| 199 | scores[i].hs_score = (NUMSPOTS - i) * 200; |
201 | scores[i].hs_score = (NUMSPOTS - i) * 200; |
| 200 | scores[i].hs_level = (i + 1 > MAXLEVEL?MAXLEVEL:i + 1); |
202 | scores[i].hs_level = (i + 1 > MAXLEVEL?MAXLEVEL:i + 1); |
| 201 | } |
203 | } |
| 202 | } |
204 | } |
| 203 | 205 | ||