Skip to content

Commit

Permalink
Fixed material badParse leftover
Browse files Browse the repository at this point in the history
I missed one thing. Material parser also tried to parse point separated value.
  • Loading branch information
MaKiPL committed Jul 12, 2015
1 parent f5d51e6 commit dda8896
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ private System.Drawing.Color ReadMaterialColor(string line, float alpha)
string[] lineParts = line.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
if (lineParts.Length >= 4)
{
lineParts[1] = lineParts[1].Replace(".", ",");
lineParts[2] = lineParts[1].Replace(".", ",");
lineParts[3] = lineParts[1].Replace(".", ",");
// Convert float a,r,g,b values to byte values. Make sure they fall in 0-255 range.
int a = Convert.ToInt32(255 * alpha);
if (a < 0) a = 0; if (a > 255) a = 255;
Expand Down

0 comments on commit dda8896

Please sign in to comment.