MCPcopy Create free account
hub / github.com/catabriga/graphwar / drawFunction

Method drawFunction

src/Graphwar/GraphPlane.java:352–379  ·  view source on GitHub ↗
(Graphics g, boolean terrainReversed)

Source from the content-addressed store, hash-verified

350 }
351
352 private void drawFunction(Graphics g, boolean terrainReversed)
353 {
354 if(graphwar.getGameData().isDrawingFunction())
355 {
356 boolean funcReversed = graphwar.getGameData().isFunctionReversed();
357 drawFunctionImage(functionGraphics, (funcReversed || terrainReversed) && !(funcReversed && terrainReversed));
358
359 Graphics2D g2d = (Graphics2D)g;
360
361 if(graphwar.getGameData().isExploding())
362 {
363 float alpha = 1.0f - ((float)graphwar.getGameData().getTimeExploding())/Constants.FUNC_FADE_TIME;
364
365 if(alpha < 0)
366 {
367 alpha = 0;
368 }
369
370 g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
371 }
372
373 g2d.drawImage(functionImage, 0, 0, null);
374
375 g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1.0f));
376
377 repaintBack = true;
378 }
379 }
380
381
382 private void drawExplosion(Graphics g, boolean terrainReversed)

Callers 1

paintComponentMethod · 0.95

Calls 6

drawFunctionImageMethod · 0.95
isDrawingFunctionMethod · 0.80
getGameDataMethod · 0.80
isFunctionReversedMethod · 0.80
isExplodingMethod · 0.45
getTimeExplodingMethod · 0.45

Tested by

no test coverage detected