Oops, I had forgotten to add a subdirectory to my local copy of libjpeg using 'svn add' so 'svn diff' didn't include it in the libjpeg patch. I guess I just overlooked the size of the patch. I checked out the latest revision and made a new patch for it with the full update this time called libjpeg.diff.tar.gz. I also included it in updates.tar.gz. Sorry about that :/.
Edit:
fread() actually was fine, so I'll submit a patch to revert my change.I thought it was a division precision error but I guess it wasn't :D. gsKit_texture_fnt() tries to read in 262144 bytes of data (the size of the texture) but there's only 262143 bytes to be read, so fread() returns 0 like it ought have.
Code: Select all
Index: ps2sdk/ee/libc/src/stdio.c
===================================================================
--- ps2sdk/ee/libc/src/stdio.c (revision 1467)
+++ ps2sdk/ee/libc/src/stdio.c (working copy)
@@ -752,7 +752,7 @@
read_len--;
}
//ret += fioRead(stream->fd, buf, read_len) / r;
- ret += _ps2sdk_read(stream->fd, buf, read_len) / n;
+ ret += _ps2sdk_read(stream->fd, buf, read_len) / r;
}
return (ret);
}
As a side note, does anyone know what type of font those .fnt files are? The way gsKit_texture_fnt() reads the header on them doesn't conform to the spec of windows .fnts. I can't get fontforge to recognize the file type either and it supports a good range. From the looks of it, it seems to be something like this
http://giesler.biz/bjoern/downloads/dsg ... format.txt.
This patch just lets gsKit work with the bad font read until a better fix is made.
Code: Select all
Index: gsKit/ee/gs/src/gsTexture.c
===================================================================
--- gsKit/ee/gs/src/gsTexture.c (revision 1467)
+++ gsKit/ee/gs/src/gsTexture.c (working copy)
@@ -774,8 +774,7 @@
if(fread(gsFont->Texture->Mem, size, 1, File) <= 0)
{
- printf("Could not load font: %s\n", gsFont->Path);
- return -1;
+ printf("Font might be bad: %s\n", gsFont->Path);
}
fclose(File);