From f8a0cf9ee2b46d9ad9c549d1b761b7e21a627d11 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Tue, 20 Oct 2020 21:12:53 +0900 Subject: [PATCH] gl to deal with both signed and unsigned values --- assets/tvdos/gl.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/tvdos/gl.js b/assets/tvdos/gl.js index afb3b96..fd9d625 100644 --- a/assets/tvdos/gl.js +++ b/assets/tvdos/gl.js @@ -53,7 +53,7 @@ GL.drawTexPatternOver = function(texture, x, y, width, height) { var tx = xx % texture.width; var ty = yy % texture.height; var c = texture.texData[ty * texture.width + tx]; - if (c != -1) { + if ((c & 255) != 255) { graphics.plotPixel(x + xx, y + yy, c); } } @@ -72,7 +72,7 @@ GL.drawTexImageOver = function(texture, x, y) { for (var ty = 0; ty < texture.height; ty++) { for (var tx = 0; tx < texture.width; tx++) { var c = texture.texData[ty * texture.width + tx]; - if (c != -1) { + if ((c & 255) != 255) { graphics.plotPixel(x + tx, y + ty, c); } } @@ -94,7 +94,7 @@ GL.drawSpriteOver = function(sheet, xi, yi, x, y) { for (var ty = 0; ty < sheet.tileHeight; ty++) { for (var tx = 0; tx < sheet.tileWidth; tx++) { var c = sheet.texture.texData[(ty + offy) * sheet.texture.width + (tx + offx)]; - if (c != -1) { + if ((c & 255) != 255) { graphics.plotPixel(x + tx, y + ty, c); } }