private void drawTileOrientation(int x, int y, DGlobal.MapDistances distance, DGlobal.MapPositions position, DGlobal.MapOrientations orientation, DGlobal.MapOrientations lookOrientation) { int positionX = x; int positionY = y; DGlobal.MapOrientations drawingOrientation = orientation; switch (lookOrientation) { case DGlobal.MapOrientations.WEST: DGlobal.turnRight(ref drawingOrientation); break; case DGlobal.MapOrientations.EAST: DGlobal.turnLeft(ref drawingOrientation); break; case DGlobal.MapOrientations.SOUTH: DGlobal.turnBack(ref drawingOrientation); break; } switch (position) { case DGlobal.MapPositions.RIGHT1: DGlobal.moveRight(lookOrientation, ref positionX, ref positionY, 1); break; case DGlobal.MapPositions.RIGHT2: DGlobal.moveRight(lookOrientation, ref positionX, ref positionY, 2); break; case DGlobal.MapPositions.LEFT1: DGlobal.moveLeft(lookOrientation, ref positionX, ref positionY, 1); break; case DGlobal.MapPositions.LEFT2: DGlobal.moveLeft(lookOrientation, ref positionX, ref positionY, 2); break; } DGlobal.moveForward(lookOrientation, ref positionX, ref positionY, (int)distance); if (positionX >= 0 && positionX < this.mWidth && positionY >= 0 && positionY < this.mHeight) { if (this.mMapData[positionX, positionY, (int)orientation] > 0 && this.mTileset[(this.mMapData[positionX, positionY, (int)orientation]) - 1, (int)distance, (int)position, (int)drawingOrientation] != null) { this.mGraphics.drawImage(this.mTileset[(this.mMapData[positionX, positionY, (int)orientation]) - 1, (int)distance, (int)position, (int)drawingOrientation]); } } }
private void drawTile(int x, int y, DGlobal.MapDistances distance, DGlobal.MapPositions position, DGlobal.MapOrientations lookOrientation) { DGlobal.MapOrientations orientation = lookOrientation; if (position == DGlobal.MapPositions.CENTER) { this.drawTileOrientation(x, y, distance, position, orientation, lookOrientation); DGlobal.turnLeft(ref orientation); this.drawTileOrientation(x, y, distance, position, orientation, lookOrientation); DGlobal.turnRight(ref orientation); DGlobal.turnRight(ref orientation); this.drawTileOrientation(x, y, distance, position, orientation, lookOrientation); this.drawTileOrientation(x, y, distance, position, DGlobal.MapOrientations.FLOOR, lookOrientation); this.drawTileOrientation(x, y, distance, position, DGlobal.MapOrientations.CEIL, lookOrientation); this.drawCharacter(x, y, distance, position, lookOrientation); DGlobal.turnRight(ref orientation); this.drawTileOrientation(x, y, distance, position, orientation, lookOrientation); } else if (position == DGlobal.MapPositions.RIGHT1 || position == DGlobal.MapPositions.RIGHT2) { this.drawTileOrientation(x, y, distance, position, orientation, lookOrientation); DGlobal.turnRight(ref orientation); this.drawTileOrientation(x, y, distance, position, orientation, lookOrientation); DGlobal.turnRight(ref orientation); this.drawTileOrientation(x, y, distance, position, orientation, lookOrientation); this.drawTileOrientation(x, y, distance, position, DGlobal.MapOrientations.FLOOR, lookOrientation); this.drawTileOrientation(x, y, distance, position, DGlobal.MapOrientations.CEIL, lookOrientation); this.drawCharacter(x, y, distance, position, lookOrientation); DGlobal.turnRight(ref orientation); this.drawTileOrientation(x, y, distance, position, orientation, lookOrientation); } else if (position == DGlobal.MapPositions.LEFT1 || position == DGlobal.MapPositions.LEFT2) { this.drawTileOrientation(x, y, distance, position, orientation, lookOrientation); DGlobal.turnLeft(ref orientation); this.drawTileOrientation(x, y, distance, position, orientation, lookOrientation); DGlobal.turnLeft(ref orientation); this.drawTileOrientation(x, y, distance, position, orientation, lookOrientation); this.drawTileOrientation(x, y, distance, position, DGlobal.MapOrientations.FLOOR, lookOrientation); this.drawTileOrientation(x, y, distance, position, DGlobal.MapOrientations.CEIL, lookOrientation); this.drawCharacter(x, y, distance, position, lookOrientation); DGlobal.turnLeft(ref orientation); this.drawTileOrientation(x, y, distance, position, orientation, lookOrientation); } }