Made strings a bit better.

This commit is contained in:
2022-01-09 10:18:45 -08:00
parent d9281cffe2
commit 29215a3b6f
10 changed files with 59 additions and 53 deletions

View File

@@ -82,11 +82,16 @@ const compileC = (cFile) => {
}
// Generate strings
let dataStringH = '#pragma once\n#include "libs.h"\n';
let dataStringC = '#include "STRINGS.h"\n';
Object.entries(GAME_STRINGS).forEach(entry => {
const [ name, str ] = entry;
const { fileH, fileC } = string2gb(str, name, DIR_GENERATED);
compileC(fileC);
})
const { dataH, dataC } = string2gb(str, name);
dataStringH += dataH+'\n', dataStringC += dataC+'\n';
});
fs.writeFileSync(path.join(DIR_GENERATED, 'STRINGS.h'), dataStringH);
fs.writeFileSync(path.join(DIR_GENERATED, 'STRINGS.c'), dataStringC);
compileC(path.join(DIR_GENERATED, 'STRINGS.c'));
// Gen imagery
fs.readdirSync(DIR_IMAGES).forEach(img => {