Full rewrite

- Removed csflow, as its basically not getting used when high optimization is needed
- Fully rewrote radarflow dma logic.
- Speed increase from 20hz to over 130 hz over pcileech, thanks to scatter reads and improved caching
- Removed docs, because those were for csflow, which is now removed
This commit is contained in:
Janek
2024-01-08 00:22:24 +01:00
parent f186b19255
commit 16f7791628
233 changed files with 805 additions and 16929 deletions

21
webradar/script.js Normal file → Executable file
View File

@@ -5,14 +5,16 @@ const enemyColor = "#ec040b"
const bombColor = "#eda338"
const textColor = "#d1d1d1"
// Should zoom or not
// Settings
shouldZoom = true
drawStats = true
// Common
canvas = null
ctx = null
// radarflow specific
freq = 0
image = null
map = null
mapName = null
@@ -32,6 +34,7 @@ if (location.protocol == 'https:') {
} else {
websocketAddr = `ws://${window.location.host}/ws`
}
//websocketAddr = "ws://localhost:8001/ws"
// Util functions
const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
@@ -186,6 +189,16 @@ function render() {
ctx.fillText("Disconnected", 1024/2, 1024/2);
}
}
if (drawStats) {
ctx.font = "16px Arial";
ctx.textAlign = "left"
ctx.fillStyle = textColor
ctx.lineWidth = 2;
ctx.strokeStyle = "black"
ctx.strokeText(`${freq} Hz`, 2, 18)
ctx.fillText(`${freq} Hz`, 2, 18)
}
}
if (websocket != null) {
@@ -355,6 +368,8 @@ function connect() {
} else {
let data = JSON.parse(event.data);
freq = data.freq;
if (data.ingame == false) {
mapName = null
entityData = null
@@ -417,4 +432,8 @@ addEventListener("DOMContentLoaded", (e) => {
function toggleZoom() {
shouldZoom = !shouldZoom
}
function toggleStats() {
drawStats = !drawStats
}