oxygen-core
Version:
Oxygen game engine (Xenon Core for browsers)
1,447 lines (1,446 loc) • 210 kB
JSON
{
"type": "File",
"start": 0,
"end": 1143,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 50,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 1143,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 50,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 30,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 30
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 13
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 13,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 13
},
"identifierName": "Sprite"
},
"name": "Sprite"
}
}
],
"source": {
"type": "StringLiteral",
"start": 19,
"end": 29,
"loc": {
"start": {
"line": 1,
"column": 19
},
"end": {
"line": 1,
"column": 29
}
},
"extra": {
"rawValue": "./Sprite",
"raw": "'./Sprite'"
},
"value": "./Sprite"
}
},
{
"type": "ImportDeclaration",
"start": 32,
"end": 94,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 62
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 41,
"end": 60,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 28
}
},
"imported": {
"type": "Identifier",
"start": 41,
"end": 60,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 28
},
"identifierName": "RenderTargetWrapper"
},
"name": "RenderTargetWrapper"
},
"local": {
"type": "Identifier",
"start": 41,
"end": 60,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 28
},
"identifierName": "RenderTargetWrapper"
},
"name": "RenderTargetWrapper"
}
}
],
"source": {
"type": "StringLiteral",
"start": 68,
"end": 93,
"loc": {
"start": {
"line": 2,
"column": 36
},
"end": {
"line": 2,
"column": 61
}
},
"extra": {
"rawValue": "../systems/RenderSystem",
"raw": "'../systems/RenderSystem'"
},
"value": "../systems/RenderSystem"
}
},
{
"type": "ExportDefaultDeclaration",
"start": 98,
"end": 1141,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 49,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 113,
"end": 1141,
"loc": {
"start": {
"line": 4,
"column": 15
},
"end": {
"line": 49,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 119,
"end": 128,
"loc": {
"start": {
"line": 4,
"column": 21
},
"end": {
"line": 4,
"column": 30
},
"identifierName": "Container"
},
"name": "Container"
},
"superClass": {
"type": "Identifier",
"start": 137,
"end": 143,
"loc": {
"start": {
"line": 4,
"column": 39
},
"end": {
"line": 4,
"column": 45
},
"identifierName": "Sprite"
},
"name": "Sprite"
},
"body": {
"type": "ClassBody",
"start": 144,
"end": 1141,
"loc": {
"start": {
"line": 4,
"column": 46
},
"end": {
"line": 49,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 151,
"end": 203,
"loc": {
"start": {
"line": 6,
"column": 2
},
"end": {
"line": 8,
"column": 3
}
},
"static": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 158,
"end": 165,
"loc": {
"start": {
"line": 6,
"column": 9
},
"end": {
"line": 6,
"column": 16
},
"identifierName": "factory"
},
"name": "factory"
},
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 168,
"end": 203,
"loc": {
"start": {
"line": 6,
"column": 19
},
"end": {
"line": 8,
"column": 3
}
},
"body": [
{
"type": "ReturnStatement",
"start": 175,
"end": 198,
"loc": {
"start": {
"line": 7,
"column": 4
},
"end": {
"line": 7,
"column": 27
}
},
"argument": {
"type": "NewExpression",
"start": 182,
"end": 197,
"loc": {
"start": {
"line": 7,
"column": 11
},
"end": {
"line": 7,
"column": 26
}
},
"callee": {
"type": "Identifier",
"start": 186,
"end": 195,
"loc": {
"start": {
"line": 7,
"column": 15
},
"end": {
"line": 7,
"column": 24
},
"identifierName": "Container"
},
"name": "Container"
},
"arguments": []
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 209,
"end": 271,
"loc": {
"start": {
"line": 10,
"column": 2
},
"end": {
"line": 12,
"column": 3
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 213,
"end": 227,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 20
},
"identifierName": "renderTargetId"
},
"name": "renderTargetId"
},
"kind": "get",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 230,
"end": 271,
"loc": {
"start": {
"line": 10,
"column": 23
},
"end": {
"line": 12,
"column": 3
}
},
"body": [
{
"type": "ReturnStatement",
"start": 237,
"end": 266,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 11,
"column": 33
}
},
"argument": {
"type": "MemberExpression",
"start": 244,
"end": 265,
"loc": {
"start": {
"line": 11,
"column": 11
},
"end": {
"line": 11,
"column": 32
}
},
"object": {
"type": "MemberExpression",
"start": 244,
"end": 262,
"loc": {
"start": {
"line": 11,
"column": 11
},
"end": {
"line": 11,
"column": 29
}
},
"object": {
"type": "ThisExpression",
"start": 244,
"end": 248,
"loc": {
"start": {
"line": 11,
"column": 11
},
"end": {
"line": 11,
"column": 15
}
}
},
"property": {
"type": "Identifier",
"start": 249,
"end": 262,
"loc": {
"start": {
"line": 11,
"column": 16
},
"end": {
"line": 11,
"column": 29
},
"identifierName": "_renderTarget"
},
"name": "_renderTarget"
},
"computed": false
},
"property": {
"type": "Identifier",
"start": 263,
"end": 265,
"loc": {
"start": {
"line": 11,
"column": 30
},
"end": {
"line": 11,
"column": 32
},
"identifierName": "id"
},
"name": "id"
},
"computed": false
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 277,
"end": 444,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 20,
"column": 3
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 277,
"end": 288,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 14,
"column": 13
},
"identifierName": "constructor"
},
"name": "constructor"
},
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 291,
"end": 444,
"loc": {
"start": {
"line": 14,
"column": 16
},
"end": {
"line": 20,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 298,
"end": 306,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 12
}
},
"expression": {
"type": "CallExpression",
"start": 298,
"end": 305,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 11
}
},
"callee": {
"type": "Super",
"start": 298,
"end": 303,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 9
}
}
},
"arguments": []
}
},
{
"type": "VariableDeclaration",
"start": 314,
"end": 372,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 62
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 320,
"end": 371,
"loc": {
"start": {
"line": 17,
"column": 10
},
"end": {
"line": 17,
"column": 61
}
},
"id": {
"type": "Identifier",
"start": 320,
"end": 322,
"loc": {
"start": {
"line": 17,
"column": 10
},
"end": {
"line": 17,
"column": 12
},
"identifierName": "rt"
},
"name": "rt"
},
"init": {
"type": "AssignmentExpression",
"start": 325,
"end": 371,
"loc": {
"start": {
"line": 17,
"column": 15
},
"end": {
"line": 17,
"column": 61
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 325,
"end": 343,
"loc": {
"start": {
"line": 17,
"column": 15
},
"end": {
"line": 17,
"column": 33
}
},
"object": {
"type": "ThisExpression",
"start": 325,
"end": 329,
"loc": {
"start": {
"line": 17,
"column": 15
},
"end": {
"line": 17,
"column": 19
}
}
},
"property": {
"type": "Identifier",
"start": 330,
"end": 343,
"loc": {
"start": {
"line": 17,
"column": 20
},
"end": {
"line": 17,
"column": 33
},
"identifierName": "_renderTarget"
},
"name": "_renderTarget"
},
"computed": false
},
"right": {
"type": "NewExpression",
"start": 346,
"end": 371,
"loc": {
"start": {
"line": 17,
"column": 36
},
"end": {
"line": 17,
"column": 61
}
},
"callee": {
"type": "Identifier",
"start": 350,
"end": 369,
"loc": {
"start": {
"line": 17,
"column": 40
},
"end": {
"line": 17,
"column": 59
},
"identifierName": "RenderTargetWrapper"
},
"name": "RenderTargetWrapper"
},
"arguments": []
}
}
}
],
"kind": "const"
},
{
"type": "ExpressionStatement",
"start": 378,
"end": 400,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 26
}
},
"expression": {
"type": "AssignmentExpression",
"start": 378,
"end": 399,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 25
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 378,
"end": 392,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 18
}
},
"object": {
"type": "Identifier",
"start": 378,
"end": 380,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 6
},
"identifierName": "rt"
},
"name": "rt"
},
"property": {
"type": "Identifier",
"start": 381,
"end": 392,
"loc": {
"start": {
"line": 18,
"column": 7
},
"end": {
"line": 18,
"column": 18
},
"identifierName": "pushPopMode"
},
"name": "pushPopMode"
},
"computed": false
},
"right": {
"type": "BooleanLiteral",
"start": 395,
"end": 399,
"loc": {
"start": {
"line": 18,
"column": 21
},
"end": {
"line": 18,
"column": 25
}
},
"value": true
}
}
},
{
"type": "ExpressionStatement",
"start": 406,
"end": 439,
"loc": {
"start": {
"line": 19,
"column": 4
},
"end": {
"line": 19,
"column": 37
}
},
"expression": {
"type": "AssignmentExpression",
"start": 406,
"end": 438,
"loc": {
"start": {
"line": 19,
"column": 4
},
"end": {
"line": 19,
"column": 36
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 406,
"end": 430,
"loc": {
"start": {
"line": 19,
"column": 4
},
"end": {
"line": 19,
"column": 28
}
},
"object": {
"type": "ThisExpression",
"start": 406,
"end": 410,
"loc": {
"start": {
"line": 19,
"column": 4
},
"end": {
"line": 19,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 411,
"end": 430,
"loc": {
"start": {
"line": 19,
"column": 9
},
"end": {
"line": 19,
"column": 28
},
"identifierName": "overrideBaseTexture"
},
"name": "overrideBaseTexture"
},
"computed": false
},
"right": {
"type": "MemberExpression",
"start": 433,
"end": 438,
"loc": {
"start": {
"line": 19,
"column": 31
},
"end": {
"line": 19,
"column": 36
}
},
"object": {
"type": "Identifier",
"start": 433,
"end": 435,
"loc": {
"start": {
"line": 19,
"column": 31
},
"end": {
"line": 19,
"column": 33
},
"identifierName": "rt"
},
"name": "rt"
},
"property": {
"type": "Identifier",
"start": 436,
"end": 438,
"loc": {
"start": {
"line": 19,
"column": 34
},
"end": {
"line": 19,
"column": 36
},
"identifierName": "id"
},
"name": "id"
},
"computed": false
}
}
}
],
"directives": []
}
},
{
"type": "ClassMethod",
"start": 450,
"end": 627,
"loc": {
"start": {
"line": 22,
"column": 2
},
"end": {
"line": 31,
"column": 3
}
},
"static": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 450,
"end": 457,
"loc": {
"start": {
"line": 22,
"column": 2
},
"end": {
"line": 22,
"column": 9
},
"identifierName": "dispose"
},
"name": "dispose"
},
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [],
"body": {
"type": "BlockStatement",
"start": 460,
"end": 627,
"loc": {
"start": {
"line": 22,
"column": 12
},
"end": {
"line": 31,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 467,
"end": 483,
"loc": {
"start": {
"line": 23,
"column": 4
},
"end": {
"line": 23,
"column": 20
}
},
"expression": {
"type": "CallExpression",
"start": 467,
"end": 482,
"loc": {
"start": {
"line": 23,
"column": 4
},
"end": {
"line": 23,
"column": 19
}
},
"callee": {
"type": "MemberExpression",
"start": 467,
"end": 480,
"loc": {
"start": {
"line": 23,
"column": 4
},
"end": {
"line": 23,
"column": 17
}
},
"object": {
"type": "Super",
"start": 467,
"end": 472,
"loc": {
"start": {
"line": 23,
"column": 4
},
"end": {
"line": 23,
"column": 9
}
}
},
"property": {
"type": "Identifier",
"start": 473,
"end": 480,
"loc": {
"start": {
"line": 23,
"column": 10
},
"end": {
"line": 23,
"column": 17
},
"identifierName": "dispose"
},
"name": "dispose"
},
"computed": false
},
"arguments": []
}
},
{
"type": "VariableDeclaration",
"start": 491,
"end": 522,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 25,
"column": 35
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 497,
"end": 521,
"loc": {
"start": {
"line": 25,
"column": 10
},
"end": {
"line": 25,
"column": 34
}
},
"id": {
"type": "ObjectPattern",
"start": 497,
"end": 514,
"loc": {
"start": {
"line": 25,
"column": 10
},
"end": {
"line": 25,
"column": 27
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 499,
"end": 512,
"loc": {
"start": {
"line": 25,
"column": 12
},
"end": {
"line": 25,
"column": 25
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 499,
"end": 512,
"loc": {
"start": {
"line": 25,
"column": 12
},
"end": {
"line": 25,
"column": 25
},
"identifierName": "_renderTarget"
},
"name": "_renderTarget"
},
"value": {
"type": "Identifier",
"start": 499,
"end": 512,
"loc": {
"start": {
"line": 25,
"column": 12
},
"end": {
"line": 25,
"column": 25
},
"identifierName": "_renderTarget"
},
"name": "_renderTarget"
},
"extra": {
"shorthand": true
}
}
]
},
"init": {
"type": "ThisExpression",
"start": 517,
"end": 521,
"loc": {
"start": {
"line": 25,
"column": 30
},
"end": {
"line": 25,
"column": 34
}
}
}
}
],
"kind": "const"
},
{
"type": "IfStatement",
"start": 528,
"end": 588,
"loc": {
"start": {
"line": 26,
"column": 4
},
"end": {
"line": 28,
"column": 5
}
},
"test": {
"type": "UnaryExpression",
"start": 532,
"end": 547,
"loc": {
"start": {
"line": 26,
"column": 8
},
"end": {
"line": 26,
"column": 23
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "UnaryExpression",
"start": 533,
"end": 547,
"loc": {
"start": {
"line": 26,
"column": 9
},
"end": {
"line": 26,
"column": 23
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 534,
"end": 547,
"loc": {
"start": {
"line": 26,
"column": 10
},
"end": {
"line": 26,
"column": 23
},
"identifierName": "_renderTarget"
},
"name": "_renderTarget"
},
"extra": {
"parenthesizedArgument": false
}
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "BlockStatement",
"start": 549,
"end": 588,
"loc": {
"start": {
"line": 26,
"column": 25
},
"end": {
"line": 28,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 558,
"end": 581,
"loc": {
"start": {
"line": 27,
"column": 6
},
"end": {
"line": 27,
"column": 29
}
},
"expression": {
"type": "CallExpression",
"start": 558,
"end": 580,
"loc": {
"start": {
"line": 27,
"column": 6
},
"end": {
"line": 27,
"column": 28
}
},
"callee": {
"type": "MemberExpression",
"start": 558,
"end": 578,
"loc": {
"start": {
"line": 27,
"column": 6
},
"end": {
"line": 27,
"column": 26
}
},
"object": {
"type": "Identifier",
"start": 558,
"end": 571,
"loc": {
"start": {
"line": 27,
"column": 6
},
"end": {
"line": 27,
"column": 19
},
"identifierName": "_renderTarget"
},
"name": "_renderTarget"
},
"property": {
"type": "Identifier",
"start": 572,
"end": 578,
"loc": {
"start": {
"line": 27,
"column": 20
},
"end": {
"line": 27,
"column": 26
},
"identifierName": "dipose"
},
"name": "dipose"
},
"computed": false
},
"arguments": []
}
}
],
"directives": []
},
"alternate": null
},
{
"type": "ExpressionStatement",
"start": 596,
"end": 622,
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 30,
"column": 30
}
},
"expression": {
"type": "AssignmentExpression",
"start": 596,
"end": 621,
"loc": {
"start": {
"line": 30,
"column": 4