Ah gotcha, yes atlas stuff was being dealt with in the wad_load skeleton() function instead of at load image time. Thanks!
Issue is fixed with these amended functions.
function Wad_LoadSkeleton(Wad,res$, fScale as float, iImageID as integer)
Local SkelID as Integer
Local ManifestIdx as Integer
Local Check as Integer
Local f$ as String
ManifestIdx=Wad_LookupManifest(Wad,res$)
if ManifestIdx=0 then ExitFunction -1
Check=Wad_Extract(Wad,ManifestIdx)
if Check=0 then ExitFunction -2
f$=Wad_PathStrip(Res$)
if Check=0 then ExitFunction -4
SkelID=LoadSkeleton2DFromSpineFile(f$, fScale, iImageID, 1)
DeleteFile(f$)
endfunction SkelID
function Wad_LoadImage(Wad,res$)
Local ImageID as Integer
Local ManifestIdx as Integer
Local Check as Integer
Local f$ as String
Local SubImagesName$ as String
Local atlas$ as string
local atlasStripped$ as string
ManifestIdx=Wad_LookupManifest(Wad,res$)
if ManifestIdx=-1 then ExitFunction -1
Check=Wad_Extract(Wad,ManifestIdx)
if Check=0 then ExitFunction -2
f$=Wad_PathStrip(Res$)
atlas$ = Wad_GetFileNameBase(res$) + ".atlas"
ManifestIdx=Wad_LookupManifest(Wad, atlas$)
if ManifestIdx > -1
Check=Wad_Extract(Wad,ManifestIdx) //only extract if the file exists
endif
ImageID=LoadImage(f$)
atlasStripped$=Wad_PathStrip(atlas$)
DeleteFile(f$)
if GetFileExists(atlasStripped$) then DeleteFile(atlasStripped$)
SubImagesName$=Wad_GetFileNameBase(f$) + " subimages.txt"
if GetFileExists(SubImagesName$) then DeleteFile(SubImagesName$)
endfunction ImageID