From d0136ed145d09b66bd97061c57815d6d1a80e296 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Tue, 4 Apr 2006 19:39:31 +0000 Subject: Doom on H1x0: Don't waste memory, the grayscale lib doesn't need that much, but properly tell the lib how much memory it may use. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9503 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/doom/i_video.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c index 936f496276..69583f5e36 100644 --- a/apps/plugins/doom/i_video.c +++ b/apps/plugins/doom/i_video.c @@ -16,7 +16,10 @@ * GNU General Public License for more details. * * $Log$ - * Revision 1.10 2006/04/04 12:00:53 dave + * Revision 1.11 2006/04/04 19:39:31 amiconn + * Doom on H1x0: Don't waste memory, the grayscale lib doesn't need that much, but properly tell the lib how much memory it may use. + * + * Revision 1.10 2006-04-04 12:00:53 dave * iPod: Make the hold switch bring up the in-game menu. * * Revision 1.9 2006-04-03 20:03:02 kkurbjun @@ -72,7 +75,7 @@ #include "../lib/gray.h" static unsigned char graybuffer[LCD_HEIGHT*LCD_WIDTH]; /* off screen buffer */ static unsigned char *gbuf; -static unsigned int gbuf_size = 0; +#define GRAYBUFSIZE (LCD_WIDTH*LCD_HEIGHT*4+200) #endif #if defined(CPU_COLDFIRE) @@ -451,8 +454,8 @@ void I_InitGraphics(void) /* Note: The other screens are allocated as needed */ #ifndef HAVE_LCD_COLOR - gbuf=malloc(220000); // give a bunch - gray_init(rb, gbuf, gbuf_size, false, LCD_WIDTH, LCD_HEIGHT/8, 32, NULL); + gbuf=malloc(GRAYBUFSIZE); + gray_init(rb, gbuf, GRAYBUFSIZE, false, LCD_WIDTH, LCD_HEIGHT/8, 32, NULL); /* switch on grayscale overlay */ gray_show(true); #endif -- cgit v1.2.3