Skip to content

Commit

Permalink
erm codename engine is cool!
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackx2 committed Nov 15, 2024
1 parent 659f59f commit 8efd4b2
Show file tree
Hide file tree
Showing 100 changed files with 367 additions and 107,469 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# Auto detect text files and perform LF normalization
* text=auto

*.hxs linguist-language=Haxe
*.hsc linguist-language=Haxe
*.hscript linguist-language=Haxe
11 changes: 4 additions & 7 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@ jobs:
with:
haxe-version: 4.3.4
# Runs a set of commands using the runners shell
- name: Install Haxelib
- name: Installing LibVLC
run: |
sudo apt-get install libvlc-dev
sudo apt-get install libvlccore-dev
haxelib setup ~/haxelib
haxelib install hxcpp > /dev/null --quiet
chmod +x ./setup/unix.sh
sh ./setup/unix.sh
sudo apt-get install libvlc-dev libvlccore-dev
- name: Installing/Updating libraries
run: haxe -cp commandline -D analyzer-optimize --run Main setup -s
- name: Skip SScript setup mode
run: echo 'oy9:showMacroty8:loopCosti25y10:includeAllfg' >> ~/settings.cocoa
- name: Create Version Tag
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,9 @@ jobs:
- uses: krdlab/setup-haxe@master
with:
haxe-version: 4.3.4
- name: Install Haxelib
- name: Installing/Updating libraries
run: |
haxelib setup ~/haxelib
haxelib install hxcpp > /dev/null --quiet
chmod +x ./setup/unix.sh
sh ./setup/unix.sh
haxe -cp commandline -D analyzer-optimize --run Main setup -s
- name: Skip SScript setup mode
run: echo 'oy9:showMacroty8:loopCosti25y10:includeAllfg' >> ~/settings.cocoa
- name: Create Version Tag
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ jobs:
- uses: krdlab/setup-haxe@master
with:
haxe-version: 4.3.4
- name: Install Haxelib
- name: Installing/Updating libraries
run: |
haxelib setup C:/haxelib
haxelib install hxcpp > /dev/null --quiet
.\"setup/windows.bat"
haxe -cp commandline -D analyzer-optimize --run Main setup -s
shell: cmd
- name: Skip SScript setup mode
run: echo 'oy9:showMacroty8:loopCosti25y10:includeAllfg' >> ~/settings.cocoa
Expand Down
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### Super Stupid LOL!
### ! means a file should be added regardless of it it gets ignored prior.

### Haxe
export/*
dump/*
Expand All @@ -6,11 +9,12 @@ dump/*
.vscode/*
.haxelib/
*.code-workspace
# Local history which shouldn't be shared.

### Local history which shouldn't be shared.
.history
.ionide
# ! means a file should be added regardless of it it gets ignored prior.
# Including to allow others to use already set-up configuration tweaked for the project.

### Including to allow others to use already set-up configuration tweaked for the project.
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
Expand Down
2 changes: 1 addition & 1 deletion Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<!-- Hxvlc -->
<haxelib name="hxvlc" if="VIDEOS_ALLOWED"/>
<!-- FlxAnimate -->
<haxelib name="flxanimate" path="./libs/flxanimate" if="FLXANIMATE_ALLOWED"/>
<haxelib name="flxanimate" if="FLXANIMATE_ALLOWED"/>
<!-- Discord API -->
<haxelib name="hxdiscord_rpc" if="DISCORD_ALLOWED"/>
<!-- Debug Sever -->
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img src="art/astro/512-modified.png" width="250" height="250"/>
<img src="art/branding/512xSmoothed.png" width="250" height="250"/>
<br>
<h1>Friday Night Funkin' • <code>Astro Engine</code> (<strong>Beta</strong>)</h1>
<br>
Expand All @@ -25,8 +25,6 @@ Could not parse frame number of: `haxelib install flixel 5.6.1`

**[Hackx2](https://twitter.com/AnimatesHack)** - Main **Programmer**

**[GuineaPigUuhh](https://github.com/GuineaPigUuhh)** - Ex-**Programmer**

---

<h2>Psych Engine Credits::</h2>
Expand Down
2 changes: 2 additions & 0 deletions ae.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@haxe -cp commandline -D analyzer-optimize --run Main %*
pause
2 changes: 2 additions & 0 deletions ae.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
haxe -cp commandline -D analyzer-optimize --run Main $@
pause
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
113 changes: 113 additions & 0 deletions commandline/Main.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
package;

import backend.*;

class Main {
public static var commands:Array<Command> = [];

public static function initCommands() {
commands = [
{
names: ["setup"],
doc: "Setups (or updates) all libraries required for the engine.",
func: Update.main,
dDoc: "This command runs through all libraries in libs.xml, and install them.\nIf they're already installed, they will be updated."
},
{
names: ["help", null],
doc: "Shows help. Pass a command name to get additional help.",
func: help,
dDoc: "Usage: help <cmd>\n\nFor example, use \"cne help test\" to get additional help on the test command."
},
{
names: ["test"],
doc: "Creates a non final test build, then runs it.",
func: Compiler.test,
dDoc: "Usage: test <optional args>\n" +
"\nThis will create a quick debug build binded to the source then run it, which means:" +
"\n- The assets WON'T be copied over - Assets will be read from the game's source." +
"\n- This build WON'T be ready for release - Running anywhere else than in the bin folder will result in a crash from missing assets" +
"\n- This build will also use the mods folder from the source directory." +
"\n\nIf you want a full build which contains all assets, run \"cne release\" or \"cne test-release\"" +
"\nAdditional arguments will be sent to the lime compiler."
},
{
names: ["build"],
doc: "Creates a non final test build, without running it.",
func: Compiler.build,
dDoc: "Usage: build <optional arguments>\n" +
"\nThis will create a quick debug build binded to the source then run it, which means:" +
"\n- The assets WON'T be copied over - Assets will be read from the game's source." +
"\n- This build WON'T be ready for release - Running anywhere else than in the bin folder will result in a crash from missing assets" +
"\n- This build will also use the mods folder from the source directory." +
"\n\nIf you want a full build which contains all assets, run \"cne release\" or \"cne test-release\"" +
"\nAdditional arguments will be sent to the lime compiler."
},
{
names: ["release"],
doc: "Creates a final non debug build, containing all assets.",
func: Compiler.release,
dDoc: "Usage: release <optional arguments>\n" +
"\nThis will create a final ready-for-release build, which means this build will be able to be release on websites such as GameBanana without worrying about source-dependant stuff."
},
{
names: ["test-release"],
doc: "Creates a final non debug build, containing all assets.",
func: Compiler.testRelease,
dDoc: "Usage: release <optional arguments>\n" +
"\nThis will create and run a final ready-for-release build, which means this build will be able to be release on websites such as GameBanana without worrying about source-dependant stuff."
}
];
}

public static function main() {
initCommands();
var args = Sys.args();
var commandName = args.shift();
if (commandName != null)
commandName = commandName.toLowerCase();
for(c in commands) {
if (c.names.contains(commandName)) {
c.func(args);
return;
}
}
}

public static function help(args:Array<String>) {
var cmdName = args.shift();
if (cmdName != null) {
cmdName = cmdName.toLowerCase();

var matchingCommand = null;
for(c in commands) if (c.names.contains(cmdName)) {
matchingCommand = c;
break;
}

if (matchingCommand == null) {
Sys.println('help - Command named ${cmdName} not found.');
return;
}

Sys.println('${matchingCommand.names.join(", ")}');
Sys.println("---");
Sys.println(matchingCommand.dDoc);

return;
}
// shows help
Sys.println("Codename Engine Command Line utility");
Sys.println('Available commands (${commands.length}):\n');
for(line in commands) {
Sys.println('${line.names.join(", ")} - ${line.doc}');
}
}
}

typedef Command = {
var names:Array<String>;
var func:Array<String>->Void;
var ?doc:String;
var ?dDoc:String;
}
38 changes: 38 additions & 0 deletions commandline/backend/Compiler.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package backend;

class Compiler {
public static function test(args:Array<String>) {
__build(args, ["test", getBuildTarget(), "-D", "TEST_BUILD"]);
}
public static function build(args:Array<String>) {
__build(args, ["build", getBuildTarget(), "-D", "TEST_BUILD"]);
}
public static function release(args:Array<String>) {
__build(args, ["build", getBuildTarget()]);
}
public static function testRelease(args:Array<String>) {
__build(args, ["test", getBuildTarget()]);
}

/**
* i genuinely don't know how im meant to explain this - orbl
* @param args Args
* @param arg Arg
*/
private static function __build(args:Array<String>, arg:Array<String>) {
for(a in args)
arg.push(a);
Sys.command("lime", arg);
}

public static function getBuildTarget() {
return switch(Sys.systemName()) {
case "Windows" | "Linux":
Sys.systemName().toLowerCase();
case "Mac":
"macos";
case def:
def.toLowerCase();
}
}
}
Loading

0 comments on commit 8efd4b2

Please sign in to comment.