Loading bitmaps or sprites with palatte

Advanced game related topics
MisterDr
User
User
Posts: 41
Joined: Mon Sep 29, 2003 4:14 pm

Loading bitmaps or sprites with palatte

Post by MisterDr »

Have anybody solutions to load bitmaps or sprites with palette file? It will be similar like this.

LoadBitmapPal(bitmap number,Filename, PalleteFile)
LoadSprite(sprite number,Filename, PalleteFile)


?
pg
User
User
Posts: 75
Joined: Wed Jun 18, 2003 3:31 pm
Location: Swiss
Contact:

Post by pg »

Hi

You can try this code to load a palette, but I did not really test it!
Works only with 8-Bit Bitmaps.


; LOAD A NEW PALETTE***********************
If InitPalette()
If ReadFile(1, "test.pal") =0
MessageRequester("Error","Palette File not found")
End
EndIf
CreatePalette(1)
Index.w=0
Repeat
R.b=ReadByte()
G.b=ReadByte()
B.b=ReadByte()
SetPaletteColor(Index, RGB(R,G,B) )
Index=Index+1
Until Eof(1) Or Index >= 256 ;768 Bytes
CloseFile(1)
DisplayPalette(1)
endif
;******************************************
Post Reply