Search in sources :

Example 1 with RSSpritePixels

use of net.runelite.rs.api.RSSpritePixels in project runelite by runelite.

the class MinimapMixin method drawInstanceMap.

@Inject
@Override
public RSSpritePixels drawInstanceMap(int z) {
    RSSpritePixels ourSprite = createSpritePixels(new int[512 * 512], 512, 512);
    RSSpritePixels theirSprite = getMinimapSprite();
    RSRegion region = getRegion();
    int[] pixels = ourSprite.getPixels();
    byte[][][] tileSettings = getTileSettings();
    try {
        setMinimapSprite(ourSprite);
        int var4;
        for (int x = 1; x < SCENE_SIZE - 1; ++x) {
            var4 = (103 - x) * 2048 + 24628;
            for (int y = 1; y < SCENE_SIZE - 1; ++y) {
                if ((tileSettings[z][y][x] & 24) == 0) {
                    region.drawTile(pixels, var4, 512, z, y, x);
                }
                if (z < 3 && (tileSettings[z + 1][y][x] & 8) != 0) {
                    region.drawTile(pixels, var4, 512, z + 1, y, x);
                }
                var4 += 4;
            }
        }
        int color1 = (238 + (int) (Math.random() * 20.0D) - 10 << 16) + (238 + (int) (Math.random() * 20.0D) - 10 << 8) + (238 + (int) (Math.random() * 20.0D) - 10);
        int color2 = 238 + (int) (Math.random() * 20.0D) - 10 << 16;
        ourSprite.setRaster();
        for (int y = 1; y < SCENE_SIZE - 1; ++y) {
            for (int x = 1; x < SCENE_SIZE - 1; ++x) {
                if ((tileSettings[z][x][y] & 24) == 0) {
                    drawObject(z, x, y, color1, color2);
                }
                if (z < 3 && (tileSettings[z + 1][x][y] & 8) != 0) {
                    drawObject(z + 1, x, y, color1, color2);
                }
            }
        }
    } finally {
        getBufferProvider().setRaster();
        setMinimapSprite(theirSprite);
    }
    return ourSprite;
}
Also used : RSSpritePixels(net.runelite.rs.api.RSSpritePixels) RSRegion(net.runelite.rs.api.RSRegion) Inject(net.runelite.api.mixins.Inject)

Aggregations

Inject (net.runelite.api.mixins.Inject)1 RSRegion (net.runelite.rs.api.RSRegion)1 RSSpritePixels (net.runelite.rs.api.RSSpritePixels)1