Advertisement
DarkRevenant

Untitled

May 28th, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.48 KB | None | 0 0
  1.         ViewportAPI viewport = engine.getViewport();
  2.  
  3.         glViewport(0, 0, (int) ((float) Global.getSettings().getScreenWidth() * Display.getPixelScaleFactor()), (int) ((float) Global.getSettings().getScreenHeight() * Display.getPixelScaleFactor()));
  4.  
  5.         glMatrixMode(GL_PROJECTION);
  6.         glPushMatrix();
  7.         glLoadIdentity();
  8.         glOrtho(viewport.getLLX(), viewport.getLLX() + viewport.getVisibleWidth(), viewport.getLLY(), viewport.getLLY() + viewport.getVisibleHeight(), -2000, 2000);
  9.  
  10.         glMatrixMode(GL_MODELVIEW);
  11.         glPushMatrix();
  12.         glLoadIdentity();
  13.  
  14.         glEnable(GL_BLEND);
  15.         glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
  16.  
  17.         glLineWidth(LEAD_THICKNESS);
  18.         if (target.isHulk()) {
  19.             glColor(HULK_COLOR, LEAD_ALPHA);
  20.         } else if (target.getOwner() == player.getOwner()) {
  21.             glColor(FRIENDLY_COLOR, LEAD_ALPHA);
  22.         } else if (target.getOwner() + player.getOwner() == 1) {
  23.             glColor(ENEMY_COLOR, LEAD_ALPHA);
  24.         } else {
  25.             glColor(NEUTRAL_COLOR, LEAD_ALPHA);
  26.         }
  27.         glBegin(GL_LINE_LOOP);
  28.         glVertex2f(loc.x, loc.y + LEAD_SIZE);
  29.         glVertex2f(loc.x + LEAD_SIZE, loc.y);
  30.         glVertex2f(loc.x, loc.y - LEAD_SIZE);
  31.         glVertex2f(loc.x - LEAD_SIZE, loc.y);
  32.         glEnd();
  33.  
  34.         glDisable(GL_BLEND);
  35.  
  36.         glPopMatrix();
  37.         glMatrixMode(GL_PROJECTION);
  38.         glPopMatrix();
  39.  
  40.         glDisable(GL_TEXTURE_2D);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement