liballegro/patches/030-move-dat-files.patch |
1 | 1 | Index: allegro-4.4.2/demos/shooter/demo.c |
2 | 2 | =================================================================== |
3 | | +++ allegro-4.4.2/demos/shooter/demo.c 2011-06-02 11:20:02.000000000 +0200 |
| 3 | --- allegro-4.4.2.orig/demos/shooter/demo.c 2011-06-02 12:30:54.000000000 +0200 |
4 | 4 | @@ -103,7 +103,7 @@ |
5 | 5 | get_executable_name(buf, sizeof(buf)); |
6 | 6 | replace_filename(buf2, buf, "demo.dat", sizeof(buf2)); |
... | ... | |
13 | 13 | allegro_message("Error loading %s\n", buf2); |
14 | 14 | Index: allegro-4.4.2/demos/skater/source/framewk.c |
15 | 15 | =================================================================== |
16 | | +++ allegro-4.4.2/demos/skater/source/framewk.c 2011-06-02 11:26:44.000000000 +0200 |
| 16 | --- allegro-4.4.2.orig/demos/skater/source/framewk.c 2011-06-02 12:30:54.000000000 +0200 |
17 | 17 | @@ -27,7 +27,7 @@ |
18 | 18 | } |
19 | 19 | |
... | ... | |
41 | 41 | /* Read configuration file. */ |
42 | 42 | Index: allegro-4.4.2/demos/skater/source/game_sk.c |
43 | 43 | =================================================================== |
44 | | +++ allegro-4.4.2/demos/skater/source/game_sk.c 2011-06-02 11:26:38.000000000 +0200 |
| 44 | --- allegro-4.4.2.orig/demos/skater/source/game_sk.c 2011-06-02 12:30:54.000000000 +0200 |
45 | 45 | @@ -70,10 +70,10 @@ |
46 | 46 | char *load_game_resources(void) |
47 | 47 | { |
... | ... | |
59 | 59 | |
60 | 60 | Index: allegro-4.4.2/demos/skater/source/level.c |
61 | 61 | =================================================================== |
62 | | +++ allegro-4.4.2/demos/skater/source/level.c 2011-06-02 11:26:49.000000000 +0200 |
| 62 | --- allegro-4.4.2.orig/demos/skater/source/level.c 2011-06-02 12:30:54.000000000 +0200 |
63 | 63 | @@ -74,8 +74,9 @@ |
64 | 64 | #endif |
65 | 65 | char LocName[DEMO_PATH_LENGTH], TString[DEMO_PATH_LENGTH]; |
... | ... | |
72 | 72 | replace_filename(LocName, LocName, TString, DEMO_PATH_LENGTH); |
73 | 73 | |
74 | 74 | #ifdef DEMO_USE_ALLEGRO_GL |
| 75 | Index: 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 | @@ -82,6 +82,7 @@ |
| 79 | int i; |
| 80 | |
| 81 | get_executable_name(exe, sizeof(exe)); |
| 82 | + strcpy(exe, "/usr/share/allegro/dummy"); |
| 83 | for (i = 0; locations[i] != NULL; i++) { |
| 84 | replace_filename(dir, exe, locations[i], sizeof(dir)); |
| 85 | append_filename(buf, dir, name, bufsize); |
liballegro/patches/050-shooter-gfx-mode.patch |
1 | 1 | Index: allegro-4.4.2/demos/shooter/demo.c |
2 | 2 | =================================================================== |
3 | | +++ allegro-4.4.2/demos/shooter/demo.c 2011-06-01 20:06:18.000000000 +0200 |
| 3 | --- allegro-4.4.2.orig/demos/shooter/demo.c 2011-06-02 12:32:25.000000000 +0200 |
4 | 4 | @@ -1,3 +1,5 @@ |
5 | 5 | +#define DEBUGMODE |
6 | 6 | + |
... | ... | |
18 | 18 | set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); |
19 | 19 | Index: allegro-4.4.2/demos/shooter/display.c |
20 | 20 | =================================================================== |
21 | | +++ allegro-4.4.2/demos/shooter/display.c 2011-06-01 20:06:18.000000000 +0200 |
| 21 | --- allegro-4.4.2.orig/demos/shooter/display.c 2011-06-02 12:30:09.000000000 +0200 |
22 | 22 | @@ -28,18 +28,19 @@ |
23 | 23 | break; |
24 | 24 | } |
... | ... | |
53 | 53 | set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); |
54 | 54 | Index: allegro-4.4.2/demos/shooter/game.c |
55 | 55 | =================================================================== |
56 | | +++ allegro-4.4.2/demos/shooter/game.c 2011-06-01 20:37:13.000000000 +0200 |
| 56 | --- allegro-4.4.2.orig/demos/shooter/game.c 2011-06-02 12:30:09.000000000 +0200 |
57 | 57 | @@ -58,12 +58,18 @@ |
58 | 58 | static void draw_intro_item(int item, int size) |
59 | 59 | { |
60 | 60 | BITMAP *b = (BITMAP *) data[item].dat; |
61 | | + BITMAP *b_n = create_bitmap_ex(32, b->w, b->h); |
| 61 | + BITMAP *b_n = create_bitmap_ex(bitmap_color_depth(screen), b->w, b->h); |
62 | 62 | + clear_to_color(b_n,0xffff); |
63 | 63 | + set_palette(data[GAME_PAL].dat); |
64 | 64 | + blit (b, b_n, 0, 0, 0, 0, b->w, b->h); |
... | ... | |
77 | 77 | |
78 | 78 | Index: allegro-4.4.2/demos/shooter/title.c |
79 | 79 | =================================================================== |
80 | | +++ allegro-4.4.2/demos/shooter/title.c 2011-06-01 20:06:18.000000000 +0200 |
81 | | @@ -843,10 +843,11 @@ |
| 80 | --- allegro-4.4.2.orig/demos/shooter/title.c 2011-06-02 12:32:26.000000000 +0200 |
| 81 | @@ -844,10 +844,18 @@ |
82 | 82 | scroll_count = 1; |
83 | 83 | install_int(scroll_counter, 5); |
84 | 84 | |
85 | | - while ((c = scroll_count) < 160) |
| 85 | + /* fix for stretch_blit: won't work over different color depth */ |
| 86 | + BITMAP *title = data[TITLE_BMP].dat; |
| 87 | + BITMAP *title_n = create_bitmap_ex(bitmap_color_depth(screen), |
| 88 | + title->w, title->h); |
| 89 | + blit (title, title_n, 0, 0, 0, 0, title->w, title->h); |
| 90 | while ((c = scroll_count) < 160) |
86 | 91 | - stretch_blit(data[TITLE_BMP].dat, screen, 0, 0, 320, 128, |
87 | | - SCREEN_W / 2 - c, SCREEN_H / 2 - c * 64 / 160 - 32, |
88 | | - c * 2, c * 128 / 160); |
89 | | + /* todo: stretch_blit won't work over color depth */ |
90 | | + /* while ((c = scroll_count) < 160) */ |
91 | | + /* stretch_blit(data[TITLE_BMP].dat, screen, 0, 0, 320, 128, */ |
92 | | + /* SCREEN_W / 2 - c, SCREEN_H / 2 - c * 64 / 160 - 32, */ |
93 | | + /* c * 2, c * 128 / 160); */ |
| 92 | + { |
| 93 | + stretch_blit(title_n, screen, 0, 0, 320, 128, |
| 94 | SCREEN_W / 2 - c, SCREEN_H / 2 - c * 64 / 160 - 32, |
| 95 | c * 2, c * 128 / 160); |
| 96 | + } |
| 97 | + destroy_bitmap(title_n); |
94 | 98 | |
95 | 99 | remove_int(scroll_counter); |
96 | 100 | |
97 | 101 | Index: allegro-4.4.2/demos/shooter/dirty.c |
98 | 102 | =================================================================== |
99 | | +++ allegro-4.4.2/demos/shooter/dirty.c 2011-06-01 20:12:08.000000000 +0200 |
100 | | @@ -93,7 +93,7 @@ |
| 103 | --- allegro-4.4.2.orig/demos/shooter/dirty.c 2011-06-02 12:30:09.000000000 +0200 |
| 104 | @@ -92,10 +92,13 @@ |
| 105 | |
101 | 106 | acquire_screen(); |
102 | 107 | |
| 108 | + /* setup palette_color[] */ |
| 109 | + set_color_depth(32); |
| 110 | + |
103 | 111 | for (c = 0; c < old_dirty.count; c++) { |
104 | | - if ((old_dirty.rect[c].w == 1) && (old_dirty.rect[c].h == 1)) { |
105 | | + if (0 && (old_dirty.rect[c].w == 1) && (old_dirty.rect[c].h == 1)) { |
| 112 | if ((old_dirty.rect[c].w == 1) && (old_dirty.rect[c].h == 1)) { |
106 | 113 | putpixel(screen, old_dirty.rect[c].x, old_dirty.rect[c].y, |
107 | | getpixel(bmp, old_dirty.rect[c].x, old_dirty.rect[c].y)); |
| 114 | - getpixel(bmp, old_dirty.rect[c].x, old_dirty.rect[c].y)); |
| 115 | + palette_color[getpixel(bmp, old_dirty.rect[c].x, old_dirty.rect[c].y)]); |
| 116 | } |
| 117 | else { |
| 118 | blit(bmp, screen, old_dirty.rect[c].x, old_dirty.rect[c].y, |
| 119 | @@ -103,6 +106,7 @@ |
| 120 | old_dirty.rect[c].w, old_dirty.rect[c].h); |
108 | 121 | } |
| 122 | } |
| 123 | + set_color_depth(8); |
| 124 | |
| 125 | release_screen(); |
| 126 | } |