Skip to content

Commit

Permalink
Fix std deprecation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rpaladin committed Dec 3, 2022
1 parent 36ad5a2 commit 9777b51
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Backends/HTML5-Worker/kha/html5worker/Graphics.hx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Graphics implements kha.graphics4.Graphics {
var renderTarget: Image;

public function new(renderTarget: Canvas = null) {
if (Std.is(renderTarget, Image)) {
if (Std.isOfType(renderTarget, Image)) {
this.renderTarget = cast renderTarget;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Backends/HTML5/kha/SystemImpl.hx
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ class SystemImpl {
static function errorHandler(message: String, source: String, lineno: Int, colno: Int, error: Dynamic) {
Browser.console.error("Error: " + message);
if (error != null) {
if (Std.is(error, haxe.Exception)) {
if (Std.isOfType(error, haxe.Exception)) {
var err: haxe.Exception = error;
if (err.stack != null) {
Browser.console.error("Stack:\n" + err.stack);
}
}
else if (Std.is(error, js.lib.Error)) {
else if (Std.isOfType(error, js.lib.Error)) {
var err: js.lib.Error = error;
if (err.stack != null) {
Browser.console.error("Stack:\n" + err.stack);
Expand Down
4 changes: 2 additions & 2 deletions Backends/HTML5/kha/WebGLImage.hx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class WebGLImage extends Image {
}

function createImageData() {
if (Std.is(image, Uint8Array)) {
if (Std.isOfType(image, Uint8Array)) {
data = new js.html.ImageData(new js.lib.Uint8ClampedArray(image.buffer), this.width, this.height);
}
else {
Expand Down Expand Up @@ -297,7 +297,7 @@ class WebGLImage extends Image {
SystemImpl.gl.texImage2D(GL.TEXTURE_2D, 0, SystemImpl.gl2 ? GL_RGBA16F : GL.RGBA, myWidth, myHeight, 0, GL.RGBA,
SystemImpl.halfFloat.HALF_FLOAT_OES, image);
case RGBA32:
if (Std.is(image, Uint8Array)) {
if (Std.isOfType(image, Uint8Array)) {
SystemImpl.gl.texImage2D(GL.TEXTURE_2D, 0, GL.RGBA, myWidth, myHeight, 0, GL.RGBA, GL.UNSIGNED_BYTE, image);
}
else {
Expand Down
2 changes: 1 addition & 1 deletion Backends/HTML5/kha/js/graphics4/Graphics.hx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class Graphics implements kha.graphics4.Graphics {
function init() {
if (renderTarget == null)
return;
isCubeMap = Std.is(renderTarget, CubeMap);
isCubeMap = Std.isOfType(renderTarget, CubeMap);
if (isCubeMap) {
var cubeMap: CubeMap = cast(renderTarget, CubeMap);
renderTargetFrameBuffer = cubeMap.frameBuffer;
Expand Down

0 comments on commit 9777b51

Please sign in to comment.