This is performing much better.
This commit is contained in:
21
desktop/build.boot
Normal file
21
desktop/build.boot
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
(set-env! :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.6-BRYCE"]
|
||||||
|
[log4j/log4j "1.2.16"]
|
||||||
|
[org.clojure/data.priority-map "0.0.5"]
|
||||||
|
[org.clojure/core.async "0.2.385"]
|
||||||
|
[org.clojure/tools.logging "0.3.1"]
|
||||||
|
[org.im4java/im4java "1.4.0"]]
|
||||||
|
:resource-paths #{"resources/"})
|
||||||
|
|
||||||
|
(task-options! pom {:project 'advent
|
||||||
|
:version (str "2.0." (clojure.string/trim-newline (slurp "last-release")))}
|
||||||
|
aot {:namespace '#{advent.core}}
|
||||||
|
jar {:main 'advent.core.desktop-launcher
|
||||||
|
:file "advent-standalone.jar"})
|
||||||
|
|
||||||
|
(deftask build
|
||||||
|
[]
|
||||||
|
(comp (aot) (pom) (uber) (jar) (install)))
|
||||||
@@ -880,14 +880,14 @@
|
|||||||
(assoc (:state selected-save) :active? true)
|
(assoc (:state selected-save) :active? true)
|
||||||
{:object nil
|
{:object nil
|
||||||
:active? true
|
:active? true
|
||||||
:last-room :outside-house
|
:last-room :dream
|
||||||
:time :night
|
:time :day
|
||||||
:obtained-items #{}
|
:obtained-items #{}
|
||||||
:inventory []
|
:inventory []
|
||||||
:plaques-read #{}
|
:plaques-read #{}
|
||||||
:clues #{}
|
:clues #{}
|
||||||
:mints-eaten 0
|
:mints-eaten 0
|
||||||
:seen-intro? true}))
|
:seen-intro? false}))
|
||||||
|
|
||||||
(defn fade-in-first-time-if-necessary [screen entities]
|
(defn fade-in-first-time-if-necessary [screen entities]
|
||||||
(if (not (get-in entities [:started? :value]))
|
(if (not (get-in entities [:started? :value]))
|
||||||
|
|||||||
76
desktop/src-common/advent/screens/shader.clj
Normal file
76
desktop/src-common/advent/screens/shader.clj
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
(ns advent.screens.shader)
|
||||||
|
|
||||||
|
(def v-shader "attribute vec4 a_position;
|
||||||
|
attribute vec4 a_color;
|
||||||
|
attribute vec2 a_texCoord0;
|
||||||
|
|
||||||
|
uniform mat4 u_projTrans;
|
||||||
|
|
||||||
|
varying vec4 v_color;
|
||||||
|
varying vec2 v_texCoords;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
v_color = a_color;
|
||||||
|
v_texCoords = a_texCoord0;
|
||||||
|
gl_Position = u_projTrans * a_position;
|
||||||
|
}")
|
||||||
|
|
||||||
|
|
||||||
|
(def pix-shader "
|
||||||
|
#ifdef GL_ES
|
||||||
|
#define LOWP lowp
|
||||||
|
#define HIGHP highp
|
||||||
|
precision mediump float;
|
||||||
|
#else
|
||||||
|
#define LOWP
|
||||||
|
#define HIGHP
|
||||||
|
#endif
|
||||||
|
|
||||||
|
varying vec4 v_color;
|
||||||
|
varying HIGHP vec2 v_texCoords;
|
||||||
|
uniform HIGHP float multiply_amount;
|
||||||
|
uniform HIGHP float hue_amount;
|
||||||
|
|
||||||
|
uniform sampler2D u_texture;
|
||||||
|
|
||||||
|
vec4 toGrayscale(in vec4 color)
|
||||||
|
{
|
||||||
|
float average = (color.r + color.g + color.b) / 3.0;
|
||||||
|
return vec4(average, average, average, color.a);
|
||||||
|
}
|
||||||
|
|
||||||
|
vec4 colorize(in vec4 grayscale, in vec4 color)
|
||||||
|
{
|
||||||
|
return (grayscale * color);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void main ()
|
||||||
|
{
|
||||||
|
HIGHP vec2 sz = vec2 (2048.0, 2048.0);
|
||||||
|
HIGHP vec3 step = vec3 (1.0 / 4.0, 1.0 / 4.0, 0.0);
|
||||||
|
HIGHP vec2 tex_pixel = sz * v_texCoords - step.xy / 2.0;
|
||||||
|
|
||||||
|
HIGHP vec2 corner = floor (tex_pixel) + 1.0;
|
||||||
|
HIGHP vec2 frac = min ((corner - tex_pixel) * vec2 (4.0, 4.0), vec2 (1.0, 1.0));
|
||||||
|
|
||||||
|
HIGHP vec4 c1 = texture2D (u_texture, (floor (tex_pixel + step.zz) + 0.5) / sz);
|
||||||
|
HIGHP vec4 c2 = texture2D (u_texture, (floor (tex_pixel + step.xz) + 0.5) / sz);
|
||||||
|
HIGHP vec4 c3 = texture2D (u_texture, (floor (tex_pixel + step.zy) + 0.5) / sz);
|
||||||
|
HIGHP vec4 c4 = texture2D (u_texture, (floor (tex_pixel + step.xy) + 0.5) / sz);
|
||||||
|
|
||||||
|
c1 *= frac.x * frac.y;
|
||||||
|
c2 *= (1.0 - frac.x) * frac.y;
|
||||||
|
c3 *= frac.x * (1.0 - frac.y);
|
||||||
|
c4 *= (1.0 - frac.x) * (1.0 - frac.y);
|
||||||
|
vec4 scaledColor = (c1 + c2 + c3 + c4);
|
||||||
|
|
||||||
|
vec4 grayscale = toGrayscale(scaledColor);
|
||||||
|
vec4 colorizedOutput = mix(scaledColor, colorize(grayscale, v_color.rgba), hue_amount);
|
||||||
|
|
||||||
|
vec4 multiplied = mix(colorizedOutput.rgba, v_color.rgba * scaledColor.rgba, multiply_amount);
|
||||||
|
|
||||||
|
gl_FragColor = vec4(multiplied.rgb, scaledColor.a * v_color.a);
|
||||||
|
|
||||||
|
}
|
||||||
|
")
|
||||||
@@ -509,8 +509,8 @@
|
|||||||
:else
|
:else
|
||||||
(assoc-in entities [:cursor :override] :main))))
|
(assoc-in entities [:cursor :override] :main))))
|
||||||
|
|
||||||
(def default-night-merge {:r 0.08 :g 0.1 :b 0.36 :multiply-amount 1.0 :hue-amount 1.0})
|
(def default-night-merge {:r 0.13 :g 0.16 :b 0.61 :multiply-amount 0.5 :hue-amount 0.75})
|
||||||
(def default-night-merge-sprite {:r 0.08 :g 0.1 :b 0.36 :multiply-amount 0.3 :hue-amount 0.4})
|
(def default-night-merge-sprite {:r 0.13 :g 0.16 :b 0.61 :multiply-amount 0.1 :hue-amount 0.35})
|
||||||
|
|
||||||
(defn clamp-volume [vol]
|
(defn clamp-volume [vol]
|
||||||
(max vol 0.005))
|
(max vol 0.005))
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>74</string>
|
<string>83</string>
|
||||||
<key>MinimumOSVersion</key>
|
<key>MinimumOSVersion</key>
|
||||||
<string>8.0</string>
|
<string>8.0</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
|||||||
Reference in New Issue
Block a user