32 static void TH_DrawString(
char *dst,
int x,
int y,
char *src,
size_t len)
45 case 13:
c =
'>';
break;
46 case 16:
c =
'[';
break;
47 case 17:
c =
']';
break;
48 case 29:
c =
'<';
break;
49 case 30:
c =
'=';
break;
50 case 31:
c =
'>';
break;
94 char buffer[MAX_QPATH];
111 if (token[0] ==
'x') {
112 if (token[1] ==
'l') {
118 if (token[1] ==
'r') {
124 if (token[1] ==
'v') {
126 x =
TH_WIDTH / 2 - 20 + atoi(token) / 8;
131 if (token[0] ==
'y') {
132 if (token[1] ==
't') {
138 if (token[1] ==
'b') {
144 if (token[1] ==
'v') {
146 y =
TH_HEIGHT / 2 - 15 + atoi(token) / 8;
152 if (!strcmp(token,
"pic")) {
158 if (!strcmp(token,
"client")) {
160 int score, ping, time;
163 x =
TH_WIDTH / 2 - 20 + atoi(token) / 8;
165 y =
TH_HEIGHT / 2 - 15 + atoi(token) / 8;
169 if (value < 0 || value >= MAX_CLIENTS) {
170 Com_Error(ERR_DROP,
"%s: invalid client index", __func__);
183 len = strlen(ci->
name);
185 len =
Q_scnprintf(buffer,
sizeof(buffer),
"Score: %i", score);
187 len =
Q_scnprintf(buffer,
sizeof(buffer),
"Ping: %i", ping);
189 len =
Q_scnprintf(buffer,
sizeof(buffer),
"Time: %i", time);
194 if (!strcmp(token,
"ctf")) {
199 x =
TH_WIDTH / 2 - 20 + atoi(token) / 8;
201 y =
TH_HEIGHT / 2 - 15 + atoi(token) / 8;
205 if (value < 0 || value >= MAX_CLIENTS) {
206 Com_Error(ERR_DROP,
"%s: invalid client index", __func__);
218 len =
Q_scnprintf(buffer,
sizeof(buffer),
"%3d %3d %-12.12s",
219 score, ping, ci->
name);
224 if (!strcmp(token,
"picn")) {
230 if (!strcmp(token,
"num")) {
236 if (value < 0 || value >= MAX_STATS) {
237 Com_Error(ERR_DROP,
"%s: invalid stat index", __func__);
244 if (!strcmp(token,
"stat_string")) {
247 if (index < 0 || index >= MAX_STATS) {
248 Com_Error(ERR_DROP,
"%s: invalid string index", __func__);
251 if (index < 0 || index >= MAX_CONFIGSTRINGS) {
252 Com_Error(ERR_DROP,
"%s: invalid string index", __func__);
259 if (!strncmp(token,
"cstring", 7)) {
266 if (!strncmp(token,
"string", 6)) {
273 if (!strcmp(token,
"if")) {
276 if (value < 0 || value >= MAX_STATS) {
277 Com_Error(ERR_DROP,
"%s: invalid stat index", __func__);
281 while (strcmp(token,
"endif")) {
296 char path[MAX_OSPATH];
302 Com_Printf(
"Must be in a level.\n");
308 "scoreshots/",
Cmd_Argv(1),
".txt");
314 for (i = 0; i < 1000; i++) {
315 Q_snprintf(path,
sizeof(path),
"scoreshots/quake%03d.txt", i);
316 ret =
FS_FOpenFile(path, &f, FS_MODE_WRITE | FS_FLAG_TEXT | FS_FLAG_EXCL);
320 if (ret != Q_ERR_EXIST) {
321 Com_EPrintf(
"Couldn't exclusively open %s for writing: %s\n",
328 Com_EPrintf(
"All scoreshot slots are full.\n");
333 memset(buffer,
' ',
sizeof(buffer));
341 FS_Write(buffer,
sizeof(buffer), f);
345 Com_Printf(
"Wrote %s.\n", path);
354 Com_Printf(
"Must be in a level.\n");
358 memset(buffer,
' ',
sizeof(buffer));
367 Com_Printf(
"%s\n", buffer);