many many bug fixes.

This commit is contained in:
Bryce Covert
2017-01-12 23:30:32 -08:00
parent d08bb503ac
commit 9369a2ea9c
16 changed files with 74 additions and 83 deletions

View File

@@ -1100,6 +1100,7 @@ void main ()
(.setUniformf shader "hue_amount" (float (or hue-amount 1.0))))
(.setColor batch (color (:r e 1.0) (:g e 1.0) (:b e 1.0) (:opacity e 1.0)))
(entities/draw! (assoc e :x (+ (/ ^double (:x e) (.zoom camera))
@@ -1111,14 +1112,15 @@ void main ()
(.setColor batch (color 1 1 1 1))
(.set (.combined camera) original-combined))))
(def nighttime-times #{:night :sunrise})
(def nighttime-times #{:night :dawn})
(defn get-rendered [entities {:keys [time ^double y ^double offset-y night-profile] :or {night-profile :default} :as e}]
(as-> e e
(if (and (not= time (-> entities :state :time))
(nighttime-times (-> entities :state :time)))
(-> e
(merge (-> entities :time-profiles night-profile))
(assoc :time (-> entities :state :time)))
(if (or (get-in entities [:tweens :dawn-r])
(and (not= time (-> entities :state :time))
(nighttime-times (-> entities :state :time))))
(-> e
(merge (-> entities :time-profiles night-profile))
(assoc :time (-> entities :state :time)))
e)
#_(if offset-y
(assoc e :y (+ y offset-y))
@@ -1131,7 +1133,8 @@ void main ()
(defn grab-layers [entities]
(update-in entities [:room]
(fn [{:keys [layers current-layers] :as room}]
(cond current-layers
(cond (and current-layers
(not (get-in entities [:tweens :dawn-r])))
room
(map? layers)
@@ -1173,7 +1176,7 @@ void main ()
(defscreen scene
:on-timer
(fn [screen entities options]
(when-let [timer-fn (get-in entities [:room :timers (:id screen) 2])]
(when-let [timer-fn (get-in entities [:room :timers (:id options) 2])]
(timer-fn screen entities)))
:on-show
@@ -1407,7 +1410,7 @@ void main ()
entities))
entities (grab-layers entities)
layers (get-in entities [:room :current-layers])
all-entities (concat layers (vals (get-in entities [:room :entities])))]
all-entities (concat layers (vals (get-in entities [:room :entities])) [(:white-fade entities)])]
(screen! fade-screen :update-fade {:opacity (get-in entities [:fade :opacity])})
(doseq [m (vals (get-in entities [:musics]))]
(when m
@@ -1471,7 +1474,7 @@ void main ()
rest)
(assoc-in entities [:room :entities] (persistent! room))))
layers (get-in entities [:room :current-layers])
all-entities (concat layers (vals (get-in entities [:room :entities])))]
all-entities (concat layers (vals (get-in entities [:room :entities])) [(:white-fade entities)])]
(screen! tooltip-screen :on-hover-start {:hover-text (get-in entities [:label :text])
:scene-viewport (:viewport screen)