Commit 9146f67e authored by Robert Sprowson's avatar Robert Sprowson

Add support for local colour tables in GIFs

ChangeFSI previously only supported global colour tables, but will now look at the local colour table bit too.
Additionally, the info report was looking at the wrong bitfield when describing the log2bpp - always showing 8 (because it was showing the colour table size).

Version 1.39. Tagged as 'ChangeFSI-1_39'
parent 95147561
/* (1.38)
/* (1.39)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.38
#define Module_MajorVersion_CMHG 1.39
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 12 May 2013
#define Module_Date_CMHG 15 Jul 2013
#define Module_MajorVersion "1.38"
#define Module_Version 138
#define Module_MajorVersion "1.39"
#define Module_Version 139
#define Module_MinorVersion ""
#define Module_Date "12 May 2013"
#define Module_Date "15 Jul 2013"
#define Module_ApplicationDate "12-May-13"
#define Module_ApplicationDate "15-Jul-13"
#define Module_ComponentName "ChangeFSI"
#define Module_ComponentPath "mixed/RiscOS/Sources/Apps/ChangeFSI"
#define Module_FullVersion "1.38"
#define Module_HelpVersion "1.38 (12 May 2013)"
#define Module_LibraryVersionInfo "1:38"
#define Module_FullVersion "1.39"
#define Module_HelpVersion "1.39 (15 Jul 2013)"
#define Module_LibraryVersionInfo "1:39"
......@@ -2181,9 +2181,11 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
GIF=BGET#c%
GIFback=BGET#c%
GIFext=BGET#c%
quant%=(GIF AND 7)+1
quant%=((GIF>>4)AND 7)+1:REM Log2bpp
IF GIF AND &80 THEN
FOR C%=0 TO (1<<quant%)-1
REM Have global colour table
I%=1<<((GIF AND 7)+1)
FOR C%=0 TO I%-1
r%(C%)=BGET#c%/255*F
g%(C%)=BGET#c%/255*F
b%(C%)=BGET#c%/255*F
......@@ -2201,7 +2203,7 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
UNTIL GIFgcesz=0
I%=BGET#c%
ENDWHILE
IF I%<>ASC "," ERROR 42,"GIF file without , in right place"
IF I%<>ASC "," ERROR 42,"GIF without image separator in right place"
REM pixel aspect ratio
IF GIFext<>0 AND GIFext<>49 THEN
IF GIFext>49 THEN
......@@ -2214,7 +2216,7 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
ENDIF
ENDIF
GIFleft=FNHW
GIFright=FNHW
GIFtop=FNHW
sx%=FNHW
sy%=FNHW
IF GIFsx<sx% OR GIFsy<sy% THEN
......@@ -2227,7 +2229,16 @@ DEF FNChangeFSI(A$,spritearea%,workspace%,worklimit%,oksave%,okinfo%,RETURN ram%
ENDIF
ENDIF
GIF=BGET#c%
IF GIF AND &40 flag=501:r$="FN8"
IF GIF AND &40 flag=501:r$="FN8":REM Interlaced
IF GIF AND &80 THEN
REM Have local colour table, takes precedence
I%=1<<((GIF AND 7)+1)
FOR C%=0 TO I%-1
r%(C%)=BGET#c%/255*F
g%(C%)=BGET#c%/255*F
b%(C%)=BGET#c%/255*F
NEXT
ENDIF
setcodes%=BGET#c%
clearcode%=1<<setcodes%
st%=PTR#c%
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment