mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 21:55:52 +02:00
Fix sprite compiler
This commit is contained in:
+2
-2
@@ -127,7 +127,7 @@ const changelog = cb => {
|
||||
.map(x => x.replace(/^\[test\]/, '<span class="badge badge-secondary">test</span>')),
|
||||
}));
|
||||
const type = `{ version: string; changes: string[]; }[]`;
|
||||
const code = `/* eslint:disable */\n\nexport const CHANGELOG: ${type} = ${JSON.stringify(object, null, 2)};\n`;
|
||||
const code = `/* eslint-disable */\n\nexport const CHANGELOG: ${type} = ${JSON.stringify(object, null, 2)};\n`;
|
||||
fs.writeFile('src/ts/generated/changelog.ts', code, 'utf8', cb);
|
||||
};
|
||||
|
||||
@@ -180,7 +180,7 @@ const shaders = cb => {
|
||||
}
|
||||
|
||||
const dir = path.join('src', 'ts', 'graphics', 'shaders');
|
||||
const code = '/* eslint:disable */\n\n' + fs.readdirSync(dir)
|
||||
const code = '/* eslint-disable */\n\n' + fs.readdirSync(dir)
|
||||
.map(file => [_.camelCase(file.replace(/\.glsl$/, '')), path.join(dir, file)])
|
||||
.map(([name, filePath]) => `export const ${name}Shader = \`${getShaderCode(filePath)}\`;`)
|
||||
.join('\n\n');
|
||||
|
||||
@@ -984,7 +984,7 @@ function createSpritesTS(dest: string, config: SpriteTSConfig) {
|
||||
const { objects, objects2 } = config.result;
|
||||
|
||||
let ts = fs.readFileSync(path.join(rootPath, 'src', 'ts', 'tools', 'sprites-template.ts'), 'utf8');
|
||||
ts = ts.replace(/export \{[\s\S]*?\};\r?\n?/, '');
|
||||
//ts = ts.replace(/export \{[\s\S]*?\};\r?\n?/, '');
|
||||
ts = ts.replace('/*SPRITE_SHEET*/', `images/${config.spriteFileName}`);
|
||||
ts = ts.replace('/*SPRITE_SHEET_PALETTE*/', `images/${config.paletteFileName}`);
|
||||
ts = ts.replace('/*SPRITE_SHEET_PALETTE_ALPHA*/', `images/${config.paletteAlphaFileName}`);
|
||||
|
||||
Reference in New Issue
Block a user