summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mannehed <samuel@cendio.se>2020-05-31 23:27:58 +0200
committerSamuel Mannehed <samuel@cendio.se>2020-05-31 23:37:29 +0200
commit164bf50fda95556c7e7047baf15cbe74a816f26e (patch)
tree1f2ec4c6c311602123c1817486cbf926f6cd769a
parenta7fe079f81bcb8982379746bbc3cf4d3ee0fa262 (diff)
downloadnovnc-164bf50fda95556c7e7047baf15cbe74a816f26e.tar.gz
Standardize on camelCase in Decoders
-rw-r--r--core/decoders/hextile.js18
-rw-r--r--core/decoders/raw.js14
2 files changed, 16 insertions, 16 deletions
diff --git a/core/decoders/hextile.js b/core/decoders/hextile.js
index b762060..8dbe809 100644
--- a/core/decoders/hextile.js
+++ b/core/decoders/hextile.js
@@ -17,10 +17,10 @@ export default class HextileDecoder {
decodeRect(x, y, width, height, sock, display, depth) {
if (this._tiles === 0) {
- this._tiles_x = Math.ceil(width / 16);
- this._tiles_y = Math.ceil(height / 16);
- this._total_tiles = this._tiles_x * this._tiles_y;
- this._tiles = this._total_tiles;
+ this._tilesX = Math.ceil(width / 16);
+ this._tilesY = Math.ceil(height / 16);
+ this._totalTiles = this._tilesX * this._tilesY;
+ this._tiles = this._totalTiles;
}
while (this._tiles > 0) {
@@ -39,11 +39,11 @@ export default class HextileDecoder {
subencoding + ")");
}
- const curr_tile = this._total_tiles - this._tiles;
- const tile_x = curr_tile % this._tiles_x;
- const tile_y = Math.floor(curr_tile / this._tiles_x);
- const tx = x + tile_x * 16;
- const ty = y + tile_y * 16;
+ const currTile = this._totalTiles - this._tiles;
+ const tileX = currTile % this._tilesX;
+ const tileY = Math.floor(currTile / this._tilesX);
+ const tx = x + tileX * 16;
+ const ty = y + tileY * 16;
const tw = Math.min(16, (x + width) - tx);
const th = Math.min(16, (y + height) - ty);
diff --git a/core/decoders/raw.js b/core/decoders/raw.js
index 0e806d3..4d84d7d 100644
--- a/core/decoders/raw.js
+++ b/core/decoders/raw.js
@@ -24,15 +24,15 @@ export default class RawDecoder {
return false;
}
- const cur_y = y + (height - this._lines);
- const curr_height = Math.min(this._lines,
- Math.floor(sock.rQlen / bytesPerLine));
+ const curY = y + (height - this._lines);
+ const currHeight = Math.min(this._lines,
+ Math.floor(sock.rQlen / bytesPerLine));
let data = sock.rQ;
let index = sock.rQi;
// Convert data if needed
if (depth == 8) {
- const pixels = width * curr_height;
+ const pixels = width * currHeight;
const newdata = new Uint8Array(pixels * 4);
for (let i = 0; i < pixels; i++) {
newdata[i * 4 + 0] = ((data[index + i] >> 0) & 0x3) * 255 / 3;
@@ -44,9 +44,9 @@ export default class RawDecoder {
index = 0;
}
- display.blitImage(x, cur_y, width, curr_height, data, index);
- sock.rQskipBytes(curr_height * bytesPerLine);
- this._lines -= curr_height;
+ display.blitImage(x, curY, width, currHeight, data, index);
+ sock.rQskipBytes(currHeight * bytesPerLine);
+ this._lines -= currHeight;
if (this._lines > 0) {
return false;
}