Skip to content

Commit

Permalink
Try to avoid warnings/errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurdoch committed Mar 13, 2023
1 parent 43b1373 commit 3f536d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion R/convertScene.R
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ convertScene <- function(x = scene3d(minimal), width = NULL, height = NULL,
normalization <- ""
if (length(obj[[n]]) > 6 && # Don't bother for short ones
n %in% c("colors","texcoords") &&
0 <= (objrange <- range(obj[[n]]))[1] &&
!anyNA(objrange <- range(obj[[n]])) &&
0 <= objrange[1] &&
objrange[2] <= 1) {
scaled <- 255*obj[[n]]
rounded <- round(scaled)
Expand Down
5 changes: 4 additions & 1 deletion R/r3d.rgl.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,13 @@ warnBlackTexture <- function(...,
texmode = defaults$texmode) {
if (!is.null(texture) &&
length(color) == 1 &&
!is.na(color) &&
color == "missing" &&
!is.na(texmode) &&
texmode == "modulate" &&
getOption("rgl.warnBlackTexture", TRUE) &&
isTRUE(getOption("rgl.warnBlackTexture", TRUE)) &&
length(defaults$color) &&
!is.na(defaults$color[1]) &&
defaults$color[1] %in% c("#000000", "black")) {
warning("Texture will be invisible on black surface", call. = FALSE)
}
Expand Down
7 changes: 5 additions & 2 deletions src/gl.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#ifndef RGL_NO_OPENGL

/**
* SPDX-License-Identifier: (WTFPL OR CC0-1.0) AND Apache-2.0
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* put this here to avoid warning about empty file */

#ifndef RGL_NO_OPENGL

#include <glad/gl.h>

#ifndef GLAD_IMPL_UTIL_C_
Expand Down

0 comments on commit 3f536d5

Please sign in to comment.