---------------------------------------------------------------------
| 89 | } |
| 90 | //--------------------------------------------------------------------- |
| 91 | void FontManager::parseScript( DataStreamPtr &stream, const String &groupName ) |
| 92 | { |
| 93 | String line; |
| 94 | FontPtr pFont; |
| 95 | |
| 96 | while( !stream->eof() ) |
| 97 | { |
| 98 | line = stream->getLine(); |
| 99 | // Ignore blanks & comments |
| 100 | if( !line.length() || line.substr( 0, 2 ) == "//" ) |
| 101 | { |
| 102 | continue; |
| 103 | } |
| 104 | else |
| 105 | { |
| 106 | if( !pFont ) |
| 107 | { |
| 108 | // No current font |
| 109 | // So first valid data should be font name |
| 110 | if( StringUtil::startsWith( line, "font " ) ) |
| 111 | { |
| 112 | // chop off the 'particle_system ' needed by new compilers |
| 113 | line = line.substr( 5 ); |
| 114 | } |
| 115 | pFont = create( line, groupName ); |
| 116 | pFont->_notifyOrigin( stream->getName() ); |
| 117 | // Skip to and over next { |
| 118 | stream->skipLine( "{" ); |
| 119 | } |
| 120 | else |
| 121 | { |
| 122 | // Already in font |
| 123 | if( line == "}" ) |
| 124 | { |
| 125 | // Finished |
| 126 | pFont.reset(); |
| 127 | // NB font isn't loaded until required |
| 128 | } |
| 129 | else |
| 130 | { |
| 131 | parseAttribute( line, pFont ); |
| 132 | } |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | //--------------------------------------------------------------------- |
| 138 | void FontManager::parseAttribute( const String &line, FontPtr &pFont ) |
| 139 | { |