1
0
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:
David Schmenk 2024-11-11 15:58:25 -08:00
parent 7675708a27
commit d91816019e
4 changed files with 29 additions and 29 deletions

Binary file not shown.

View File

@ -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

View File

@ -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

View File

@ -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