Date:2011-05-31 17:14:29 (12 years 9 months ago)
Author:David Kühling
Commit:2e457ea3d017a22affb83c7d73544964f51aa3e3
Message:liballegro: fix fbdev driver, also package examples

Files: liballegro/Makefile (4 diffs)
liballegro/patches/010-shooter-gfx-mode.patch (1 diff)
liballegro/patches/020-fix-fbcon-init.patch (1 diff)

Change Details

liballegro/Makefile
55#
66# OpenWRT package for the Allegro game and multimedia library
77
8# todo:
9#
10# * GFX_SAFE has a problem switching to 32bpp mode (maybe it falsely
11# attempts switching to 24bpp mode?), so it fails. doing a
12# set_color_depth(32) and GFX_AUTODETECT works.
13#
14# * both shooter and skater try to load a demo.dat from /usr/bin. hack them to
15# use usr/share subdirs?
16#
17# * similar problem with setup?
18#
819include $(TOPDIR)/rules.mk
920
1021PKG_NAME:=liballegro
...... 
8495 This package contains the Allegro setup program
8596endef
8697
98define Package/liballegro-examples
99$(call Package/liballegro/Default)
100  TITLE+= (examples)
101  DEPENDS:=+liballegro
102endef
103
104define Package/liballegro-examples/description
105$(call Package/liballegro/Default/description)
106 This package contains the Allegro example programs named "ex*"
107endef
108
87109define Package/liballegro-utils
88110$(call Package/liballegro/Default)
89111  TITLE+= (utils)
...... 
231253    $(CP) $(PKG_BUILD_DIR)/setup/setup.dat $(1)/usr/share/allegro/
232254endef
233255
256define Package/liballegro-examples/install
257    $(INSTALL_DIR) $(1)/usr/bin/allegro
258    $(CP) $(PKG_BUILD_DIR)/examples/* $(1)/usr/bin/allegro/
259    rm $(1)/usr/bin/allegro/{*.c,*.h,*.txt,*.cmake}
260    rm -r $(1)/usr/bin/allegro/CMakeFiles
261endef
262
234263define Package/liballegro-utils/install
235264    $(INSTALL_DIR) $(1)/usr/bin
236265    $(CP) $(PKG_INSTALL_DIR)/usr/bin $(1)/usr
...... 
242271#$(eval $(call BuildPackage,liballegro-data))
243272$(eval $(call BuildPackage,liballegro-demo))
244273$(eval $(call BuildPackage,liballegro-setup))
274$(eval $(call BuildPackage,liballegro-examples))
245275$(eval $(call BuildPackage,liballegro-utils))
246276
247277
liballegro/patches/010-shooter-gfx-mode.patch
11Index: allegro-4.4.2/demos/shooter/demo.c
22===================================================================
33--- allegro-4.4.2.orig/demos/shooter/demo.c 2011-05-29 12:56:58.000000000 +0200
4+++ allegro-4.4.2/demos/shooter/demo.c 2011-05-29 13:50:44.000000000 +0200
5@@ -90,9 +90,9 @@
4@@ -1,3 +1,5 @@
5+#define DEBUGMODE
6+
7 #include "demo.h"
8 #include "data.h"
9 #include "expl.h"
10@@ -90,9 +92,9 @@
611       allegro_message("Error initialising joystick\n%s\n", allegro_error);
712       install_joystick(JOY_TYPE_NONE);
813    }
914-
1015- if (set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) != 0) {
1116- if (set_gfx_mode(GFX_SAFE, 320, 200, 0, 0) != 0) {
12+ set_color_depth(32);
17+ /* set_color_depth(32); */
1318+ if (set_gfx_mode(GFX_AUTODETECT, 320, 240, 0, 0) != 0) {
1419+ if (set_gfx_mode(GFX_SAFE, 320, 240, 0, 0) != 0) {
1520          set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
liballegro/patches/020-fix-fbcon-init.patch
1Index: allegro-4.4.2/src/linux/fbcon.c
2===================================================================
3--- allegro-4.4.2.orig/src/linux/fbcon.c 2011-05-31 15:57:15.000000000 +0200
4@@ -19,6 +19,10 @@
5  * See readme.txt for copyright information.
6  */
7
8+/* #define DEBUGMODE */
9+
10+#include <errno.h>
11+#include <string.h>
12
13 #include "allegro.h"
14 #include "allegro/internal/aintern.h"
15@@ -263,6 +267,7 @@
16      case -1:
17         /* let's see if we can get the actual screen mode */
18         /* shouldn't we be keeping the previous color depth setting? */
19+ TRACE(PREFIX_I "...orig bpp %i...\n", (int)orig_mode.bits_per_pixel);
20         switch (orig_mode.bits_per_pixel) {
21            case 8:
22            case 16:
23@@ -360,9 +365,21 @@
24      continue;
25
26       /* try to set the mode */
27+ TRACE(PREFIX_I "...trying w %i h %i vw %i vh %i bpp %i...\n",
28+ (int)my_mode.xres, (int)my_mode.yres,
29+ (int)my_mode.xres_virtual, (int)my_mode.yres_virtual,
30+ my_mode.bits_per_pixel);
31       if (ioctl(fbfd, FBIOPUT_VSCREENINFO, &my_mode) == 0) {
32+ TRACE(PREFIX_I "...ioctl ok w %i h %i vw %i vh %i bpp %i...\n",
33+ (int)my_mode.xres, (int)my_mode.yres,
34+ (int)my_mode.xres_virtual, (int)my_mode.yres_virtual,
35+ my_mode.bits_per_pixel);
36      if (my_mode.bits_per_pixel == (unsigned)color_depth)
37         goto got_a_nice_mode;
38+ }
39+ else
40+ {
41+ TRACE(PREFIX_I "...ioctl said %i %s\n", errno, strerror(errno));
42       }
43    }
44
45@@ -377,6 +394,9 @@
46    close(fbfd);
47    ustrzcpy(allegro_error, ALLEGRO_ERROR_SIZE, get_config_text("Framebuffer resolution not available"));
48    TRACE(PREFIX_E "Resolution %dx%d not available...\n", w, h);
49+ /* bugfix: if we don't reset fb_mode_read than the next call to
50+ set_gfx_mode() is going to fail with "bad file descriptor" */
51+ fb_mode_read = FALSE;
52    return NULL;
53
54    got_a_nice_mode:

Archive Download the corresponding diff file



interactive