-
Notifications
You must be signed in to change notification settings - Fork 0
/
dos.c
70 lines (55 loc) · 1.33 KB
/
dos.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*****************************************************/
/* Ultimate Blocks */
/* Copyright (c) An Ly 2000, Owen Rudge 2001, 2008 */
/*****************************************************/
#if defined(DJGPP)
#include <allegro.h>
#include "blocks3.h"
/*! \brief Return the name of 'significant' directories.
*
* \param dir Enumerated constant for directory type \sa DATA_DIR et al.
* \param file File name below that directory.
* \returns the combined path
*/
const char *find_resource_file (int dir, const char *file)
{
static char ans[MAX_PATH];
switch (dir)
{
case APP_DIR:
if (file == NULL)
strcpy(ans, ".");
else
strcpy(ans, file);
break;
case GRAPHICS_DIR:
if (file == NULL)
strcpy(ans, "graphics");
else
sprintf(ans, "graphics/%s", file);
break;
case MUSIC_DIR:
if (file == NULL)
strcpy(ans, "music");
else
sprintf(ans, "music/%s", file);
break;
case MAP_DIR:
if (file == NULL)
strcpy(ans, "maps");
else
sprintf(ans, "maps/%s", file);
break;
case SAVE_DIR:
case SETTINGS_DIR:
if (file == NULL)
strcpy(ans, ".");
else
strcpy(ans, file);
break;
default:
return NULL;
}
return fix_filename_slashes (ans);
}
#endif