Date:2011-06-02 13:05:26 (12 years 9 months ago)
Author:David Kühling
Commit:61755836b88f8d2f2f6cbe0b1660ccf7df4bd2fe
Message:liballegro: minor cleanup, fixes, tuning

Files: liballegro/Makefile (1 diff)
liballegro/patches/030-move-dat-files.patch (5 diffs)
liballegro/patches/050-shooter-gfx-mode.patch (4 diffs)

Change Details

liballegro/Makefile
232232
233233define Package/liballegro-data/install
234234    $(INSTALL_DIR) $(1)/usr/share/allegro
235    $(INSTALL_DIR) $(1)/usr/share/allegro/docs/txt
236235    $(CP) $(PKG_BUILD_DIR)/{keyboard.dat,language.dat} $(1)/usr/share/allegro
237236        # readme file is used by the allegro 'shooter' demo
238    $(CP) $(PKG_BUILD_DIR)/docs/txt/readme.txt $(1)/usr/share/allegro/docs/txt
237    $(INSTALL_DIR) $(1)/usr/share/allegro/docs/{txt,src}
238    $(CP) $(PKG_BUILD_DIR)/docs/txt/readme.txt \
239        $(1)/usr/share/allegro/docs/txt
240    $(CP) $(PKG_BUILD_DIR)/docs/src/thanks._tx \
241        $(1)/usr/share/allegro/docs/src
239242endef
240243
241244define Package/liballegro-demo/install
liballegro/patches/030-move-dat-files.patch
11Index: allegro-4.4.2/demos/shooter/demo.c
22===================================================================
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
44@@ -103,7 +103,7 @@
55    get_executable_name(buf, sizeof(buf));
66    replace_filename(buf2, buf, "demo.dat", sizeof(buf2));
...... 
1313       allegro_message("Error loading %s\n", buf2);
1414Index: allegro-4.4.2/demos/skater/source/framewk.c
1515===================================================================
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
1717@@ -27,7 +27,7 @@
1818 }
1919
...... 
4141    /* Read configuration file. */
4242Index: allegro-4.4.2/demos/skater/source/game_sk.c
4343===================================================================
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
4545@@ -70,10 +70,10 @@
4646 char *load_game_resources(void)
4747 {
...... 
5959
6060Index: allegro-4.4.2/demos/skater/source/level.c
6161===================================================================
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
6363@@ -74,8 +74,9 @@
6464 #endif
6565    char LocName[DEMO_PATH_LENGTH], TString[DEMO_PATH_LENGTH];
...... 
7272    replace_filename(LocName, LocName, TString, DEMO_PATH_LENGTH);
7373
7474 #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@@ -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
11Index: allegro-4.4.2/demos/shooter/demo.c
22===================================================================
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
44@@ -1,3 +1,5 @@
55+#define DEBUGMODE
66+
...... 
1818          set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
1919Index: allegro-4.4.2/demos/shooter/display.c
2020===================================================================
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
2222@@ -28,18 +28,19 @@
2323          break;
2424    }
...... 
5353             set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
5454Index: allegro-4.4.2/demos/shooter/game.c
5555===================================================================
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
5757@@ -58,12 +58,18 @@
5858 static void draw_intro_item(int item, int size)
5959 {
6060    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);
6262+ clear_to_color(b_n,0xffff);
6363+ set_palette(data[GAME_PAL].dat);
6464+ blit (b, b_n, 0, 0, 0, 0, b->w, b->h);
...... 
7777
7878Index: allegro-4.4.2/demos/shooter/title.c
7979===================================================================
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 @@
8282    scroll_count = 1;
8383    install_int(scroll_counter, 5);
8484
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)
8691- 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);
9498
9599    remove_int(scroll_counter);
96100
97101Index: allegro-4.4.2/demos/shooter/dirty.c
98102===================================================================
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
101106    acquire_screen();
102107
108+ /* setup palette_color[] */
109+ set_color_depth(32);
110+
103111    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)) {
106113          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);
108121       }
122    }
123+ set_color_depth(8);
124
125    release_screen();
126 }

Archive Download the corresponding diff file



interactive