Package se.llbit.chunky.world

Examples of se.llbit.chunky.world.ChunkView


    // NB lock the lock ordering here is critical!
    // we access ChunkMap via Chunky but here we also need to lock Chunky
    synchronized (chunky) {
    synchronized (this) {
      ChunkView mapView = chunky.getMapView();

      WorldRenderer renderer = chunky.getWorldRenderer();
      World world = chunky.getWorld();
      ChunkSelectionTracker selection = chunky.getChunkSelection();
View Full Code Here


      Graphics g = buffer.getGraphics();
      renderEmpty(g, width, height);
      return;
    }

    ChunkView view = buffer.getView();

    for (ChunkPosition pos: buffer) {
      int x = pos.x;
      int z = pos.z;
View Full Code Here

      Graphics g, MapBuffer renderBuffer) {

    boolean loadIndicator = chunky.isLoading();
    Chunk.Renderer renderer = chunky.getChunkRenderer();

    ChunkView view = renderBuffer.getView();

    if (loadIndicator) {
      g.drawImage(MiscImages.clock, view.width-32, 0, 32, 32, null);
    }
View Full Code Here

   * @param cx
   * @param cz
   */
  @Override
  final public void render(MapBuffer rbuff, int cx, int cz) {
    ChunkView view = rbuff.getView();
    int x0 = view.chunkScale * (cx - view.px0);
    int z0 = view.chunkScale * (cz - view.pz0);

    if (view.chunkScale == 1) {
      rbuff.setRGB(x0, z0, getAvgColor());
View Full Code Here

      if (!selectRect) {
        if (!dragging) {
          int x = e.getX();
          int y = e.getY();
          ChunkView theView = chunky.getMapView();
          double scale = theView.scale;
          int cx = (int) QuickMath.floor(theView.x + (x - getWidth()/2) / scale);
          int cz = (int) QuickMath.floor(theView.z + (y - getHeight()/2) / scale);

          if (theView.scale >= 16) {
View Full Code Here

        repaint();
      }
    }

    private ChunkPosition getChunk(MouseEvent e) {
      ChunkView theView = view;
      double scale = theView.scale;
      double x = theView.x + (e.getX() - getWidth()/2) / scale;
      double z = theView.z + (e.getY() - getHeight()/2) / scale;
      int cx = (int) QuickMath.floor(x);
      int cz = (int) QuickMath.floor(z);
View Full Code Here

   * @param cx
   * @param cz
   */
  @Override
  public synchronized void render(MapBuffer rbuff, int cx, int cz) {
    ChunkView view = rbuff.getView();
    int x0 = view.chunkScale * (cx - view.px0);
    int z0 = view.chunkScale * (cz - view.pz0);

    if (view.chunkScale == 1) {
      rbuff.setRGB(x0, z0, getAvgColor());
View Full Code Here

   */
  @Override
  public synchronized void renderHighlight(MapBuffer rbuff, int cx, int cz,
      Block hlBlock, java.awt.Color highlight) {

    ChunkView view = rbuff.getView();
    int x0 = view.chunkScale * (cx - view.px0);
    int z0 = view.chunkScale * (cz - view.pz0);

    if (blocks == null)
      return;
View Full Code Here

  private UnknownLayer() {
  }

  @Override
  public synchronized void render(MapBuffer rbuff, int cx, int cz) {
    ChunkView view = rbuff.getView();
    int x0 = view.chunkScale * (cx - view.px0);
    int z0 = view.chunkScale * (cz - view.pz0);

    if (view.chunkScale == 1) {
      rbuff.setRGB(x0, z0, averageColor);
View Full Code Here

  private EmptyLayer() {
  }

  @Override
  public synchronized void render(MapBuffer rbuff, int cx, int cz) {
    ChunkView view = rbuff.getView();
    int x0 = view.chunkScale * (cx - view.px0);
    int z0 = view.chunkScale * (cz - view.pz0);

    if (view.chunkScale == 1) {
      rbuff.setRGB(x0, z0, averageColor);
View Full Code Here

TOP

Related Classes of se.llbit.chunky.world.ChunkView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.