summaryrefslogtreecommitdiff
path: root/graphics/asymptote/jsfile.cc
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-10-05 03:01:15 +0000
committerNorbert Preining <norbert@preining.info>2019-10-05 03:01:15 +0000
commit72c9345e5bafe708888bf65448a81d1aee8275ed (patch)
treea1a99929b3d7307572844833f09ad7ba5ad1405d /graphics/asymptote/jsfile.cc
parent9d9c04e14d0da9dd7829d0ec896aabfd50414fd8 (diff)
CTAN sync 201910050301
Diffstat (limited to 'graphics/asymptote/jsfile.cc')
-rw-r--r--graphics/asymptote/jsfile.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/graphics/asymptote/jsfile.cc b/graphics/asymptote/jsfile.cc
index f838ce14c5..02a1f7f9c3 100644
--- a/graphics/asymptote/jsfile.cc
+++ b/graphics/asymptote/jsfile.cc
@@ -73,10 +73,14 @@ void jsfile::open(string name) {
size_t i4=4*i;
out << "new Light(" << newl
<< "direction=" << gl::Lights[i] << "," << newl
- << "color=[" << gl::Diffuse[i4] << "," << gl::Diffuse[i4+1]
- << "," << gl::Diffuse[i4+2] << "])," << newl;
+ << "color=[" << gl::Diffuse[i4] << "," << gl::Diffuse[i4+1] << ","
+ << gl::Diffuse[i4+2] << "])," << newl;
}
out << "];" << newl << newl;
+ out << "Background=[" << gl::Background[0] << "," << gl::Background[1] << ","
+ << gl::Background[2] << "," << gl::Background[3] << "];"
+ << newl;
+
size_t nmaterials=material.size();
out << "Materials=[";
for(size_t i=0; i < nmaterials; ++i)
@@ -115,7 +119,7 @@ bool distinct(const uint32_t *I, const uint32_t *J)
void jsfile::addPatch(triple const* controls, size_t n,
const triple& Min, const triple& Max,
- const prc::RGBAColour *c)
+ const prc::RGBAColour *c, size_t nc)
{
out << "P.push(new BezierPatch([" << newl;
size_t last=n-1;
@@ -126,7 +130,7 @@ void jsfile::addPatch(triple const* controls, size_t n,
<< Min << "," << Max;
if(c) {
out << ",[" << newl;
- for(int i=0; i < 4; ++i) {
+ for(size_t i=0; i < nc; ++i) {
addColor(c[i]);
out << "," << newl;
}