Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ViewportAPI viewport = engine.getViewport();
- glViewport(0, 0, (int) ((float) Global.getSettings().getScreenWidth() * Display.getPixelScaleFactor()), (int) ((float) Global.getSettings().getScreenHeight() * Display.getPixelScaleFactor()));
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- glOrtho(viewport.getLLX(), viewport.getLLX() + viewport.getVisibleWidth(), viewport.getLLY(), viewport.getLLY() + viewport.getVisibleHeight(), -2000, 2000);
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glLineWidth(LEAD_THICKNESS);
- if (target.isHulk()) {
- glColor(HULK_COLOR, LEAD_ALPHA);
- } else if (target.getOwner() == player.getOwner()) {
- glColor(FRIENDLY_COLOR, LEAD_ALPHA);
- } else if (target.getOwner() + player.getOwner() == 1) {
- glColor(ENEMY_COLOR, LEAD_ALPHA);
- } else {
- glColor(NEUTRAL_COLOR, LEAD_ALPHA);
- }
- glBegin(GL_LINE_LOOP);
- glVertex2f(loc.x, loc.y + LEAD_SIZE);
- glVertex2f(loc.x + LEAD_SIZE, loc.y);
- glVertex2f(loc.x, loc.y - LEAD_SIZE);
- glVertex2f(loc.x - LEAD_SIZE, loc.y);
- glEnd();
- glDisable(GL_BLEND);
- glPopMatrix();
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glDisable(GL_TEXTURE_2D);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement