r8447 - in packages/branches/openarena/openarena-0.8.1/debian: . patches
Bruno Fuddl-guestquot; Fuddl" Kleinert
fuddl-guest at alioth.debian.org
Sun Nov 23 22:28:47 UTC 2008
Author: fuddl-guest
Date: 2008-11-23 22:28:47 +0000 (Sun, 23 Nov 2008)
New Revision: 8447
Modified:
packages/branches/openarena/openarena-0.8.1/debian/changelog
packages/branches/openarena/openarena-0.8.1/debian/patches/20_dont_build_shipped_jpeg.diff
Log:
- disable the patch to link dynamically against system libjpeg: i just don't manage to make it work (doesn't crash, doesn't complain, but files get loaded as garbage
* current status: included jpeg lib is a modified one. trying to move code, which was added to (included) jpeglib into iq3's code results in the very same garbled images - wtf?!
+ (re?)enable speex patch, but it still needs at least one test!
Modified: packages/branches/openarena/openarena-0.8.1/debian/changelog
===================================================================
--- packages/branches/openarena/openarena-0.8.1/debian/changelog 2008-11-23 13:48:57 UTC (rev 8446)
+++ packages/branches/openarena/openarena-0.8.1/debian/changelog 2008-11-23 22:28:47 UTC (rev 8447)
@@ -13,11 +13,11 @@
* Refresh/edit 10_remove_upstream_build_flags.diff: We want to keep
distribution-specific build flags in our rules file
* Add 20_dont_build_shipped_jpeg.diff to build against system jpeg library
- (Closes: #495966)
+ (Closes: #495966)
* Add 30_link_against_local_libspeex.diff to build against system speex and
speexdsp libraries
- -- Bruno "Fuddl" Kleinert <fuddl at debian.org> Tue, 11 Nov 2008 19:50:48 +0100
+ -- Bruno "Fuddl" Kleinert <fuddl at debian.org> Sun, 23 Nov 2008 23:19:22 +0100
openarena (0.7.7+dfsg1-1) unstable; urgency=low
Modified: packages/branches/openarena/openarena-0.8.1/debian/patches/20_dont_build_shipped_jpeg.diff
===================================================================
--- packages/branches/openarena/openarena-0.8.1/debian/patches/20_dont_build_shipped_jpeg.diff 2008-11-23 13:48:57 UTC (rev 8446)
+++ packages/branches/openarena/openarena-0.8.1/debian/patches/20_dont_build_shipped_jpeg.diff 2008-11-23 22:28:47 UTC (rev 8447)
@@ -7,8 +7,8 @@
@DPATCH@
Index: openarena-0.8.1/Makefile
===================================================================
---- openarena-0.8.1.orig/Makefile 2008-11-13 21:57:42.000000000 +0100
-+++ openarena-0.8.1/Makefile 2008-11-13 21:57:42.000000000 +0100
+--- openarena-0.8.1.orig/Makefile 2008-11-23 22:43:07.000000000 +0100
++++ openarena-0.8.1/Makefile 2008-11-23 22:43:07.000000000 +0100
@@ -158,7 +158,7 @@
NDIR=$(MOUNT_DIR)/null
UIDIR=$(MOUNT_DIR)/ui
@@ -82,9 +82,9 @@
$(DO_CC)
Index: openarena-0.8.1/code/renderer/tr_image_jpg.c
===================================================================
---- openarena-0.8.1.orig/code/renderer/tr_image_jpg.c 2008-11-13 21:57:30.000000000 +0100
-+++ openarena-0.8.1/code/renderer/tr_image_jpg.c 2008-11-13 23:53:57.000000000 +0100
-@@ -31,7 +31,35 @@
+--- openarena-0.8.1.orig/code/renderer/tr_image_jpg.c 2008-11-23 22:38:41.000000000 +0100
++++ openarena-0.8.1/code/renderer/tr_image_jpg.c 2008-11-23 22:58:05.000000000 +0100
+@@ -31,7 +31,118 @@
*/
#define JPEG_INTERNALS
@@ -93,81 +93,114 @@
+#include <jpeglib.h>
+#include <jerror.h>
+
-+/*
-+static void LoadJPG_init_source(j_decompress_ptr cinfo) {
-+ cinfo->src->start_of_file = TRUE;
++#define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */
++/* Expanded data source object for stdio input */
++
++typedef struct {
++ struct jpeg_source_mgr pub; /* public fields */
++
++ unsigned char *inbuf; /* source stream */
++ size_t inbufbytes;
++ JOCTET * buffer; /* start of buffer */
++ boolean start_of_file; /* have we gotten any data yet? */
++} my_source_mgr;
++
++typedef my_source_mgr * my_src_ptr;
++
++void init_source (j_decompress_ptr cinfo)
++{
++ my_src_ptr src = (my_src_ptr) cinfo->src;
++
++ /* We reset the empty-input-file flag for each image,
++ * but we don't clear the input buffer.
++ * This is correct behavior for reading a series of images from one source.
++ */
++ src->start_of_file = TRUE;
+}
+
-+static boolean LoadJPG_fill_input_buffer(j_decompress_ptr cinfo) {
-+ return TRUE;
++boolean fill_input_buffer (j_decompress_ptr cinfo)
++{
++ my_src_ptr src = (my_src_ptr) cinfo->src;
++ size_t nbytes = MIN(src->inbufbytes, INPUT_BUF_SIZE);
++
++ if(!nbytes)
++ {
++ WARNMS(cinfo, JWRN_JPEG_EOF);
++ /* Insert a fake EOI marker */
++ src->buffer[0] = (JOCTET) 0xFF;
++ src->buffer[1] = (JOCTET) JPEG_EOI;
++ nbytes = 2;
++ }
++ else
++ {
++ memcpy( src->buffer, src->inbuf, nbytes);
++
++ src->inbuf += nbytes;
++ src->inbufbytes -= nbytes;
++ }
++
++ src->pub.next_input_byte = src->buffer;
++ src->pub.bytes_in_buffer = nbytes;
++ src->start_of_file = FALSE;
++
++ return TRUE;
+}
+
-+static void LoadJPG_skip_input_data(j_decompress_ptr cinfo, long num_bytes) {
-+ if(num_bytes < 1)
-+ return;
-+ if(cinfo->src->bytes_in_buffer - num_bytes < 0) {
-+ cinfo->src->next_input_byte += cinfo->src->bytes_in_buffer;
-+ cinfo->src->bytes_in_buffer = (size_t) 0;
-+ } else {
-+ cinfo->src->next_input_byte += (size_t) num_bytes;
-+ cinfo->src->bytes_in_buffer -= (size_t) num_bytes;
-+ }
-+ return;
++void skip_input_data (j_decompress_ptr cinfo, long num_bytes)
++{
++ my_src_ptr src = (my_src_ptr) cinfo->src;
++
++ /* Just a dumb implementation for now. Could use fseek() except
++ * it doesn't work on pipes. Not clear that being smart is worth
++ * any trouble anyway --- large skips are infrequent.
++ */
++ if (num_bytes > 0) {
++ while (num_bytes > (long) src->pub.bytes_in_buffer) {
++ num_bytes -= (long) src->pub.bytes_in_buffer;
++ (void) fill_input_buffer(cinfo);
++ /* note we assume that fill_input_buffer will never return FALSE,
++ * so suspension need not be handled.
++ */
++ }
++ src->pub.next_input_byte += (size_t) num_bytes;
++ src->pub.bytes_in_buffer -= (size_t) num_bytes;
++ }
+}
+
-+static void LoadJPG_term_source(j_decompress_ptr cinfo) {
++void term_source (j_decompress_ptr cinfo) {}
++
++void jpeg_mem_src (j_decompress_ptr cinfo, unsigned char *inbuf, size_t size)
++{
++ my_src_ptr src;
++
++ /* The source object and input buffer are made permanent so that a series
++ * of JPEG images can be read from the same file by calling jpeg_stdio_src
++ * only before the first one. (If we discarded the buffer at the end of
++ * one image, we'd likely lose the start of the next one.)
++ * This makes it unsafe to use this manager and a different source
++ * manager serially with the same JPEG object. Caveat programmer.
++ */
++ if (cinfo->src == NULL) { /* first time for this JPEG object? */
++ cinfo->src = (struct jpeg_source_mgr *)
++ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
++ sizeof(my_source_mgr));
++ src = (my_src_ptr) cinfo->src;
++ src->buffer = (JOCTET *)
++ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
++ INPUT_BUF_SIZE * sizeof(JOCTET));
++ }
++
++ src = (my_src_ptr) cinfo->src;
++ src->pub.init_source = init_source;
++ src->pub.fill_input_buffer = fill_input_buffer;
++ src->pub.skip_input_data = skip_input_data;
++ src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
++ src->pub.term_source = term_source;
++ src->inbuf = inbuf;
++ src->inbufbytes = size;
++ src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */
++ src->pub.next_input_byte = NULL; /* until buffer loaded */
+}
-+*/
void R_LoadJPG( const char *filename, unsigned char **pic, int *width, int *height ) {
/* This struct contains the JPEG decompression parameters and pointers to
-@@ -59,6 +87,10 @@
- int len;
- byte *fbuffer;
- byte *buf;
-+ FILE *memfile;
-+ /*
-+ struct jpeg_source_mgr LoadJPG_jpeg_src_mgr;
-+ */
-
- /* In this example we want to open the input file before doing anything else,
- * so that the setjmp() error recovery below can assume the file is open.
-@@ -70,6 +102,16 @@
- if (!fbuffer || len < 0) {
- return;
- }
-+ /*
-+ LoadJPG_jpeg_src_mgr.next_input_byte = (JOCTET *) fbuffer;
-+ LoadJPG_jpeg_src_mgr.bytes_in_buffer = (size_t) len;
-+ LoadJPG_jpeg_src_mgr.init_source = LoadJPG_init_source;
-+ LoadJPG_jpeg_src_mgr.fill_input_buffer = LoadJPG_fill_input_buffer;
-+ LoadJPG_jpeg_src_mgr.skip_input_data = LoadJPG_skip_input_data;
-+ LoadJPG_jpeg_src_mgr.resync_to_restart = jpeg_resync_to_restart;
-+ LoadJPG_jpeg_src_mgr.term_source = LoadJPG_term_source;
-+ cinfo.src = &LoadJPG_jpeg_src_mgr;
-+ */
-
- /* Step 1: allocate and initialize JPEG decompression object */
-
-@@ -85,7 +127,12 @@
-
- /* Step 2: specify data source (eg, a file) */
-
-- jpeg_mem_src(&cinfo, fbuffer, len);
-+ /*jpeg_mem_src(&cinfo, fbuffer, len);*/
-+ if((memfile = fmemopen((void *) fbuffer, (size_t) len, "rb")) == NULL) {
-+ puts("fmemopen() failed");
-+ return;
-+ }
-+ jpeg_stdio_src(&cinfo, memfile);
-
- /* Step 3: read file parameters with jpeg_read_header() */
-
-@@ -210,6 +257,7 @@
- */
-
- /* And we're done! */
-+ fclose(memfile);
- }
-
-
More information about the Pkg-games-commits
mailing list