Skip to content

Commit

Permalink
Show warning if the orthographic render script isn't used
Browse files Browse the repository at this point in the history
  • Loading branch information
britzl committed Jul 27, 2020
1 parent 7700738 commit 9d12208
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions orthographic/camera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

local M = {}

M.ORTHOGRAPHIC_RENDER_SCRIPT_USED = false

M.MSG_ENABLE = hash("enable")
M.MSG_DISABLE = hash("disable")
M.MSG_UNFOLLOW = hash("unfollow")
Expand Down Expand Up @@ -239,6 +241,10 @@ function M.init(camera_id, camera_script_url, settings)
if not sys.get_engine_info().is_debug then
log = function() end
end

if not M.ORTHOGRAPHIC_RENDER_SCRIPT_USED then
log("WARNING: orthographic.render_script not used. Did you forget to change render file in game.project?")
end
end

--- Finalize a camera
Expand Down
2 changes: 2 additions & 0 deletions orthographic/render/orthographic.render_script
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
local render_helper = require "orthographic.render.helper"
local camera = require "orthographic.camera"

camera.ORTHOGRAPHIC_RENDER_SCRIPT_USED = true

local CLEAR_COLOR = hash("clear_color")

function init(self)
Expand Down

0 comments on commit 9d12208

Please sign in to comment.