Read from steam or local file.
This commit is contained in:
@@ -82,14 +82,13 @@
|
||||
(.put bb# bytes#)
|
||||
(.fileWrite rs# ~filename bb# (count bytes#))))))
|
||||
|
||||
(defn download-screenshot [filename]
|
||||
(when (and has-steam? (not (.exists (files! :local filename))))
|
||||
(defn get-screenshot-bytes [filename]
|
||||
(if has-steam?
|
||||
(eval `(let [rs# (SteamRemoteStorage. nil)
|
||||
len# (.getFileSize rs# ~filename)
|
||||
bb# (ByteBuffer/allocateDirect len#)
|
||||
bytes# (make-array Byte/TYPE len#)]
|
||||
(do (.fileRead rs# ~filename bb# len#)
|
||||
(.get bb# bytes#)
|
||||
(.writeBytes (files! :local ~filename)
|
||||
bytes#
|
||||
false))))))
|
||||
bytes#)))
|
||||
(.readBytes (files! :local filename))))
|
||||
|
||||
Reference in New Issue
Block a user