Update loadhexpalette.bm
This commit is contained in:
parent
477e53ace0
commit
4c82f072fc
1 changed files with 2 additions and 8 deletions
|
|
@ -1,9 +1,6 @@
|
|||
SUB LoadHexPalette (Filename$, palettearray() AS _UNSIGNED LONG)
|
||||
DIM i AS INTEGER
|
||||
DIM ff AS INTEGER
|
||||
DIM r AS _UNSIGNED _BYTE
|
||||
DIM g AS _UNSIGNED _BYTE
|
||||
DIM b AS _UNSIGNED _BYTE
|
||||
DIM Colorload AS STRING
|
||||
i = LBOUND(palettearray) - 1
|
||||
ff = FREEFILE
|
||||
|
|
@ -11,15 +8,12 @@ SUB LoadHexPalette (Filename$, palettearray() AS _UNSIGNED LONG)
|
|||
OPEN Filename$ FOR INPUT AS ff
|
||||
DO UNTIL EOF(ff)
|
||||
LINE INPUT #ff, Colorload
|
||||
r = VAL("&H" + MID$(Colorload, 1, 2))
|
||||
g = VAL("&H" + MID$(Colorload, 3, 2))
|
||||
b = VAL("&H" + MID$(Colorload, 5, 2))
|
||||
i = i + 1
|
||||
IF i > UBOUND(palettearray) THEN
|
||||
REDIM _PRESERVE palettearray(i) AS _UNSIGNED LONG
|
||||
END IF
|
||||
palettearray(i) = _RGB32(r, g, b)
|
||||
palettearray(i) = Val("&HFF" + Colorload)
|
||||
LOOP
|
||||
CLOSE ff
|
||||
END IF
|
||||
END SUB
|
||||
END SUB
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue