11package objects .playfields ;
2- /*
2+ /*
33 if ((FlxG.state is PlayState))
44 PlayState.instance.callOnHScripts("notefieldDraw", [this], ["drawQueue" => drawQueue]); // lets you do custom rendering in scripts, if needed
55
@@ -8,14 +8,14 @@ package objects.playfields;
88 var glowB = modManager.getValue("flashB", modNumber);
99 */
1010
11- import flixel .util .FlxDestroyUtil ;
1211import flixel .math .FlxPoint ;
13- import openfl .geom .ColorTransform ;
1412import flixel .util .FlxColor ;
15- import objects .playfields .NoteField ;
13+ import flixel .util .FlxDestroyUtil ;
14+ import flixel .util .FlxSort ;
1615import objects .playfields .FieldBase ;
16+ import objects .playfields .NoteField ;
1717import objects .proxies .ProxyField ;
18- import flixel . util . FlxSort ;
18+ import openfl . geom . ColorTransform ;
1919import states .PlayState ;
2020@:structInit
2121class FinalRenderObject extends RenderObject {
@@ -36,7 +36,7 @@ class NotefieldRenderer extends FlxBasic {
3636 if (members .contains (field ))
3737 members .remove (field );
3838 }
39-
39+
4040 static inline function zindexSort (Order : Int , Obj1 : FinalRenderObject , Obj2 : FinalRenderObject ): Int {
4141 var result : Int = 0 ;
4242 var Value1 : Float = Obj1 .zIndex ;
@@ -63,12 +63,12 @@ class NotefieldRenderer extends FlxBasic {
6363 static function drawQueueSort (Obj1 : FinalRenderObject , Obj2 : FinalRenderObject ) {
6464 return zindexSort (FlxSort .ASCENDING , Obj1 , Obj2 );
6565 }
66-
66+
6767 var point : FlxPoint = FlxPoint .get (0 , 0 );
68-
68+
6969 inline function getFlashComponent (field : NoteField , component : String , column : Int )
7070 return field .modManager .getValue (' flash $component ' , field .modNumber ) * field .modManager .getValue (' flash $column $component ' , field .modNumber );
71-
71+
7272 /**
7373 * Check if a ProxyField is in PlayState's members list
7474 * If it is, PlayState will handle rendering it at the correct layer
@@ -77,16 +77,16 @@ class NotefieldRenderer extends FlxBasic {
7777 // Only check ProxyFields
7878 if (! Std .isOfType (field , ProxyField ))
7979 return false ;
80-
80+
8181 // Check if PlayState exists and has the field in its members
8282 var playState = PlayState .instance ;
8383 if (playState != null && playState .members != null ) {
8484 return playState .members .contains (field );
8585 }
86-
86+
8787 return false ;
8888 }
89-
89+
9090
9191 override function draw (){
9292 var finalDrawQueue : Array <FinalRenderObject > = [];
@@ -102,27 +102,27 @@ class NotefieldRenderer extends FlxBasic {
102102
103103 field .preDraw (); // Collects all the drawing information
104104 }
105-
105+
106106 // Now that the main draw queues should have been populated, it's time to push them into the final draw queue for sorting
107-
108-
107+
108+
109109 for (field in members ){
110110 // Skip ProxyFields that are in PlayState's members - they'll be rendered by PlayState
111111 if (isProxyFieldInPlayState (field ))
112112 continue ;
113-
114- field .draw (); // Just incase they want to do something before gathering happens (i.e ProxyFields grabbing their host's draw queue)
113+
114+ field .draw (); // Just incase they want to do something before gathering happens (i.e ProxyFields grabbing their host's draw queue)
115115
116116 if (! field .exists || ! field .visible )
117117 continue ;
118-
118+
119119 var realField : NoteField = field .getNotefield ();
120120
121121 var queue : Array <RenderObject > = field .drawQueue ;
122122 for (object in queue ){
123123 var glowColour = realField .modManager == null ? FlxColor .WHITE : FlxColor .fromRGBFloat (getFlashComponent (realField , ' R' , object .column ),
124124 getFlashComponent (realField , ' G' , object .column ), getFlashComponent (realField , ' B' , object .column ));
125-
125+
126126 finalDrawQueue .push ({
127127 graphic : object .graphic ,
128128 shader : object .shader ,
@@ -180,7 +180,7 @@ class NotefieldRenderer extends FlxBasic {
180180 continue ;
181181 for (shit in transforms )
182182 shit .alphaMultiplier * = camera .alpha ;
183-
183+
184184 object .sourceField .getScreenPosition (point , camera );
185185 var drawItem = camera .startTrianglesBatch (graphic , object .antialiasing , true , null , true , shader );
186186 @:privateAccess
@@ -197,7 +197,7 @@ class NotefieldRenderer extends FlxBasic {
197197
198198 override function update (elapsed : Float ){
199199 super .update (elapsed );
200-
200+
201201 for (field in members )
202202 field .update (elapsed );
203203 }
@@ -207,8 +207,8 @@ class NotefieldRenderer extends FlxBasic {
207207 super .destroy ();
208208
209209 while (members .length > 0 )
210- members .pop ().destroy ();
211-
210+ members .pop ().destroy ();
211+
212212 members = null ;
213213 }
214- }
214+ }
0 commit comments