11package biotech .graphics ;
22
3- import arc .Core ;
43import arc .Events ;
54import arc .graphics .g2d .Draw ;
65import arc .graphics .g2d .TextureRegion ;
@@ -17,9 +16,6 @@ public class ShockwaveRenderer {
1716 private float boomIntensity ,
1817 boomReduction ,
1918 boomTime ;
20- private float rockAlpha ,
21- rockReduction ;
22- private final float rockBorder = 32 ;
2319 private final FrameBuffer buffer ;
2420
2521 public ShockwaveRenderer (){
@@ -39,17 +35,13 @@ public void boom(float intensity, float duration){
3935 boomIntensity = Math .max (boomIntensity , Mathf .clamp (intensity , 0 , 1 ));
4036 boomTime = Math .max (boomTime , duration );
4137 boomReduction = boomIntensity / boomTime ;
42- rockAlpha = 0.25f ;
43- rockReduction = rockAlpha / boomTime ;
4438 }
4539
4640 private void update (){
4741 if (!Vars .state .isPaused () && boomTime > 0 ){
4842 boomIntensity -= boomReduction * Time .delta ;
49- rockAlpha -= rockReduction * Time .delta ;
5043 boomTime -= Time .delta ;
5144 boomIntensity = Mathf .clamp (boomIntensity , 0f , 1f );
52- rockAlpha = Mathf .clamp (rockAlpha , 0f , 1f );
5345 }
5446 }
5547
@@ -68,19 +60,6 @@ private void draw(){
6860 BioShaders .shockwaveShader .intensity = boomIntensity * intensity ();
6961 buffer .blit (BioShaders .shockwaveShader );
7062 }
71-
72- Draw .alpha (rockAlpha );
73- TextureRegion region = atlas .find ("circle" );
74- float rWidth = region .width , rHeight = region .height ;
75- float sWidth = graphics .getWidth () - 2 * rockBorder ,
76- sHeight = graphics .getHeight () - 2 * rockBorder ;
77- float targetRatio = sHeight / sWidth ;
78- float sourceRatio = rHeight / rWidth ;
79- float scale = targetRatio > sourceRatio ? sWidth / rWidth : sHeight / rHeight ;
80- rWidth *= scale / Vars .renderer .getDisplayScale ();
81- rHeight *= scale / Vars .renderer .getDisplayScale ();
82- Draw .rect (region , camera .position .x , camera .position .y , rWidth , rHeight );
83- Draw .color ();
8463 });
8564 }
8665
0 commit comments