diff --git a/source/parser/parser_expressions.cpp b/source/parser/parser_expressions.cpp index a39a5c56a..2f1d53334 100644 --- a/source/parser/parser_expressions.cpp +++ b/source/parser/parser_expressions.cpp @@ -1212,6 +1212,7 @@ void Parser::Parse_Num_Factor (EXPRESS& Express,int *Terms) case MAX_EXTENT_TOKEN: GET (LEFT_PAREN_TOKEN); EXPECT + CASE (OBJECT_ID_TOKEN) Object = reinterpret_cast(Token.Data); if ( Object ) @@ -1220,18 +1221,25 @@ void Parser::Parse_Num_Factor (EXPRESS& Express,int *Terms) END_CASE // JN2007: Image map dimensions: - CASE (PIGMENT_ID_TOKEN) + CASE3 (DENSITY_ID_TOKEN,PIGMENT_ID_TOKEN,TNORMAL_ID_TOKEN) Pigment = reinterpret_cast(Token.Data); - if(Pigment->Type != BITMAP_PATTERN) - { - Error("The parameter to max_extent must be an image map pigment identifier"); - } - else + if(Pigment->Type == BITMAP_PATTERN) { Vect[X] = dynamic_cast(Pigment->pattern.get())->pImage->iwidth; Vect[Y] = dynamic_cast(Pigment->pattern.get())->pImage->iheight; Vect[Z] = 0; } + else if(Pigment->Type == DENSITY_FILE_PATTERN) + { + Vect[X] = dynamic_cast(Pigment->pattern.get())->densityFile->Data->Sx; + Vect[Y] = dynamic_cast(Pigment->pattern.get())->densityFile->Data->Sy; + Vect[Z] = dynamic_cast(Pigment->pattern.get())->densityFile->Data->Sz; + } + else + { + Error("\rThe parameter to max_extent must be a bump_map, image map\r" + "or density_file form of a normal, pigment or density identifier."); + } EXIT END_CASE