| 434 | } |
| 435 | |
| 436 | void BMFontConfiguration::parseCommonArguments(const char* line) |
| 437 | { |
| 438 | ////////////////////////////////////////////////////////////////////////// |
| 439 | // line to parse: |
| 440 | // common lineHeight=104 base=26 scaleW=1024 scaleH=512 pages=1 packed=0 |
| 441 | ////////////////////////////////////////////////////////////////////////// |
| 442 | |
| 443 | // Height |
| 444 | auto tmp = strstr(line, "lineHeight=") + 11; |
| 445 | sscanf(tmp, "%d", &_commonHeight); |
| 446 | |
| 447 | #if _AX_DEBUG > 0 |
| 448 | // scaleW. sanity check |
| 449 | int value; |
| 450 | tmp = strstr(tmp, "scaleW=") + 7; |
| 451 | sscanf(tmp, "%d", &value); |
| 452 | |
| 453 | int maxTextureSize = Configuration::getInstance()->getMaxTextureSize(); |
| 454 | AXASSERT(value <= maxTextureSize, "CCLabelBMFont: page can't be larger than supported"); |
| 455 | |
| 456 | // scaleH. sanity check |
| 457 | tmp = strstr(tmp, "scaleH=") + 7; |
| 458 | sscanf(tmp, "%d", &value); |
| 459 | AXASSERT(value <= maxTextureSize, "CCLabelBMFont: page can't be larger than supported"); |
| 460 | |
| 461 | // pages. sanity check |
| 462 | tmp = strstr(tmp, "pages=") + 6; |
| 463 | sscanf(tmp, "%d", &value); |
| 464 | AXASSERT(value == 1, "CCBitfontAtlas: only supports 1 page"); |
| 465 | #endif |
| 466 | // packed (ignore) What does this mean ?? |
| 467 | } |
| 468 | |
| 469 | unsigned int BMFontConfiguration::parseCharacterDefinition(const char* line) |
| 470 | { |
no test coverage detected