liballegro/Makefile |
5 | 5 | # |
6 | 6 | # OpenWRT package for the Allegro game and multimedia library |
7 | 7 | |
| 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 | # |
8 | 19 | include $(TOPDIR)/rules.mk |
9 | 20 | |
10 | 21 | PKG_NAME:=liballegro |
... | ... | |
84 | 95 | This package contains the Allegro setup program |
85 | 96 | endef |
86 | 97 | |
| 98 | define Package/liballegro-examples |
| 99 | $(call Package/liballegro/Default) |
| 100 | TITLE+= (examples) |
| 101 | DEPENDS:=+liballegro |
| 102 | endef |
| 103 | |
| 104 | define Package/liballegro-examples/description |
| 105 | $(call Package/liballegro/Default/description) |
| 106 | This package contains the Allegro example programs named "ex*" |
| 107 | endef |
| 108 | |
87 | 109 | define Package/liballegro-utils |
88 | 110 | $(call Package/liballegro/Default) |
89 | 111 | TITLE+= (utils) |
... | ... | |
231 | 253 | $(CP) $(PKG_BUILD_DIR)/setup/setup.dat $(1)/usr/share/allegro/ |
232 | 254 | endef |
233 | 255 | |
| 256 | define 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 |
| 261 | endef |
| 262 | |
234 | 263 | define Package/liballegro-utils/install |
235 | 264 | $(INSTALL_DIR) $(1)/usr/bin |
236 | 265 | $(CP) $(PKG_INSTALL_DIR)/usr/bin $(1)/usr |
... | ... | |
242 | 271 | #$(eval $(call BuildPackage,liballegro-data)) |
243 | 272 | $(eval $(call BuildPackage,liballegro-demo)) |
244 | 273 | $(eval $(call BuildPackage,liballegro-setup)) |
| 274 | $(eval $(call BuildPackage,liballegro-examples)) |
245 | 275 | $(eval $(call BuildPackage,liballegro-utils)) |
246 | 276 | |
247 | 277 | |
liballegro/patches/010-shooter-gfx-mode.patch |
1 | 1 | Index: allegro-4.4.2/demos/shooter/demo.c |
2 | 2 | =================================================================== |
3 | 3 | --- 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 @@ |
6 | 11 | allegro_message("Error initialising joystick\n%s\n", allegro_error); |
7 | 12 | install_joystick(JOY_TYPE_NONE); |
8 | 13 | } |
9 | 14 | - |
10 | 15 | - if (set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) != 0) { |
11 | 16 | - if (set_gfx_mode(GFX_SAFE, 320, 200, 0, 0) != 0) { |
12 | | + set_color_depth(32); |
| 17 | + /* set_color_depth(32); */ |
13 | 18 | + if (set_gfx_mode(GFX_AUTODETECT, 320, 240, 0, 0) != 0) { |
14 | 19 | + if (set_gfx_mode(GFX_SAFE, 320, 240, 0, 0) != 0) { |
15 | 20 | set_gfx_mode(GFX_TEXT, 0, 0, 0, 0); |
liballegro/patches/020-fix-fbcon-init.patch |
| 1 | Index: 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: |