moved to latest version.
This commit is contained in:
@@ -1 +1,7 @@
|
|||||||
|
|
||||||
|
(animation)
|
||||||
|
(play-clj.g2d.animation)
|
||||||
|
(play-clj.g2d/animation)
|
||||||
|
(play-clj.g2d/animation [])
|
||||||
|
(play-clj.g2d/animation 0.2 [] )
|
||||||
|
(play-clj.g2d/animation 0.2 [] )
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"platform": "mac",
|
"platform": "mac",
|
||||||
"jdk": "/Users/bryce/Documents/jdk8u202-b08/Contents/Home/",
|
"jdk": "/Users/bryce/Documents/jdk8u202-b08/Contents/Home/",
|
||||||
"executable": "Tick's Tales",
|
"executable": "Tick's Tales",
|
||||||
"vmargs": ["-Duse-repl=false", "-Dui_scale=1.0", "-Dclojure.compiler.direct-linking=true", "-Dis-desktop=true", "-Dplatform=desktop"],
|
"vmargs": ["-Duse-repl=false", "-Dui_scale=1.0", "-Dclojure.compiler.direct-linking=true", "-Dis-desktop=true", "-Dplatform=desktop", "-XstartOnFirstThread"],
|
||||||
"classpath": ["target/advent-standalone.jar"],
|
"classpath": ["target/advent-standalone.jar"],
|
||||||
"mainclass": "advent.core.desktop_launcher",
|
"mainclass": "advent.core.desktop_launcher",
|
||||||
"resources": ["resources/icon", "steam_appid.txt"],
|
"resources": ["resources/icon", "steam_appid.txt"],
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"platform": "mac",
|
"platform": "mac",
|
||||||
"jdk": "./jvms/mac.gz",
|
"jdk": "./jvms/mac.gz",
|
||||||
"executable": "Tick's Tales",
|
"executable": "Tick's Tales",
|
||||||
"vmargs": ["-Duse-repl=false", "-Dui_scale=1.0", "-Dno-steam=true", "-Dclojure.compiler.direct-linking=true", "-Dis-desktop=true", "-Dplatform=desktop"],
|
"vmargs": ["-Duse-repl=false", "-Dui_scale=1.0", "-Dno-steam=true", "-Dclojure.compiler.direct-linking=true", "-Dis-desktop=true", "-Dplatform=desktop", "-XstartOnFirstThread"],
|
||||||
"classpath": ["target/advent-standalone.jar"],
|
"classpath": ["target/advent-standalone.jar"],
|
||||||
"mainclass": "advent.core.desktop_launcher",
|
"mainclass": "advent.core.desktop_launcher",
|
||||||
"resources": ["resources/icon", "steam_appid.txt"],
|
"resources": ["resources/icon", "steam_appid.txt"],
|
||||||
|
|||||||
@@ -16,9 +16,9 @@
|
|||||||
:manifest {"Implementation-Version" ~version}
|
:manifest {"Implementation-Version" ~version}
|
||||||
|
|
||||||
:uberjar-name "advent-standalone.jar"
|
:uberjar-name "advent-standalone.jar"
|
||||||
:dependencies [[com.badlogicgames.gdx/gdx "1.9.4"]
|
:dependencies [[com.badlogicgames.gdx/gdx "1.9.5"]
|
||||||
[com.badlogicgames.gdx/gdx-backend-lwjgl "1.9.4"]
|
[com.badlogicgames.gdx/gdx-backend-lwjgl3 "1.9.5"]
|
||||||
[com.badlogicgames.gdx/gdx-platform "1.9.4" :classifier "natives-desktop"]
|
[com.badlogicgames.gdx/gdx-platform "1.9.5" :classifier "natives-desktop"]
|
||||||
[org.clojure/clojure "1.8.0"]
|
[org.clojure/clojure "1.8.0"]
|
||||||
[org.clojars.notid/tools.logging "0.3.2-SNAPSHOT"]
|
[org.clojars.notid/tools.logging "0.3.2-SNAPSHOT"]
|
||||||
[play-clj "0.4.6-BRYCE"]
|
[play-clj "0.4.6-BRYCE"]
|
||||||
@@ -42,8 +42,8 @@
|
|||||||
}
|
}
|
||||||
:dev {
|
:dev {
|
||||||
:source-paths ["src" "src-common" "src-dev"]
|
:source-paths ["src" "src-common" "src-dev"]
|
||||||
:jvm-opts ["-Duse-repl=true" "-Dui_scale=1.0" "-Dno-steam=true" "-Dclojure.compiler.direct-linking=true" "-Dis-desktop=true" "-Dplatform=desktop"]
|
:jvm-opts ["-Duse-repl=true" "-Dui_scale=1.0" "-Dno-steam=true" "-Dclojure.compiler.direct-linking=true" "-Dis-desktop=true" "-Dplatform=desktop" "-XstartOnFirstThread" #_"-Dorg.lwjgl.util.Debug=true"]
|
||||||
:dependencies [[com.badlogicgames.gdx/gdx-tools "1.9.4"]
|
:dependencies [#_[com.badlogicgames.gdx/gdx-tools "1.9.5"]
|
||||||
[org.clojure/tools.nrepl "0.2.12"]
|
[org.clojure/tools.nrepl "0.2.12"]
|
||||||
[play-clj-nrepl "0.1.0" :exclusions [play-clj]]
|
[play-clj-nrepl "0.1.0" :exclusions [play-clj]]
|
||||||
[slamhound "1.5.5"]
|
[slamhound "1.5.5"]
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
:mobile-dev {
|
:mobile-dev {
|
||||||
:source-paths ["src" "src-common" "src-dev"]
|
:source-paths ["src" "src-common" "src-dev"]
|
||||||
:jvm-opts ["-Duse-repl=true" "-Dui_scale=1.5" "-Dno-steam=true" "-Dclojure.compiler.direct-linking=true" "-Dis-desktop=true" "-Dplatform=desktop"]
|
:jvm-opts ["-Duse-repl=true" "-Dui_scale=1.5" "-Dno-steam=true" "-Dclojure.compiler.direct-linking=true" "-Dis-desktop=true" "-Dplatform=desktop"]
|
||||||
:dependencies [[com.badlogicgames.gdx/gdx-tools "1.9.4"]
|
:dependencies [[com.badlogicgames.gdx/gdx-tools "1.9.5"]
|
||||||
[org.clojure/tools.nrepl "0.2.12"]
|
[org.clojure/tools.nrepl "0.2.12"]
|
||||||
[play-clj-nrepl "0.1.0" :exclusions [play-clj]]
|
[play-clj-nrepl "0.1.0" :exclusions [play-clj]]
|
||||||
[slamhound "1.5.5"]
|
[slamhound "1.5.5"]
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
:steam-dev {
|
:steam-dev {
|
||||||
:source-paths ["src" "src-common" "src-dev"]
|
:source-paths ["src" "src-common" "src-dev"]
|
||||||
:jvm-opts ["-Duse-repl=true" "-Dui_scale=1.0" "-Dis-desktop=true" "-Dplatform=desktop"]
|
:jvm-opts ["-Duse-repl=true" "-Dui_scale=1.0" "-Dis-desktop=true" "-Dplatform=desktop"]
|
||||||
:dependencies [[com.badlogicgames.gdx/gdx-tools "1.9.4"]
|
:dependencies [[com.badlogicgames.gdx/gdx-tools "1.9.5"]
|
||||||
[org.clojure/tools.nrepl "0.2.7"]
|
[org.clojure/tools.nrepl "0.2.7"]
|
||||||
[play-clj-nrepl "0.1.0" :exclusions [play-clj]]
|
[play-clj-nrepl "0.1.0" :exclusions [play-clj]]
|
||||||
[slamhound "1.5.5"]
|
[slamhound "1.5.5"]
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
[clojure.core.async :refer [put! poll! <! <!! >! chan go thread take! alts!! dropping-buffer]])
|
[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]
|
(:import [com.badlogic.gdx.graphics Pixmap$Format Pixmap Pixmap$Filter Texture Texture$TextureFilter GL20 GL30]
|
||||||
[com.badlogic.gdx.graphics.g2d TextureRegion Animation Batch]
|
[com.badlogic.gdx.graphics.g2d TextureRegion Animation Batch]
|
||||||
|
[play_clj Animation2]
|
||||||
[com.badlogic.gdx.math Vector3 Matrix4]
|
[com.badlogic.gdx.math Vector3 Matrix4]
|
||||||
[com.badlogic.gdx.utils.viewport FitViewport]
|
[com.badlogic.gdx.utils.viewport FitViewport]
|
||||||
|
|
||||||
@@ -869,12 +870,12 @@
|
|||||||
anim-start (double anim-start)
|
anim-start (double anim-start)
|
||||||
animated-time (unchecked-subtract total-time anim-start)
|
animated-time (unchecked-subtract total-time anim-start)
|
||||||
last-animated-time (unchecked-subtract animated-time delta-time)
|
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?
|
(if anim-loop?
|
||||||
(get-looped-animation-point anim animated-time)
|
(get-looped-animation-point anim animated-time)
|
||||||
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?
|
(if anim-loop?
|
||||||
(get-looped-animation-point anim last-animated-time)
|
(get-looped-animation-point anim last-animated-time)
|
||||||
last-animated-time))]
|
last-animated-time))]
|
||||||
@@ -883,7 +884,7 @@
|
|||||||
(not (:force-rerender entity)))
|
(not (:force-rerender entity)))
|
||||||
entity
|
entity
|
||||||
(merge (-> 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 :force-rerender nil)
|
||||||
(assoc :current-frame-index current-frame-index)
|
(assoc :current-frame-index current-frame-index)
|
||||||
(assoc :previous-frame-index previous-frame-index)
|
(assoc :previous-frame-index previous-frame-index)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Format Pixmap$Blending Pixmap$Filter Texture Texture$TextureFilter]
|
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Format Pixmap$Blending Pixmap$Filter Texture Texture$TextureFilter]
|
||||||
[com.badlogic.gdx.graphics.g2d TextureRegion Animation ParticleEffect]
|
[com.badlogic.gdx.graphics.g2d TextureRegion Animation ParticleEffect]
|
||||||
[play_clj.entities ParticleEffectEntity]
|
[play_clj.entities ParticleEffectEntity]
|
||||||
|
[play_clj Animation2]
|
||||||
[com.badlogic.gdx.utils.viewport FitViewport]
|
[com.badlogic.gdx.utils.viewport FitViewport]
|
||||||
[com.badlogic.gdx.utils ScreenUtils]
|
[com.badlogic.gdx.utils ScreenUtils]
|
||||||
[com.badlogic.gdx.assets.loaders ParticleEffectLoader$ParticleEffectParameter]
|
[com.badlogic.gdx.assets.loaders ParticleEffectLoader$ParticleEffectParameter]
|
||||||
@@ -357,9 +358,9 @@
|
|||||||
(Math/sqrt (+ (* dx dx) (* dy dy)))))
|
(Math/sqrt (+ (* dx dx) (* dy dy)))))
|
||||||
|
|
||||||
|
|
||||||
(defn flip [^Animation anim]
|
(defn flip [^Animation2 anim]
|
||||||
(animation (animation! anim :get-frame-duration)
|
(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))]]
|
:let [frame (texture (texture! src-frame :get-texture))]]
|
||||||
(do
|
(do
|
||||||
(texture! frame :set-region ^TextureRegion src-frame)
|
(texture! frame :set-region ^TextureRegion src-frame)
|
||||||
@@ -656,7 +657,8 @@
|
|||||||
(log/info "Making fullscreen " width "x" height " as true fullscreen")
|
(log/info "Making fullscreen " width "x" height " as true fullscreen")
|
||||||
(.setFullscreenMode Gdx/graphics
|
(.setFullscreenMode Gdx/graphics
|
||||||
(.getDisplayMode Gdx/graphics))
|
(.getDisplayMode Gdx/graphics))
|
||||||
(set! (.foregroundFPS (-> (class Gdx/graphics)
|
;; TODO not work lwjgl3
|
||||||
|
#_(set! (.foregroundFPS (-> (class Gdx/graphics)
|
||||||
(.getDeclaredField (name "config"))
|
(.getDeclaredField (name "config"))
|
||||||
(doto (.setAccessible true))
|
(doto (.setAccessible true))
|
||||||
(.get Gdx/graphics))) 60)))
|
(.get Gdx/graphics))) 60)))
|
||||||
|
|||||||
@@ -3,9 +3,10 @@
|
|||||||
[advent.utils :as utils]
|
[advent.utils :as utils]
|
||||||
[play-clj.core :refer :all]
|
[play-clj.core :refer :all]
|
||||||
[clojure.tools.logging :as log])
|
[clojure.tools.logging :as log])
|
||||||
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication LwjglApplicationConfiguration]
|
(:import [com.badlogic.gdx.backends.lwjgl3 Lwjgl3Application Lwjgl3ApplicationConfiguration Lwjgl3ApplicationConfiguration$HdpiMode]
|
||||||
[org.lwjgl.input Keyboard]
|
#_[org.lwjgl.input Keyboard]
|
||||||
[com.badlogic.gdx Gdx Files$FileType])
|
[com.badlogic.gdx Gdx Files$FileType]
|
||||||
|
[com.badlogic.gdx.graphics.glutils ])
|
||||||
(:gen-class))
|
(:gen-class))
|
||||||
|
|
||||||
|
|
||||||
@@ -23,21 +24,30 @@
|
|||||||
(eval `(play-clj-nrepl.core/start-nrepl advent.core/advent ~port)))
|
(eval `(play-clj-nrepl.core/start-nrepl advent.core/advent ~port)))
|
||||||
|
|
||||||
|
|
||||||
(let [cfg (LwjglApplicationConfiguration.)]
|
(let [cfg (Lwjgl3ApplicationConfiguration.)]
|
||||||
(.addIcon cfg "icon/icon_128x128.png" Files$FileType/Classpath)
|
#_(.addIcon cfg "icon/icon_128x128.png" Files$FileType/Classpath)
|
||||||
(.addIcon cfg "icon/icon_32x32.png" Files$FileType/Classpath)
|
#_(.addIcon cfg "icon/icon_32x32.png" Files$FileType/Classpath)
|
||||||
(.addIcon cfg "icon/icon_16x16.png" Files$FileType/Classpath)
|
#_(.addIcon cfg "icon/icon_16x16.png" Files$FileType/Classpath)
|
||||||
|
|
||||||
(set! (.title cfg) "Tick's Tales: Up All Knight")
|
|
||||||
(set! (.foregroundFPS cfg) 60)
|
#_(set! (.title cfg) "Tick's Tales: Up All Knight")
|
||||||
(set! (.backgroundFPS cfg) 60)
|
(doto cfg
|
||||||
|
#_(.setBackgroundFPS 60)
|
||||||
|
#_(.setForegroundFPS 60)
|
||||||
|
(.setHdpiMode Lwjgl3ApplicationConfiguration$HdpiMode/Pixels)
|
||||||
|
(.setTitle "Tick's Tales: Up All Knight")
|
||||||
|
(.setWindowIcon (into-array ["icon/icon128x128.png"
|
||||||
|
"icon/icon32x32.png"
|
||||||
|
"icon/icon16x16.png"])))
|
||||||
|
#_(set! (.foregroundFPS cfg) 60)
|
||||||
|
#_(set! (.backgroundFPS cfg) 60)
|
||||||
(System/setProperty "org.lwjgl.opengl.Display.enableHighDPI" "false")
|
(System/setProperty "org.lwjgl.opengl.Display.enableHighDPI" "false")
|
||||||
(System/setProperty "org.lwjgl.opengl.Display.disableOSXFullscreenModeAPI" "true")
|
(System/setProperty "org.lwjgl.opengl.Display.disableOSXFullscreenModeAPI" "true")
|
||||||
#_(System/setProperty "org.lwjgl.opengl.Window.undecorated", "true")
|
#_(System/setProperty "org.lwjgl.opengl.Window.undecorated", "true")
|
||||||
|
|
||||||
|
|
||||||
(log/info "Starting game")
|
(log/info "Starting game")
|
||||||
(let [app (LwjglApplication. advent cfg)]
|
(let [app (Lwjgl3Application. advent cfg)]
|
||||||
(when (utils/has-saved-settings?)
|
(when (utils/has-saved-settings?)
|
||||||
(utils/load-settings!))
|
(utils/load-settings!))
|
||||||
(utils/set-fullscreen! (:fullscreen @utils/settings))
|
(utils/set-fullscreen! (:fullscreen @utils/settings))
|
||||||
@@ -46,4 +56,4 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
(Keyboard/enableRepeatEvents true))
|
#_(Keyboard/enableRepeatEvents true))
|
||||||
|
|||||||
Reference in New Issue
Block a user