Root/liballegro/patches/030-move-dat-files.patch

1Index: allegro-4.4.2/demos/shooter/demo.c
2===================================================================
3--- allegro-4.4.2.orig/demos/shooter/demo.c 2011-06-02 12:30:54.000000000 +0200
4+++ allegro-4.4.2/demos/shooter/demo.c 2011-06-02 12:32:06.000000000 +0200
5@@ -103,7 +103,7 @@
6    get_executable_name(buf, sizeof(buf));
7    replace_filename(buf2, buf, "demo.dat", sizeof(buf2));
8    set_color_conversion(COLORCONV_NONE);
9- data = load_datafile(buf2);
10+ data = load_datafile("/usr/share/allegro/shooter.dat" /*buf2*/);
11    if (!data) {
12       set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
13       allegro_message("Error loading %s\n", buf2);
14Index: allegro-4.4.2/demos/skater/source/framewk.c
15===================================================================
16--- allegro-4.4.2.orig/demos/skater/source/framewk.c 2011-06-02 12:30:54.000000000 +0200
17+++ allegro-4.4.2/demos/skater/source/framewk.c 2011-06-02 12:32:06.000000000 +0200
18@@ -27,7 +27,7 @@
19 }
20 
21 /* name of the configuration file for storing demo-specific settings. */
22-#define DEMO_CFG "demo.cfg"
23+#define DEMO_CFG "skater.cfg"
24 
25 /*
26    Timer callback. Installed with the frequency defined in the framework
27@@ -84,11 +84,13 @@
28 
29    /* Construct aboslute path for the configuration file. */
30    get_executable_name(config_path, DEMO_PATH_LENGTH);
31+ strcpy(config_path, "/etc/allegro/dummy");
32    replace_filename(config_path, config_path, DEMO_CFG, DEMO_PATH_LENGTH);
33 
34    /* Construct aboslute path for the datafile containing game menu data. */
35    get_executable_name(data_path, DEMO_PATH_LENGTH);
36- replace_filename(data_path, data_path, "demo.dat#menu.dat",
37+ strcpy(data_path, "/usr/share/allegro/dummy");
38+ replace_filename(data_path, data_path, "skater.dat#menu.dat",
39                     DEMO_PATH_LENGTH);
40 
41    /* Read configuration file. */
42Index: allegro-4.4.2/demos/skater/source/game_sk.c
43===================================================================
44--- allegro-4.4.2.orig/demos/skater/source/game_sk.c 2011-06-02 12:30:54.000000000 +0200
45+++ allegro-4.4.2/demos/skater/source/game_sk.c 2011-06-02 12:32:06.000000000 +0200
46@@ -70,10 +70,10 @@
47 char *load_game_resources(void)
48 {
49    int c;
50- char AudioPath[DEMO_PATH_LENGTH];
51+ char AudioPath[DEMO_PATH_LENGTH] = "/usr/share/allegro/dummy";
52 
53- get_executable_name(AudioPath, DEMO_PATH_LENGTH);
54- replace_filename(AudioPath, AudioPath, "demo.dat#audio.dat",
55+ /* get_executable_name(AudioPath, DEMO_PATH_LENGTH); */
56+ replace_filename(AudioPath, AudioPath, "skater.dat#audio.dat",
57                     DEMO_PATH_LENGTH);
58    game_audio = load_datafile(AudioPath);
59 
60Index: allegro-4.4.2/demos/skater/source/level.c
61===================================================================
62--- allegro-4.4.2.orig/demos/skater/source/level.c 2011-06-02 12:30:54.000000000 +0200
63+++ allegro-4.4.2/demos/skater/source/level.c 2011-06-02 12:32:06.000000000 +0200
64@@ -74,8 +74,9 @@
65 #endif
66    char LocName[DEMO_PATH_LENGTH], TString[DEMO_PATH_LENGTH];
67 
68- uszprintf(TString, sizeof(TString), "demo.dat#%s", name);
69+ uszprintf(TString, sizeof(TString), "skater.dat#%s", name);
70    get_executable_name(LocName, DEMO_PATH_LENGTH);
71+ strcpy(LocName, "/usr/share/allegro/dummy");
72    replace_filename(LocName, LocName, TString, DEMO_PATH_LENGTH);
73 
74 #ifdef DEMO_USE_ALLEGRO_GL
75Index: allegro-4.4.2/demos/shooter/title.c
76===================================================================
77--- allegro-4.4.2.orig/demos/shooter/title.c 2011-06-02 12:32:12.000000000 +0200
78+++ allegro-4.4.2/demos/shooter/title.c 2011-06-02 12:32:13.000000000 +0200
79@@ -82,6 +82,7 @@
80    int i;
81 
82    get_executable_name(exe, sizeof(exe));
83+ strcpy(exe, "/usr/share/allegro/dummy");
84    for (i = 0; locations[i] != NULL; i++) {
85       replace_filename(dir, exe, locations[i], sizeof(dir));
86       append_filename(buf, dir, name, bufsize);
87

Archive Download this file



interactive