A pixel art painter geared specifically at NES pixel art. Includes export for .chr binary file as well as palette and namespace data.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

42 Zeilen
1.1KB

  1. const package = require("./package.json");
  2. const exec = require('child_process').execSync;
  3. const fs = require("fs");
  4. const path = require("path");
  5. const express = require("express");
  6. const app = express();
  7. var port = 8000;
  8. function GenVersion(){
  9. var v = package.version;
  10. // Testing for a GIT repo.
  11. try{
  12. var res = exec("git rev-parse --abbrev-ref HEAD").toString();
  13. v += "-[" + res.trim();
  14. res = exec("git rev-parse HEAD").toString();
  15. v += ":" + res.substring(0, 5) + "]";
  16. } catch(e) {
  17. if (v !== package.version){
  18. v += "]"; // If v doesn't match package.version, then assume that the first git call worked.
  19. }
  20. }
  21. return v;
  22. }
  23. var version = GenVersion();
  24. app.set('views', path.join(__dirname, "/views"));
  25. app.engine('html', require('ejs').renderFile);
  26. app.set('view engine', 'html');
  27. app.use("/app", express.static(path.join(__dirname, "/app")));
  28. app.get('/', function(req, res){
  29. res.render('index.html', {version:version});
  30. });
  31. app.listen(port, () => {
  32. console.log("NESPaint (v" + version + ") listening on port " + port + "!");
  33. });