From 973f452641df83a377be8f824b8d6b993984959b Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Thu, 21 Jul 2016 19:48:54 -0700 Subject: [PATCH] mobile prep --- desktop/project.clj | 8 ++++---- desktop/src-common/advent/screens/credits.clj | 4 ++-- desktop/src-common/advent/screens/dialogue.clj | 4 +--- desktop/src-common/advent/screens/fade.clj | 2 +- desktop/src-common/advent/screens/inventory.clj | 2 +- desktop/src-common/advent/screens/safe.clj | 2 +- desktop/src-common/advent/screens/scene.clj | 6 +++--- desktop/src-common/advent/screens/splash.clj | 5 +++-- desktop/src-common/advent/screens/title.clj | 16 ++++++++-------- desktop/src-common/advent/utils.clj | 6 +++--- 10 files changed, 27 insertions(+), 28 deletions(-) diff --git a/desktop/project.clj b/desktop/project.clj index ad4ffdea..d0f7ad95 100644 --- a/desktop/project.clj +++ b/desktop/project.clj @@ -5,10 +5,10 @@ :manifest {"Implementation-Version" ~version} :uberjar-name "advent-standalone.jar" - :dependencies [[com.badlogicgames.gdx/gdx "1.5.3"] - [com.badlogicgames.gdx/gdx-backend-lwjgl "1.5.3"] - [com.badlogicgames.gdx/gdx-platform "1.5.3" :classifier "natives-desktop"] - [org.clojure/clojure "1.6.0"] + :dependencies [[com.badlogicgames.gdx/gdx "1.9.3"] + [com.badlogicgames.gdx/gdx-backend-lwjgl "1.9.3"] + [com.badlogicgames.gdx/gdx-platform "1.9.3" :classifier "natives-desktop"] + [org.clojure/clojure "1.8.0"] [play-clj "0.4.5-BRYCE"] [log4j/log4j "1.2.16"] [org.clojure/data.priority-map "0.0.5"] diff --git a/desktop/src-common/advent/screens/credits.clj b/desktop/src-common/advent/screens/credits.clj index 5eb632ac..5dcd970e 100644 --- a/desktop/src-common/advent/screens/credits.clj +++ b/desktop/src-common/advent/screens/credits.clj @@ -10,7 +10,7 @@ [advent.utils :as utils]) (:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter] [com.badlogic.gdx.graphics.g2d TextureRegion] - [com.badlogic.gdx.scenes.scene2d.utils Align] + [com.badlogic.gdx.utils Align] [com.badlogic.gdx.utils.viewport FitViewport] [com.badlogic.gdx Application Audio Files Game Gdx Graphics Input InputMultiplexer InputProcessor Net Preferences Screen])) @@ -149,7 +149,7 @@ :on-show (fn [screen entities] (utils/setup-viewport screen 1280 960) - (input! :set-cursor-image (utils/cursor "cursor.png" :main) 0 0) + (graphics! :set-cursor (utils/cursor "cursor.png" :main)) (let [font (bitmap-font "ego/font.fnt" )] {:font font :bg (assoc (utils/get-texture "black.png") diff --git a/desktop/src-common/advent/screens/dialogue.clj b/desktop/src-common/advent/screens/dialogue.clj index 5b53f84e..fb47c077 100644 --- a/desktop/src-common/advent/screens/dialogue.clj +++ b/desktop/src-common/advent/screens/dialogue.clj @@ -13,7 +13,7 @@ (:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter] [com.badlogic.gdx.graphics.g2d TextureRegion] [com.badlogic.gdx.utils.viewport FitViewport] - [com.badlogic.gdx.scenes.scene2d.utils Align] + [com.badlogic.gdx.utils Align] [com.badlogic.gdx.math Vector3 Vector2 Matrix4] [com.badlogic.gdx Screen] [play_clj.entities NinePatchEntity])) @@ -58,7 +58,6 @@ _ (nine-patch! p :set-padding 25 25 5 15) bg (drawable :nine-patch (:object p)) - _ (bitmap-font! font :set-markup-enabled true) tr (bitmap-font! font :get-region) scale (/ scale 2) scale (or (min (max scale 0.2) 0.25) 0.25) @@ -208,7 +207,6 @@ _ (nine-patch! p :set-padding 25 25 5 15) bg (drawable :nine-patch (:object p)) - _ (bitmap-font! font :set-markup-enabled true) tr (bitmap-font! font :get-region) tx (.getTexture tr) diff --git a/desktop/src-common/advent/screens/fade.clj b/desktop/src-common/advent/screens/fade.clj index 2345107e..299f9ec3 100644 --- a/desktop/src-common/advent/screens/fade.clj +++ b/desktop/src-common/advent/screens/fade.clj @@ -9,7 +9,7 @@ [advent.utils :as utils]) (:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter] [com.badlogic.gdx.graphics.g2d TextureRegion] - [com.badlogic.gdx.scenes.scene2d.utils Align] + [com.badlogic.gdx.utils Align] [com.badlogic.gdx Application Audio Files Game Gdx Graphics Input InputMultiplexer InputProcessor Net Preferences Screen])) diff --git a/desktop/src-common/advent/screens/inventory.clj b/desktop/src-common/advent/screens/inventory.clj index 7339bd3f..c2bd0fc3 100644 --- a/desktop/src-common/advent/screens/inventory.clj +++ b/desktop/src-common/advent/screens/inventory.clj @@ -12,7 +12,7 @@ (:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter] [com.badlogic.gdx.graphics.g2d TextureRegion] [com.badlogic.gdx.utils.viewport FitViewport] - [com.badlogic.gdx.scenes.scene2d.utils Align] + [com.badlogic.gdx.utils Align] [com.badlogic.gdx Application Audio Files Game Gdx Graphics Input InputMultiplexer InputProcessor Net Preferences Screen])) diff --git a/desktop/src-common/advent/screens/safe.clj b/desktop/src-common/advent/screens/safe.clj index 5d369be3..7c51c2f1 100644 --- a/desktop/src-common/advent/screens/safe.clj +++ b/desktop/src-common/advent/screens/safe.clj @@ -10,7 +10,7 @@ (:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter] [com.badlogic.gdx.utils.viewport FitViewport] [com.badlogic.gdx.graphics.g2d TextureRegion] - [com.badlogic.gdx.scenes.scene2d.utils Align] + [com.badlogic.gdx.utils Align] [com.badlogic.gdx Application Audio Files Game Gdx Graphics Input InputMultiplexer InputProcessor Net Preferences Screen])) diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index e023646c..df56f96a 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -881,7 +881,7 @@ void main () last) (= active was-active)) (let [image-path (if active "cursor_light.png" "cursor.png")] - (input! :set-cursor-image (utils/cursor image-path (or (:cursor new-current) new-current)) 0 0))) + (graphics! :set-cursor (utils/cursor image-path (or (:cursor new-current) new-current))))) (update-in entities [:cursor ] assoc :last new-current :was-active active)) entities)) @@ -1204,7 +1204,7 @@ void main () :on-resume (fn [screen [{{:keys [current override last active was-active]} :cursor :as entities}]] (let [current (or override current) image-path (if active "cursor_light.png" "cursor.png")] - (input! :set-cursor-image (utils/cursor image-path (or (:cursor current) current)) 0 0)) + (graphics! :set-cursor (utils/cursor image-path (or (:cursor current) current)))) (doseq [[k [start time fn]] (get-in entities [:room :timers])] (add-timer! screen k start time))) @@ -1384,7 +1384,7 @@ void main () (when-not (or (get-in entities [:tweens :fade-out]) (get-in entities [:tweens :fade-in])) - (input! :set-cursor-image (utils/cursor "cursor.png" :hourglass) 0 0) + (graphics! :set-cursor (utils/cursor "cursor.png" :hourglass)) (-> entities (assoc-in [:closing? :value] true) (assoc-in [:tweens :fade-out-music] diff --git a/desktop/src-common/advent/screens/splash.clj b/desktop/src-common/advent/screens/splash.clj index 5fab1ceb..a6976082 100644 --- a/desktop/src-common/advent/screens/splash.clj +++ b/desktop/src-common/advent/screens/splash.clj @@ -19,7 +19,8 @@ [com.badlogic.gdx.scenes.scene2d.ui Slider$SliderStyle Widget ButtonGroup TextButton$TextButtonStyle CheckBox$CheckBoxStyle CheckBox Button] [com.badlogic.gdx.scenes.scene2d Group Actor] [play_clj.entities ActorEntity] - [com.badlogic.gdx.scenes.scene2d.utils Align NinePatchDrawable TextureRegionDrawable] + [com.badlogic.gdx.utils Align] + [com.badlogic.gdx.scenes.scene2d.utils NinePatchDrawable TextureRegionDrawable] [com.badlogic.gdx Application Audio Files Game Gdx Graphics Input InputMultiplexer InputProcessor Net Preferences Screen])) @@ -97,7 +98,7 @@ (utils/setup-viewport screen 1280 960) (log/info "Starting splash screen.") - (input! :set-cursor-image (utils/cursor "cursor.png" :hourglass) 0 0) + (graphics! :set-cursor (utils/cursor "cursor.png" :hourglass)) (let [screen (assoc screen :total-time 0) pop-anim (make-anim-seq "POPPixelLogo_02" [320 240] 0.05 (range 200)) diff --git a/desktop/src-common/advent/screens/title.clj b/desktop/src-common/advent/screens/title.clj index 389b2476..91f5a56f 100644 --- a/desktop/src-common/advent/screens/title.clj +++ b/desktop/src-common/advent/screens/title.clj @@ -26,7 +26,8 @@ [com.badlogic.gdx.scenes.scene2d.ui Slider$SliderStyle Widget ButtonGroup TextButton$TextButtonStyle CheckBox$CheckBoxStyle CheckBox Button] [com.badlogic.gdx.scenes.scene2d Group Actor] [play_clj.entities ActorEntity] - [com.badlogic.gdx.scenes.scene2d.utils Align NinePatchDrawable TextureRegionDrawable BaseDrawable] + [com.badlogic.gdx.utils Align] + [com.badlogic.gdx.scenes.scene2d.utils NinePatchDrawable TextureRegionDrawable BaseDrawable] [com.badlogic.gdx Application Audio Files Game Gdx Graphics Input InputMultiplexer InputProcessor Net Preferences Screen])) @@ -70,7 +71,7 @@ (defn quit [screen entities] (do (log/info "Quitting.") - (input! :set-cursor-image (utils/cursor "cursor.png" :hourglass) 0 0) + (graphics! :set-cursor (utils/cursor "cursor.png" :hourglass)) (-> entities (assoc-in [:tweens :fade-out] (tween/tween :fade-out screen [:fade :opacity] 0.0 1.0 1.0 @@ -116,7 +117,7 @@ (defn start-playing [screen entities save] (do (log/info "Starting/Continuing quest.") - (input! :set-cursor-image (utils/cursor "cursor.png" :hourglass) 0 0) + (graphics! :set-cursor (utils/cursor "cursor.png" :hourglass)) (-> entities (assoc-in [:tweens :fade-out] (tween/tween :fade-out screen [:fade :opacity] 0.0 1.0 1.0 @@ -133,7 +134,7 @@ (defn button-style [] (let [style (skin! (skin "ui/ui.json") :get TextButton$TextButtonStyle) tx (-> style .font .getRegion .getTexture)] - (-> style .font (.setScale 0.5 0.5)) + (call! ^Texture tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear) style)) @@ -161,7 +162,7 @@ (let [s (skin! (skin "ui/ui.json") :get CheckBox$CheckBoxStyle)] (-> s .font - (.setScale 0.25 0.25)) + ) (doto (merge (check-box msg s) (apply hash-map rest)) @@ -178,7 +179,6 @@ _ (nine-patch! p :set-padding 0 0 0 0) bg (drawable :nine-patch (:object p)) style (style :label font (or col (color 1.0 0.3 0.3 1.0))) - _ (bitmap-font! font :set-markup-enabled true) #_#__ (set! (.background style) bg)] (-> msg (label style) @@ -350,7 +350,7 @@ balloon (utils/make-anim "title/balloon.png" [15 30] 0.45 (range 4)) banner-back (utils/make-anim "title/banner-back.png" [180 42] 0.2 [0 1 2 1 0 1 2 1])] - (input! :set-cursor-image (utils/cursor "cursor.png" :hourglass) 0 0) + (graphics! :set-cursor (utils/cursor "cursor.png" :hourglass)) (let [entities {:background (assoc (utils/get-texture "title/background.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 0) :cloud-background (assoc (utils/get-texture "title/clouds.png" ) :x 0 :y 0 :scale-x 4 :scale-y 4 :origin-x 0 :origin-y 0 :z 2) @@ -408,7 +408,7 @@ :tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0 :finish #(do - (input! :set-cursor-image (utils/cursor "cursor.png" :main) 0 0) + (graphics! :set-cursor (utils/cursor "cursor.png" :main)) (utils/play-music (:music %)) %) :ease tween/ease-in-quadratic)}} ] diff --git a/desktop/src-common/advent/utils.clj b/desktop/src-common/advent/utils.clj index 3f18d0ff..6f95a253 100644 --- a/desktop/src-common/advent/utils.clj +++ b/desktop/src-common/advent/utils.clj @@ -56,7 +56,7 @@ (pixmap! resized :draw-pixmap base-cursor (* index 18) 0 16 16 0 0 target-width target-height) - resized )) + (graphics! :new-cursor resized 0 0))) (defn get-texture [path] (let [atlas-name (str/replace path #".png" "") @@ -153,7 +153,7 @@ (defn get-font [filename] (let [font (-> (bitmap-font filename) - (doto (bitmap-font! :set-scale 0.5 0.5))) + #_(doto (bitmap-font! :set-scale 0.5 0.5))) tr (bitmap-font! font :get-region) tx (.getTexture tr)] (call! ^Texture tx :set-filter Texture$TextureFilter/Linear Texture$TextureFilter/Linear) @@ -483,7 +483,7 @@ (do (log/info "Making windowed 1280x960 decorated window") (System/setProperty "org.lwjgl.opengl.Window.undecorated", "false") - (.setDisplayMode Gdx/graphics 1280 960 false))) + (.setWindowedMode Gdx/graphics 1280 960))) (defn is-fullscreen?-normal [] (.isFullscreen Gdx/graphics))