8 |
9 | ## Running locally
10 |
11 | ```
12 | $ git clone https://github.com/dennisdev/rs-map-viewer.git
13 | $ cd rs-map-viewer
14 | $ yarn install
15 | $ yarn run download-caches
16 | $ yarn start
17 | ```
18 |
19 | ## Credits
20 |
21 | - Jagex
22 | - [RuneLite](https://github.com/runelite/runelite)
23 | - [OpenRS2 Archive](https://archive.openrs2.org/) - Caches
24 | - [RuneScape Archive](https://rs-archive.github.io/) - Caches
25 | - [OSRS Wiki](https://oldschool.runescape.wiki/) - Item spawns
26 | - [2004scape](https://github.com/2004scape/Server) - Npc spawns
27 | - [2009scape](https://gitlab.com/2009scape/2009scape) - Npc spawns
28 | - [RuneStar](https://github.com/RuneStar/fonts) - Fonts
29 | - [Blurite](https://github.com/blurite/pathfinder) - Some pathfinding stuff
30 | - [RuneApps Model Viewer](https://github.com/skillbert/rsmv) - Some procedural texture stuff
31 |
--------------------------------------------------------------------------------
/src/components/rs/minimap/MinimapContainer.css:
--------------------------------------------------------------------------------
1 | .minimap-container {
2 | position: relative;
3 | width: 181px;
4 | height: 165px;
5 | overflow: hidden;
6 | }
7 |
8 | .minimap-container .compass {
9 | cursor: pointer;
10 | clip-path: circle(18px);
11 | position: absolute;
12 | left: -4px;
13 | top: -4px;
14 | }
15 |
16 | .minimap-container .worldmap-icon {
17 | cursor: pointer;
18 | position: absolute;
19 | left: 144px;
20 | top: 128px;
21 | width: 32px;
22 | height: 32px;
23 | background-image: url(./worldmap-icon.png);
24 | background-size: 32px 32px;
25 | }
26 |
27 | .minimap-container .worldmap-icon:hover {
28 | background-image: url(./worldmap-icon-hover.png);
29 | }
30 |
31 | .minimap-container .minimap {
32 | clip-path: circle(77px at 384px 384px);
33 | position: absolute;
34 | left: -285px;
35 | top: -301px;
36 | transform-origin: 384px 384px;
37 | background-color: black;
38 | }
39 |
40 | .minimap-images {
41 | position: relative;
42 | }
43 |
44 | .minimap-image {
45 | position: absolute;
46 | padding: 0;
47 | margin: 0;
48 | }
49 |
--------------------------------------------------------------------------------
/src/rs/texture/procedural/operation/ConstantMonochromeOperation.ts:
--------------------------------------------------------------------------------
1 | import { ByteBuffer } from "../../../io/ByteBuffer";
2 | import { TextureGenerator } from "../TextureGenerator";
3 | import { TextureOperation } from "./TextureOperation";
4 |
5 | export class ConstantMonochromeOperation extends TextureOperation {
6 | constant: number;
7 |
8 | constructor(constant: number = 4096) {
9 | super(0, true);
10 | this.constant = constant;
11 | }
12 |
13 | override decode(field: number, buffer: ByteBuffer): void {
14 | if (field === 0) {
15 | this.constant = ((buffer.readUnsignedByte() << 12) / 255) | 0;
16 | }
17 | }
18 |
19 | override getMonochromeOutput(textureGenerator: TextureGenerator, line: number): Int32Array {
20 | if (!this.monochromeImageCache) {
21 | throw new Error("Monochrome image cache not initialized");
22 | }
23 | const output = this.monochromeImageCache.get(line);
24 | if (this.monochromeImageCache.dirty) {
25 | output.fill(this.constant, 0, textureGenerator.width);
26 | }
27 | return output;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import { BrowserRouter } from "react-router-dom";
4 |
5 | import "./index.css";
6 | import MapViewerApp from "./mapviewer/MapViewerApp";
7 | import reportWebVitals from "./reportWebVitals";
8 | import { Bzip2 } from "./rs/compression/Bzip2";
9 | import { Gzip } from "./rs/compression/Gzip";
10 |
11 | Bzip2.initWasm();
12 | Gzip.initWasm();
13 |
14 | window.wallpaperPropertyListener = {
15 | applyGeneralProperties: (properties: any) => {
16 | if (properties.fps) {
17 | window.wallpaperFpsLimit = properties.fps;
18 | }
19 | },
20 | };
21 |
22 | const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
23 | root.render(
24 | //