File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,10 +23,13 @@ var CreateRenderer = function (game)
2323{
2424 var config = game . config ;
2525
26- // Game either requested Canvas,
27- // or requested AUTO or WEBGL but the browser doesn't support it, so fall back to Canvas
26+ if ( ( config . customEnvironment || config . canvas ) && config . renderType === CONST . AUTO )
27+ {
28+ throw new Error ( 'Must set explicit renderType in custom environment' ) ;
29+ }
2830
29- if ( ( config . customEnvironment || config . canvas ) && config . renderType !== CONST . HEADLESS )
31+ // Not a custom environment, didn't provide their own canvas and not headless, so determine the renderer:
32+ if ( ! config . customEnvironment && ! config . canvas && config . renderType !== CONST . HEADLESS )
3033 {
3134 if ( config . renderType === CONST . CANVAS || ( config . renderType !== CONST . CANVAS && ! Features . webGL ) )
3235 {
@@ -47,11 +50,6 @@ var CreateRenderer = function (game)
4750 }
4851 }
4952
50- if ( config . customEnvironment && config . renderType === CONST . AUTO )
51- {
52- throw new Error ( 'Must set renderType in custom environment' ) ;
53- }
54-
5553 // Pixel Art mode?
5654 if ( ! config . antialias )
5755 {
You can’t perform that action at this time.
0 commit comments