Skip to content

Commit

Permalink
Fix to compile with mingw-w64
Browse files Browse the repository at this point in the history
There is a macro called `RGB` somewhere in mingw-w64(gcc7.2.0)
The macro conflicts with the variable `RGB` in writeOFF.cpp
Simple renaming solves the problem.
  • Loading branch information
metorm committed Jan 18, 2018
1 parent ee4a00b commit d1cc25b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/igl/writeOFF.cpp
Expand Up @@ -61,13 +61,13 @@ IGL_INLINE bool igl::writeOFF(

//Check if RGB values are in the range [0..1] or [0..255]
int rgbScale = (C.maxCoeff() <= 1.0)?255:1;
Eigen::MatrixXd RGB = rgbScale * C;
Eigen::MatrixXd RGB_Array = rgbScale * C;

s<< "COFF\n"<<V.rows()<<" "<<F.rows()<<" 0\n";
for (unsigned i=0; i< V.rows(); i++)
{
s <<V.row(i).format(IOFormat(FullPrecision,DontAlignCols," "," ","","",""," "));
s << unsigned(RGB(i,0)) << " " << unsigned(RGB(i,1)) << " " << unsigned(RGB(i,2)) << " 255\n";
s << unsigned(RGB_Array(i,0)) << " " << unsigned(RGB_Array(i,1)) << " " << unsigned(RGB_Array(i,2)) << " 255\n";
}

s<<(F.array()).format(IOFormat(FullPrecision,DontAlignCols," ","\n","3 ","","","\n"));
Expand Down

0 comments on commit d1cc25b

Please sign in to comment.