@@ -60,6 +60,7 @@ class Macros {
6060 Compiler .addMetadata (' @:build( $macroPath .buildLimeAssetLibrary())' , ' lime.utils.AssetLibrary' );
6161 Compiler .addMetadata (' @:build( $macroPath .buildLimeApplication())' , ' lime.app.Application' );
6262 Compiler .addMetadata (' @:build( $macroPath .buildLimeWindow())' , ' lime.ui.Window' );
63+ Compiler .addMetadata (' @:build( $macroPath .buildOpenflAssets())' , ' openfl.utils.Assets' );
6364
6465 // Adds Compat for #if hscript blocks when you have hscript improved
6566 if (Context .defined (" hscript_improved" ) && ! Context .defined (" hscript" )) {
@@ -106,5 +107,25 @@ class Macros {
106107
107108 return fields ;
108109 }
110+
111+ public static function buildOpenflAssets (): Array <Field > {
112+ final fields : Array <Field > = Context .getBuildFields (), pos : Position = Context .currentPos ();
113+ for (f in fields ) switch (f .name ) {
114+ case " allowCompressedTextures" : fields .remove (f );
115+ default :
116+ }
117+
118+ fields .push ({name : ' allowCompressedTextures' , access : [APublic , AStatic ], pos : pos , kind : FProp (" get" , " set" , macro :Null < Bool > ), meta : [{pos : pos , name : " :isVar" }]});
119+
120+ fields .push ({name : " get_allowCompressedTextures" , access : [APublic , AStatic , AInline ], pos : pos , kind : FFun ({ret : macro :Bool , args : [], expr : macro {
121+ return allowCompressedTextures != null ? allowCompressedTextures : ! funkin.backend.system. Main .forceGPUOnlyBitmapsOff && funkin.options. Options .gpuOnlyBitmaps ;
122+ }})});
123+ fields .push ({name : " set_allowCompressedTextures" , access : [APublic , AStatic , AInline ], pos : pos , kind : FFun ({ret : macro :Bool , args : [{name : " value" , type : macro :Bool }], expr : macro {
124+ allowCompressedTextures = value ;
125+ return get_allowCompressedTextures ();
126+ }})});
127+
128+ return fields ;
129+ }
109130}
110131#end
0 commit comments