2
0
Эх сурвалжийг харах

Deprecated BMPLoader and TGALoader.

woollybah 8 жил өмнө
parent
commit
1b2f1f5f96

+ 9 - 6
bmploader.mod/bmploader.bmx

@@ -21,6 +21,9 @@ ModuleInfo "History: Fixed inverted 1 bit bitmaps"
 ModuleInfo "History: 1.05 Release"
 ModuleInfo "History: Fixed palettized bitmaps failing when biClrUsed=0"
 
+Import BRL.StbImageLoader
+
+?deprecated
 Import BRL.Pixmap
 Import BRL.EndianStream
 
@@ -34,7 +37,7 @@ Type TPixmapLoaderBMP Extends TPixmapLoader
 		Local	pixmap:TPixmap
 		Local	hsize,hoffset,pad
 		Local	size,width,height
-		Local	planes,bits,compression,isize,xpels,ypels,cols,inuse
+		Local	planes,bits,compression,isize,xpels,ypels,COLS,inuse
 		Local	w,x,y,c0,c1,p
 
 		If stream.ReadBytes( buf,2 )=2
@@ -51,10 +54,10 @@ Type TPixmapLoaderBMP Extends TPixmapLoader
 				isize=ReadInt(stream)
 				xpels=ReadInt(stream)
 				ypels=ReadInt(stream)
-				cols=ReadInt(stream)
+				COLS=ReadInt(stream)
 				inuse=ReadInt(stream)
 				hoffset:-54
-				If Not cols cols=1 Shl bits
+				If Not COLS COLS=1 Shl bits
 				If bits=32
 					pixmap=TPixmap.Create( width,height,PF_BGRA8888 )
 				Else
@@ -80,7 +83,7 @@ Type TPixmapLoaderBMP Extends TPixmapLoader
 					Case 4
 						palette=New Int[16]
 						line=New Int[width]
-						stream.ReadBytes(palette,cols*4)
+						stream.ReadBytes(palette,COLS*4)
 						w=(width+1)/2
 						w=(w+3)&$fffc
 						pix=New Byte[w]
@@ -95,7 +98,7 @@ Type TPixmapLoaderBMP Extends TPixmapLoader
 					Case 8
 						palette=New Int[256]
 						line=New Int[width]
-						stream.ReadBytes(palette,cols*4)
+						stream.ReadBytes(palette,COLS*4)
 						w=(width+3)&$fffc
 						pix=New Byte[w]
 						For y=height-1 To 0 Step -1
@@ -131,4 +134,4 @@ Type TPixmapLoaderBMP Extends TPixmapLoader
 End Type
 
 New TPixmapLoaderBMP
-
+?

+ 7 - 3
tgaloader.mod/tgaloader.bmx

@@ -20,6 +20,9 @@ ModuleInfo "History: Support for Run Length Encoded compression"
 ModuleInfo "History: 1.05 Release"
 ModuleInfo "History: Fixed 24 bit byte ordering"
 
+Import BRL.StbImageLoader
+
+?deprecated
 Import BRL.Pixmap
 Import BRL.EndianStream
 
@@ -40,9 +43,9 @@ Type tgahdr
 End Type
 
 Function makeargb(a,r,g,b)
-?BigEndian
-	Return (b Shl 24)|(g Shl 16)|(r Shl 8)|a
-?
+'?BigEndian
+'	Return (b Shl 24)|(g Shl 16)|(r Shl 8)|a
+'?
 	Return (a Shl 24)|(r Shl 16)|(g Shl 8)|b
 End Function
 
@@ -217,3 +220,4 @@ Type TPixmapLoaderTGA Extends TPixmapLoader
 End Type
 
 New TPixmapLoaderTGA
+?