Changeset 8536 in orxonox.OLD for branches/bsp_model/src/lib/graphics
- Timestamp:
- Jun 16, 2006, 4:01:25 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/md3/md3_animation_cfg.cc
r8535 r8536 89 89 while( (read = getline(&cLine, &len, pFile)) != -1) { /*( !this->dataStream.eof()) {*/ 90 90 std::string line(cLine); 91 92 PRINTF(0)("size = %i, line = |%s|\n", read, line.c_str()); 91 93 92 94 //ignore empty lines and comments … … 98 100 Tokenizer::tokenize(line, tokens, " \t\n\r\f/"); 99 101 100 PRINTF(0)("size = %i, line = |%s|\n", read, line.c_str()); 101 102 while( !tokens.empty()) 103 { 104 PRINTF(0)("tokens: %s\n", tokens.back().c_str()); 105 tokens.pop_back(); 102 std::string sexStr = tokens.back(); 103 // probably error in the file format 104 if( sexStr.length() != 1) { 105 this->sex = '?'; 106 PRINTF(2)("no section \"sex\" in the config file %s found\n", filename.c_str()); 106 107 } 107 108 else { 109 this->sex = sexStr[0]; 110 } 111 112 PRINTF(0)("sex of the md3 model: %c\n", this->sex); 108 113 } 114 else if (inHeader && line.find("headoffset") == 0) { 115 // parse line: headoffset X Y Z 116 std::vector<std::string> tokens; 117 Tokenizer::tokenize(line, tokens, " \t\n\r\f/"); 118 119 // while( !tokens.empty()) 120 // { 121 // PRINTF(0)("tokens: %s\n", tokens.back().c_str()); 122 // tokens.pop_back(); 123 // } 124 125 // newAnimCfg.headOffset= 126 // new md3.util.Vec3(new Float(st.nextToken()).floatValue(), 127 // new Float(st.nextToken()).floatValue(), 128 // new Float(st.nextToken()).floatValue()); 129 } 109 130 } 110 131 } 111 /* 112 st.nextToken(); //throw away first token 113 String sexStr=st.nextToken(); 114 if (sexStr.length()!=1) 115 //non-fatal error, don't thow exception 116 newAnimCfg.sex='?'; 117 else 118 newAnimCfg.sex=sexStr.charAt(0); 119 } 120 else if (IN_HEADER && line.startsWith("headoffset")) { 121 //parse line: headoffset X Y Z 122 StringTokenizer st=new StringTokenizer(line, " \t\n\r\f/"); 123 124 st.nextToken(); //throw away first token 125 126 newAnimCfg.headOffset= 127 new md3.util.Vec3(new Float(st.nextToken()).floatValue(), 128 new Float(st.nextToken()).floatValue(), 129 new Float(st.nextToken()).floatValue()); 130 } 132 /* 131 133 else if (IN_HEADER && line.startsWith("footsteps")) { 132 134 //parse line: footsteps [normal | mech | ...]
Note: See TracChangeset
for help on using the changeset viewer.