Files
gitea-docker/desktop/src-common/advent/core.clj
2016-08-09 22:03:50 -07:00

47 lines
1.7 KiB
Clojure

(ns advent.core
(:require [play-clj.core :refer :all]
[play-clj.ui :refer :all]
[play-clj.utils :refer :all]
[play-clj.g2d :refer :all]
[advent.utils :as utils]
[advent.screens.scene :as scene]
[advent.screens.dialogue :as dialogue]
[clojure.tools.logging :as log]
[advent.screens.title :as title]
[advent.screens.splash :as splash]
[advent.screens.credits :as credits]
[advent.screens.inventory :as inventory]
[advent.screens.safe :as safe]
[advent.screens.fade :as fade]
[advent.steam :as steam]
[clojure.pprint]
[advent.pathfind])
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
[com.badlogic.gdx.graphics.g2d TextureRegion]
[com.badlogic.gdx Gdx Application]
[java.io FileOutputStream File PrintStream])
)
(defonce am (asset-manager))
(set-asset-manager! am)
(defgame advent
:on-create
(fn [this]
(log/log-capture! *ns* :warn :error)
(log/info "Starting game on version v" (advent.version/version))
(steam/init)
(set-screen! @(resolve 'advent.core/advent) splash/splash-screen)))
(defn reload []
(on-gl (set-screen! advent title/title-screen)))
(set-screen-wrapper! (fn [screen screen-fn]
(try (screen-fn)
(catch Exception e
(.log Gdx/app "ERROR" (with-out-str (.printStackTrace e)))
(log/error e (with-out-str (.printStackTrace e)))
(set-screen! advent title/title-screen)))))