almost everything is functional again.

This commit is contained in:
Bryce Covert
2016-08-10 08:58:39 -07:00
parent 130d9e1b1f
commit ee59cbbbe8
6 changed files with 63 additions and 34 deletions

View File

@@ -895,7 +895,7 @@ void main ()
(let [t (double total-time)]
(rem t (animation! animation :get-animation-duration))))
(defn animate [{:keys [anim anim-loop? anim-merges anim-start] :or {anim-loop? true} :as entity} {:keys [delta-time total-time] :or {delta-time 0} :as screen}]
(defn animate [{:keys [anim anim-loop? anim-merges anim-start] :or {anim-loop? true anim-start 0} :as entity} {:keys [delta-time total-time] :or {delta-time 0} :as screen}]
(let [delta-time (double delta-time)
total-time (double total-time)
anim-start (double anim-start)
@@ -1754,8 +1754,9 @@ void main ()
(defscreen hud
:on-show
(fn [screen entities options]
(let [screen (assoc screen :total-time 0)]
(utils/setup-viewport screen 320 240)
(let [screen (assoc screen :total-time 0)
screen (utils/setup-viewport screen 320 240)]
{:inv-fsm {:state :none
:state-data {}
@@ -1788,7 +1789,8 @@ void main ()
:mouse-in? (zone/box 278 0 320 42)
:opacity 0.8)
:all-items (texture! (texture (pixmap "cursor.png")) :split 18 16)
#_#_:fps (assoc (label "" (color :white) ) :x 5 :baseline 0 :opacity 0.1)}))
:fps (->> (assoc (label "" (color :white) ) :x 5 :baseline 0 :opacity 0.1)
(utils/add-actor-to-stage screen))}))
:on-render
(fn [{:keys [^FitViewport viewport] :as screen} entities options]
@@ -1818,13 +1820,14 @@ void main ()
(grow-hud screen entities :save false)))
entities (or (process-fsm screen entities) entities)]
#_(label! (:fps entities) :set-text (str (game :fps)))
(label! (:fps entities) :set-text (str (game :fps)))
(render! screen [ (if (and hud-interactable? (not (:already-saved? entities)))
(:save entities)
(assoc (:save entities) :opacity 0.5))
(:fps entities)
(if hud-interactable?
(:inventory entities)
(assoc (:inventory entities) :opacity 0.5))
@@ -1869,7 +1872,6 @@ void main ()
:on-start-script
(fn [_ entities _]
(println "here")
(-> entities
(update-in [:inv-fsm :pending-states] conj [:none nil])
(assoc-in [:already-saved?] false)))