-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
526153c
commit 95cd48b
Showing
54 changed files
with
5,487 additions
and
2,559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
/.ntvs_analysis.dat | ||
/.ntvs_analysis.dat.tmp | ||
/.idea/workspace.xml | ||
/*.js.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
// See http://go.microsoft.com/fwlink/?LinkId=733558 | ||
// for the documentation about the tasks.json format | ||
"version": "0.1.0", | ||
"command": "tsc", | ||
"isShellCommand": true, | ||
"args": ["-p", "."], | ||
"showOutput": "silent", | ||
"problemMatcher": "$tsc" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {Color} from './Color'; | ||
|
||
export class Asset { | ||
name: string; | ||
scale: number; | ||
background: Color; | ||
original_width: number; | ||
original_height: number; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export class Color { | ||
red: number; | ||
green: number; | ||
blue: number; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
"use strict"; | ||
|
||
import * as child_process from 'child_process'; | ||
import * as fs from 'fs'; | ||
import * as log from './log'; | ||
|
||
export function convert(inFilename: string, outFilename: string, encoder: string, args: Array<string> = null): Promise<boolean> { | ||
return new Promise((resolve, reject) => { | ||
if (fs.existsSync(outFilename.toString()) && fs.statSync(outFilename.toString()).mtime.getTime() > fs.statSync(inFilename.toString()).mtime.getTime()) { | ||
resolve(true); | ||
return; | ||
} | ||
|
||
if (!encoder) { | ||
resolve(false); | ||
return; | ||
} | ||
|
||
let dirend = Math.max(encoder.lastIndexOf('/'), encoder.lastIndexOf('\\')); | ||
let firstspace = encoder.indexOf(' ', dirend); | ||
let exe = encoder.substr(0, firstspace); | ||
let parts = encoder.substr(firstspace + 1).split(' '); | ||
let options = []; | ||
for (let i = 0; i < parts.length; ++i) { | ||
let foundarg = false; | ||
if (args !== null) { | ||
for (let arg in args) { | ||
if (parts[i] === '{' + arg + '}') { | ||
options.push(args[arg]); | ||
foundarg = true; | ||
break; | ||
} | ||
} | ||
} | ||
if (foundarg) continue; | ||
|
||
if (parts[i] === '{in}') options.push(inFilename.toString()); | ||
else if (parts[i] === '{out}') options.push(outFilename.toString()); | ||
else options.push(parts[i]); | ||
} | ||
|
||
let process = child_process.spawn(exe, options); | ||
process.on('close', (code) => { | ||
resolve(code === 0); | ||
}); | ||
}) | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"use strict"; | ||
|
||
import * as fs from 'fs-extra'; | ||
import * as path from 'path'; | ||
|
||
export class Exporter { | ||
out: number; | ||
|
||
constructor() { | ||
|
||
} | ||
|
||
writeFile(file: string) { | ||
this.out = fs.openSync(file, 'w'); | ||
} | ||
|
||
closeFile() { | ||
fs.closeSync(this.out); | ||
} | ||
|
||
p(line: string = '', indent: number = 0) { | ||
let tabs = ''; | ||
for (let i = 0; i < indent; ++i) tabs += '\t'; | ||
let data = new Buffer(tabs + line + '\n'); | ||
fs.writeSync(this.out, data, 0, data.length, null); | ||
} | ||
|
||
copyFile(from: string, to: string) { | ||
fs.copySync(from, to, { clobber: true }); | ||
} | ||
|
||
copyDirectory(from: string, to: string) { | ||
fs.copySync(from, to, { clobber: true }); | ||
} | ||
|
||
createDirectory(dir: string) { | ||
fs.ensureDirSync(dir); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use strict"; | ||
|
||
export var GraphicsApi = { | ||
OpenGL: 'opengl', | ||
OpenGL2: 'opengl2', | ||
Direct3D9: 'direct3d9', | ||
Direct3D11: 'direct3d11', | ||
Direct3D12: 'direct3d12', | ||
Metal: 'metal', | ||
Vulkan: 'vulkan' | ||
}; |
Oops, something went wrong.