| 576 | } |
| 577 | |
| 578 | void PrintAnnotations( YamlOutput& listing, const std::map<StringReference, Annotation>& annotations ) |
| 579 | { |
| 580 | if( !listing.enabled() ) |
| 581 | { |
| 582 | return; |
| 583 | } |
| 584 | listing.literal( "annotations" ).list(); |
| 585 | for( auto a = annotations.begin(); a != annotations.end(); ++a ) |
| 586 | { |
| 587 | listing.dict() |
| 588 | .literal( "name" ) |
| 589 | .literal( g_stringTable.GetString( a->first ) ) |
| 590 | .literal( "annotationType" ); |
| 591 | switch( a->second.type ) |
| 592 | { |
| 593 | case ANNOTATION_TYPE_BOOL: |
| 594 | listing |
| 595 | .literal( "bool" ) |
| 596 | .literal( "value" ) |
| 597 | .literal( a->second.intValue != 0 ); |
| 598 | break; |
| 599 | case ANNOTATION_TYPE_INT: |
| 600 | listing |
| 601 | .literal( "int" ) |
| 602 | .literal( "value" ) |
| 603 | .literal( a->second.intValue ); |
| 604 | break; |
| 605 | case ANNOTATION_TYPE_FLOAT: |
| 606 | listing |
| 607 | .literal( "float" ) |
| 608 | .literal( "value" ) |
| 609 | .literal( a->second.floatValue ); |
| 610 | break; |
| 611 | default: |
| 612 | listing |
| 613 | .literal( "string" ) |
| 614 | .literal( "value" ) |
| 615 | .literal( g_stringTable.GetString( a->second.stringValue ) ); |
| 616 | break; |
| 617 | } |
| 618 | listing.end(); |
| 619 | } |
| 620 | listing.end(); |
| 621 | } |
| 622 | |
| 623 | |
| 624 | YamlOutput& YamlTextureType( YamlOutput& listing, TextureType type ) |
no test coverage detected