Esempio n. 1
0
  /**
   * Implementation of the core rendering function that just renders the map to the assigned graphic
   * context.
   *
   * @param g the graphics context used for the render operation
   */
  private void renderImpl(final Graphics g) {
    final Camera camera = Camera.getInstance();

    g.pushTransform();

    g.translate(-camera.getViewportOffsetX(), -camera.getViewportOffsetY());
    Camera.getInstance().clearDirtyAreas(g);

    synchronized (display) {
      synchronized (GameMap.LIGHT_LOCK) {
        // draw all items
        for (int i = 0, displaySize = display.size(); i < displaySize; i++) {
          display.get(i).draw(g);
        }
      }
    }

    g.popTransform();
  }