mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-01-05 02:30:56 +00:00
Move GREASY IMPORT back intro SPRED
This commit is contained in:
parent
7675708a27
commit
d91816019e
Binary file not shown.
@ -6,7 +6,6 @@ import dcgrutils
|
||||
predef dcgrBoldStr(clr, x, y, strptr)#0
|
||||
predef dcgrFont(font)#0
|
||||
predef dcgrRect(x, y, w, h)#0
|
||||
predef frameRead(filestr, frame)#1
|
||||
predef spriteRead(filestr)#5
|
||||
predef spriteWrite(filestr, xorg, yorg, width, height, sprptr)#1
|
||||
predef screenRead(filestr)#1
|
||||
|
@ -124,34 +124,6 @@ export def dcgrRect(x, y, w, h)#0
|
||||
dcgrHLin(x, x2, v)
|
||||
next
|
||||
end
|
||||
export def frameRead(filestr, frame)#1
|
||||
var sprptr, sprsize
|
||||
byte refnum, numframes
|
||||
|
||||
sprptr = 0
|
||||
refnum = fileio:open(filestr)
|
||||
if refnum
|
||||
sprsize = 40 * 40 / 2
|
||||
sprptr = heapalloc(sprsize)
|
||||
if sprptr and fileio:read(refnum, @numframes, 1)
|
||||
if numframes < frame
|
||||
heaprelease(sprptr)
|
||||
sprptr = NULL
|
||||
fin
|
||||
fin
|
||||
if sprptr
|
||||
if fileio:setmark(refnum, (frame - 1) * sprsize + 1, 0)
|
||||
heaprelease(sprptr)
|
||||
sprptr = NULL
|
||||
elsif fileio:read(refnum, sprptr, sprsize) <> sprsize
|
||||
heaprelease(sprptr)
|
||||
sprptr = NULL
|
||||
fin
|
||||
fin
|
||||
fileio:close(refnum)
|
||||
fin
|
||||
return sprptr
|
||||
end
|
||||
export def spriteRead(filestr)#5
|
||||
var sprptr, sprsize, xorg, yorg
|
||||
byte refnum, width, height
|
||||
|
@ -98,6 +98,35 @@ def greasy2gr(pGreasy)#0
|
||||
next
|
||||
end
|
||||
|
||||
def frameRead(filestr, frame)#1
|
||||
var sprptr, sprsize
|
||||
byte refnum, numframes
|
||||
|
||||
sprptr = 0
|
||||
refnum = fileio:open(filestr)
|
||||
if refnum
|
||||
sprsize = 40 * 40 / 2
|
||||
sprptr = heapalloc(sprsize)
|
||||
if sprptr and fileio:read(refnum, @numframes, 1)
|
||||
if numframes < frame
|
||||
heaprelease(sprptr)
|
||||
sprptr = NULL
|
||||
fin
|
||||
fin
|
||||
if sprptr
|
||||
if fileio:setmark(refnum, (frame - 1) * sprsize + 1, 0)
|
||||
heaprelease(sprptr)
|
||||
sprptr = NULL
|
||||
elsif fileio:read(refnum, sprptr, sprsize) <> sprsize
|
||||
heaprelease(sprptr)
|
||||
sprptr = NULL
|
||||
fin
|
||||
fin
|
||||
fileio:close(refnum)
|
||||
fin
|
||||
return sprptr
|
||||
end
|
||||
|
||||
def importGreasy(frame)
|
||||
var sprptr
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user