| | 208 | if (fr[0].matchWord("shadowComparison")) |
| | 209 | { |
| | 210 | if (fr[1].matchWord("TRUE")) |
| | 211 | { |
| | 212 | texture.setShadowComparison(true); |
| | 213 | fr +=2 ; |
| | 214 | iteratorAdvanced = true; |
| | 215 | } |
| | 216 | else if (fr[1].matchWord("FALSE")) |
| | 217 | { |
| | 218 | texture.setShadowComparison(false); |
| | 219 | fr +=2 ; |
| | 220 | iteratorAdvanced = true; |
| | 221 | } |
| | 222 | } |
| | 223 | |
| | 224 | if (fr[0].matchWord("shadowCompareFunc")) |
| | 225 | { |
| | 226 | Texture::ShadowCompareFunc value; |
| | 227 | if (Texture_matchShadowCompareFuncStr(fr[1].getStr(),value)) |
| | 228 | { |
| | 229 | texture.setShadowCompareFunc(value); |
| | 230 | fr+=2; |
| | 231 | iteratorAdvanced = true; |
| | 232 | } |
| | 233 | } |
| | 234 | |
| | 235 | if (fr[0].matchWord("shadowTextureMode")) |
| | 236 | { |
| | 237 | Texture::ShadowTextureMode value; |
| | 238 | if (Texture_matchShadowTextureModeStr(fr[1].getStr(),value)) |
| | 239 | { |
| | 240 | texture.setShadowTextureMode(value); |
| | 241 | fr+=2; |
| | 242 | iteratorAdvanced = true; |
| | 243 | } |
| | 244 | } |
| | 245 | |
| | 491 | |
| | 492 | bool Texture_matchShadowCompareFuncStr(const char* str, Texture::ShadowCompareFunc& value) |
| | 493 | { |
| | 494 | if ( strcmp(str,"GL_LEQUAL")==0) value = Texture::LEQUAL; |
| | 495 | else if (strcmp(str,"GL_GEQUAL")==0) value = Texture::GEQUAL; |
| | 496 | else return false; |
| | 497 | |
| | 498 | return true; |
| | 499 | } |
| | 500 | |
| | 501 | const char* Texture_getShadowCompareFuncStr(Texture::ShadowCompareFunc value) |
| | 502 | { |
| | 503 | switch(value) |
| | 504 | { |
| | 505 | case( Texture::LEQUAL ): return "GL_LEQUAL"; |
| | 506 | case( Texture::GEQUAL ): return "GL_GEQUAL"; |
| | 507 | } |
| | 508 | return NULL; |
| | 509 | } |
| | 510 | |
| | 511 | bool Texture_matchShadowTextureModeStr(const char* str,Texture::ShadowTextureMode& value) |
| | 512 | { |
| | 513 | if ( strcmp(str,"GL_LUMINANCE")==0) value = Texture::LUMINANCE; |
| | 514 | else if (strcmp(str,"GL_INTENSITY")==0) value = Texture::INTENSITY; |
| | 515 | else if (strcmp(str,"GL_ALPHA")==0) value = Texture::ALPHA; |
| | 516 | else return false; |
| | 517 | |
| | 518 | return true; |
| | 519 | } |
| | 520 | |
| | 521 | const char* Texture_getShadowTextureModeStr(Texture::ShadowTextureMode value) |
| | 522 | { |
| | 523 | switch(value) |
| | 524 | { |
| | 525 | case( Texture::LUMINANCE ): return "GL_LUMINANCE"; |
| | 526 | case( Texture::INTENSITY ): return "GL_INTENSITY"; |
| | 527 | case( Texture::ALPHA ): return "GL_ALPHA"; |
| | 528 | } |
| | 529 | return NULL; |
| | 530 | } |