moved to latest version.

This commit is contained in:
Bryce Covert
2021-01-18 08:23:13 -08:00
parent 818dfaabb8
commit 7c6b1d7d94
7 changed files with 46 additions and 27 deletions

View File

@@ -46,6 +46,7 @@
[clojure.core.async :refer [put! poll! <! <!! >! chan go thread take! alts!! dropping-buffer]])
(:import [com.badlogic.gdx.graphics Pixmap$Format Pixmap Pixmap$Filter Texture Texture$TextureFilter GL20 GL30]
[com.badlogic.gdx.graphics.g2d TextureRegion Animation Batch]
[play_clj Animation2]
[com.badlogic.gdx.math Vector3 Matrix4]
[com.badlogic.gdx.utils.viewport FitViewport]
@@ -869,12 +870,12 @@
anim-start (double anim-start)
animated-time (unchecked-subtract total-time anim-start)
last-animated-time (unchecked-subtract animated-time delta-time)
current-frame-index (animation! ^Animation anim :get-key-frame-index
current-frame-index (animation! ^Animation2 anim :get-key-frame-index
(if anim-loop?
(get-looped-animation-point anim animated-time)
animated-time))
previous-frame-index (animation! ^Animation anim :get-key-frame-index
previous-frame-index (animation! ^Animation2 anim :get-key-frame-index
(if anim-loop?
(get-looped-animation-point anim last-animated-time)
last-animated-time))]
@@ -883,7 +884,7 @@
(not (:force-rerender entity)))
entity
(merge (-> entity
(assoc :object (.getKeyFrame ^Animation anim (- total-time anim-start) anim-loop?))
(assoc :object (.getKeyFrame ^Animation2 anim (- total-time anim-start) anim-loop?))
(assoc :force-rerender nil)
(assoc :current-frame-index current-frame-index)
(assoc :previous-frame-index previous-frame-index)

View File

@@ -16,6 +16,7 @@
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Format Pixmap$Blending Pixmap$Filter Texture Texture$TextureFilter]
[com.badlogic.gdx.graphics.g2d TextureRegion Animation ParticleEffect]
[play_clj.entities ParticleEffectEntity]
[play_clj Animation2]
[com.badlogic.gdx.utils.viewport FitViewport]
[com.badlogic.gdx.utils ScreenUtils]
[com.badlogic.gdx.assets.loaders ParticleEffectLoader$ParticleEffectParameter]
@@ -357,9 +358,9 @@
(Math/sqrt (+ (* dx dx) (* dy dy)))))
(defn flip [^Animation anim]
(defn flip [^Animation2 anim]
(animation (animation! anim :get-frame-duration)
(for [src-frame (animation! anim :get-key-frames)
(for [src-frame (.getRawKeyFrames ^Animation2 anim )
:let [frame (texture (texture! src-frame :get-texture))]]
(do
(texture! frame :set-region ^TextureRegion src-frame)
@@ -656,7 +657,8 @@
(log/info "Making fullscreen " width "x" height " as true fullscreen")
(.setFullscreenMode Gdx/graphics
(.getDisplayMode Gdx/graphics))
(set! (.foregroundFPS (-> (class Gdx/graphics)
;; TODO not work lwjgl3
#_(set! (.foregroundFPS (-> (class Gdx/graphics)
(.getDeclaredField (name "config"))
(doto (.setAccessible true))
(.get Gdx/graphics))) 60)))