Fix bug by setting default camera configuration before initialization
Set default width and height if none are provided in config.js. This prevents camera initialization errors when the values are missing.
This commit is contained in:
@@ -6,7 +6,31 @@ var controller = use('controller')
|
||||
var tracy = use('tracy')
|
||||
var graphics = use('graphics')
|
||||
|
||||
var default_conf = {
|
||||
title:`Prosperon [${prosperon.version}-${prosperon.revision}]`,
|
||||
width: 1280,
|
||||
height: 720,
|
||||
icon: graphics.make_texture(io.slurpbytes('icons/moon.gif')),
|
||||
high_dpi:0,
|
||||
alpha:1,
|
||||
fullscreen:0,
|
||||
sample_count:1,
|
||||
enable_clipboard:true,
|
||||
enable_dragndrop: true,
|
||||
max_dropped_files: 1,
|
||||
swap_interval: 1,
|
||||
name: "Prosperon",
|
||||
version:prosperon.version + "-" + prosperon.revision,
|
||||
identifier: "world.pockle.prosperon",
|
||||
creator: "Pockle World LLC",
|
||||
copyright: "Copyright Pockle World 2025",
|
||||
type: "application",
|
||||
url: "https://github.com/johnbrethauer/prosperon"
|
||||
}
|
||||
|
||||
var config = use('config.js')
|
||||
config.__proto__ = default_conf
|
||||
|
||||
prosperon.camera = use('camera').make()
|
||||
prosperon.camera.size = [config.width,config.height]
|
||||
|
||||
@@ -92,29 +116,8 @@ appy.inputs["M-f4"] = os.exit;
|
||||
|
||||
controller.player[0].control(appy);
|
||||
|
||||
var default_conf = {
|
||||
title:`Prosperon [${prosperon.version}-${prosperon.revision}]`,
|
||||
width: 1280,
|
||||
height: 720,
|
||||
icon: graphics.make_texture(io.slurpbytes('icons/moon.gif')),
|
||||
high_dpi:0,
|
||||
alpha:1,
|
||||
fullscreen:0,
|
||||
sample_count:1,
|
||||
enable_clipboard:true,
|
||||
enable_dragndrop: true,
|
||||
max_dropped_files: 1,
|
||||
swap_interval: 1,
|
||||
name: "Prosperon",
|
||||
version:prosperon.version + "-" + prosperon.revision,
|
||||
identifier: "world.pockle.prosperon",
|
||||
creator: "Pockle World LLC",
|
||||
copyright: "Copyright Pockle World 2025",
|
||||
type: "application",
|
||||
url: "https://github.com/johnbrethauer/prosperon"
|
||||
}
|
||||
|
||||
config.__proto__ = default_conf
|
||||
|
||||
|
||||
prosperon.window = prosperon.engine_start(config);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user