Skip to content

Error improvement when call Assets.loadEverything before System.start #1466

Description

@RblSb

Currently this mistake is complicated to debug, because:

  • Loading callback if fired without problems
  • Rendering without resources is fine
  • g2.drawImage fails with:
Error: Cannot cast {
	g2canvas : null, 
	myWidth : 240, 
	myHeight : 160, 
	myFormat : 0, 
	renderTarget : false, 
	image : [object HTMLImageElement], 
	video : null
} to {
	__name__ : true, 
	init : <function>, 
	formatByteSize : <function>
}

And endless Error: End before you begin spam.

We can throw this problem at step 1 if do not ignore null in SystemImpl.gl here 10 years ago:

public function createTexture() {
if (SystemImpl.gl == null)
return;

Or maybe even earlier someway.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions