-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathProject.hxp
More file actions
132 lines (108 loc) · 2.83 KB
/
Project.hxp
File metadata and controls
132 lines (108 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
package;
import hxp.*;
import lime.tools.*;
using StringTools;
/**
* This is the main project file for TechNotDrip Engine.
*
* This works exactly like an Project.xml but in Haxe Syntax.
*/
class Project extends HXProject
{
public function new()
{
super();
setupApplicationSettings();
setupWindowSettings();
setupPathSettings();
setupHaxelibs();
setupHaxeDefines();
setupHaxeFlags();
}
public function setupApplicationSettings():Void
{
meta.title = 'Friday Night Funkin\': TechNotDrip Engine';
app.file = 'TechNotDrip';
app.main = 'Main';
meta.version = '0.1.0';
meta.company = 'TilNotDrip';
app.preloader = 'flixel.system.FlxPreloader';
app.swfVersion = 11.8;
}
public function setupWindowSettings():Void
{
window.width = 1280;
window.height = 720;
window.background = 0;
window.hardware = true;
window.vsync = false;
if (platformType == WEB)
{
window.resizable = true;
}
if (platformType == DESKTOP)
{
window.orientation = LANDSCAPE;
window.fullscreen = false;
window.resizable = true;
}
if (platformType == MOBILE)
{
window.orientation = LANDSCAPE;
window.fullscreen = false;
window.width = 0;
window.height = 0;
}
}
public function setupPathSettings():Void
{
app.path = getBuildDirectory();
var excludeList:Array<String> = [];
excludeList.push((platformType == WEB) ? 'ogg' : 'mp3');
// TODO: Maybe scan the entire assets folder instead like base fnf.
includeAssets("assets", "assets", ['*'], excludeList);
icons.push(new Icon('extras/appicons/icon16.png', 16));
icons.push(new Icon('extras/appicons/icon32.png', 32));
icons.push(new Icon('extras/appicons/icon64.png', 64));
icons.push(new Icon('extras/appicons/icon.png'));
sources.push('src');
}
public function setupHaxelibs():Void
{
haxelibs.push(new Haxelib('lime', '8.2.1'));
haxelibs.push(new Haxelib('openfl', '9.4.0'));
haxelibs.push(new Haxelib('flixel', '5.8.0'));
haxelibs.push(new Haxelib('flixel-addons', '3.2.3'));
if (debug)
haxelibs.push(new Haxelib('hxcpp-debug-server', '1.2.4'));
}
public function setupHaxeDefines():Void
{
if (!debug)
haxedefs.set('FLX_NO_DEBUG', '');
haxedefs.set('FLX_NO_HEALTH', '');
if (platformType == MOBILE)
{
haxedefs.set('FLX_NO_KEYBOARD', '');
haxedefs.set('FLX_NO_MOUSE', '');
}
if (platformType == DESKTOP)
{
haxedefs.set('FLX_NO_TOUCH', '');
}
haxedefs.set('message.reporting', 'pretty');
if (!debug)
haxedefs.set('NAPE_RELEASE_BUILD', '');
}
public function setupHaxeFlags():Void
{
haxeflags.push('-dce no');
haxeflags.push("--macro include('funkin')");
haxeflags.push("--macro addMetadata('@:build(funkin.macros.ZProperty.build())', 'flixel.FlxBasic')");
}
function getBuildDirectory():String
{
var buildDir:String = 'export/' + ((debug) ? 'debug' : 'release');
return buildDir;
}
}