@@ -159,13 +159,13 @@ bool chr::MDAModel::Parse( const std::string &buf )
159159 }
160160
161161 Profile profile;
162- if ( !ParseProfile ( profile, ss ) )
162+ if ( !profile. Parse ( ss ) )
163163 {
164164 Com_Printf ( " Failed to parse MDA profile (%s)!\n " , tag.c_str () );
165165 return false ;
166166 }
167167
168- profiles.insert ( std::make_pair ( tag, Profile () ) );
168+ profiles.insert ( std::make_pair ( tag, profile ) );
169169 }
170170 else if ( token == " headtri" )
171171 {
@@ -197,7 +197,7 @@ bool chr::MDAModel::Parse( const std::string &buf )
197197 return true ;
198198}
199199
200- bool chr::MDAModel::ParseProfile ( Profile &profile, std::stringstream &ss )
200+ bool chr::MDAModel::Profile::Parse ( std::stringstream &ss )
201201{
202202 std::string token;
203203 while ( ss >> token )
@@ -219,9 +219,9 @@ bool chr::MDAModel::ParseProfile( Profile &profile, std::stringstream &ss )
219219 return false ;
220220 }
221221
222- profile. evaluation = token;
223- profile. evaluation .erase ( std::remove ( profile. evaluation .begin (), profile. evaluation .end (), ' \" ' ),
224- profile. evaluation .end () );
222+ evaluation = token;
223+ evaluation.erase ( std::remove ( evaluation.begin (), evaluation.end (), ' \" ' ),
224+ evaluation.end () );
225225 }
226226 else if ( token == " skin" )
227227 {
@@ -232,21 +232,21 @@ bool chr::MDAModel::ParseProfile( Profile &profile, std::stringstream &ss )
232232 }
233233
234234 Skin skin;
235- if ( !ParseSkin ( skin, ss ) )
235+ if ( !skin. Parse ( ss ) )
236236 {
237237 Com_Printf ( " Failed to parse MDA skin!\n " );
238238 return false ;
239239 }
240240
241- profile. skins .push_back ( skin );
241+ skins.push_back ( skin );
242242 }
243243 else
244244 {
245245 Com_Printf ( " Unknown token (%s), ignoring!\n " , token.c_str () );
246246 }
247247 }
248248
249- if ( profile. skins .empty () )
249+ if ( skins.empty () )
250250 {
251251 Com_Printf ( " Encountered an empty profile!\n " );
252252 return false ;
@@ -255,7 +255,7 @@ bool chr::MDAModel::ParseProfile( Profile &profile, std::stringstream &ss )
255255 return true ;
256256}
257257
258- bool chr::MDAModel::ParseSkin ( Skin &skin, std::stringstream &ss )
258+ bool chr::MDAModel::Skin::Parse ( std::stringstream &ss )
259259{
260260 std::string token;
261261 while ( ss >> token )
@@ -278,13 +278,13 @@ bool chr::MDAModel::ParseSkin( Skin &skin, std::stringstream &ss )
278278 }
279279
280280 Pass pass;
281- if ( !ParsePass ( pass, ss ) )
281+ if ( !pass. Parse ( ss ) )
282282 {
283283 Com_Printf ( " Failed to parse MDA pass!\n " );
284284 return false ;
285285 }
286286
287- skin. passes .push_back ( pass );
287+ passes.push_back ( pass );
288288 }
289289 else
290290 {
@@ -295,7 +295,7 @@ bool chr::MDAModel::ParseSkin( Skin &skin, std::stringstream &ss )
295295 return false ;
296296}
297297
298- bool chr::MDAModel::ParsePass ( Pass &pass, std::stringstream &ss )
298+ bool chr::MDAModel::Pass::Parse ( std::stringstream &ss )
299299{
300300 std::string token;
301301 while ( ss >> token )
@@ -325,7 +325,7 @@ bool chr::MDAModel::ParsePass( Pass &pass, std::stringstream &ss )
325325 token += " .tga" ;
326326 }
327327
328- pass. map = GL_FindImage ( token. c_str () , it_skin );
328+ map = GL_FindImage ( token, it_skin );
329329 }
330330 else if ( token == " alphafunc" )
331331 {
@@ -335,9 +335,9 @@ bool chr::MDAModel::ParsePass( Pass &pass, std::stringstream &ss )
335335 return false ;
336336 }
337337
338- if ( token == " gt0" ) { pass. alpha = Pass:: AlphaFunc::GT0; }
339- else if ( token == " ge128" ) { pass. alpha = Pass:: AlphaFunc::GE128; }
340- else if ( token == " lt128" ) { pass. alpha = Pass:: AlphaFunc::LT128; }
338+ if ( token == " gt0" ) { alpha = AlphaFunc::GT0; }
339+ else if ( token == " ge128" ) { alpha = AlphaFunc::GE128; }
340+ else if ( token == " lt128" ) { alpha = AlphaFunc::LT128; }
341341 else
342342 {
343343 Com_Printf ( " Unknown alphafunc type (%s)!\n " , token.c_str () );
@@ -351,10 +351,10 @@ bool chr::MDAModel::ParsePass( Pass &pass, std::stringstream &ss )
351351 return false ;
352352 }
353353
354- if ( token == " none" ) { pass. rgb = Pass:: RGBGen::NONE; }
355- else if ( token == " identity" ) { pass. rgb = Pass:: RGBGen::IDENTITY; }
356- else if ( token == " diffusezero" ) { pass. rgb = Pass:: RGBGen::DIFFUSE_ZERO; }
357- else if ( token == " ambient" ) { pass. rgb = Pass:: RGBGen::AMBIENT; }
354+ if ( token == " none" ) { rgb = RGBGen::NONE; }
355+ else if ( token == " identity" ) { rgb = RGBGen::IDENTITY; }
356+ else if ( token == " diffusezero" ) { rgb = RGBGen::DIFFUSE_ZERO; }
357+ else if ( token == " ambient" ) { rgb = RGBGen::AMBIENT; }
358358 else
359359 {
360360 Com_Printf ( " Unknown rgbgen type (%s)!\n " , token.c_str () );
@@ -368,10 +368,10 @@ bool chr::MDAModel::ParsePass( Pass &pass, std::stringstream &ss )
368368 return false ;
369369 }
370370
371- if ( token == " none" ) { pass. blend = Pass:: BlendMode::NONE; }
372- else if ( token == " normal" ) { pass. blend = Pass:: BlendMode::NORMAL; }
373- else if ( token == " multiply" ) { pass. blend = Pass:: BlendMode::MULTIPLY; }
374- else if ( token == " add" ) { pass. blend = Pass:: BlendMode::ADD; }
371+ if ( token == " none" ) { blend = BlendMode::NONE; }
372+ else if ( token == " normal" ) { blend = BlendMode::NORMAL; }
373+ else if ( token == " multiply" ) { blend = BlendMode::MULTIPLY; }
374+ else if ( token == " add" ) { blend = BlendMode::ADD; }
375375 else
376376 {
377377 Com_Printf ( " Unknown blend mode (%s)!\n " , token.c_str () );
@@ -385,9 +385,9 @@ bool chr::MDAModel::ParsePass( Pass &pass, std::stringstream &ss )
385385 return false ;
386386 }
387387
388- if ( token == " none" ) { pass. cull = Pass:: CullMode::NONE; }
389- else if ( token == " front" ) { pass. cull = Pass:: CullMode::FRONT; }
390- else if ( token == " back" ) { pass. cull = Pass:: CullMode::BACK; }
388+ if ( token == " none" ) { cull = CullMode::NONE; }
389+ else if ( token == " front" ) { cull = CullMode::FRONT; }
390+ else if ( token == " back" ) { cull = CullMode::BACK; }
391391 else
392392 {
393393 Com_Printf ( " Unknown cull mode (%s)!\n " , token.c_str () );
@@ -401,7 +401,7 @@ bool chr::MDAModel::ParsePass( Pass &pass, std::stringstream &ss )
401401 return false ;
402402 }
403403
404- if ( token == " sphere" ) { pass. uvgen = Pass:: UVGen::SPHERE; }
404+ if ( token == " sphere" ) { uvgen = UVGen::SPHERE; }
405405 else
406406 {
407407 Com_Printf ( " Unknown uvgen mode (%s)!\n " , token.c_str () );
@@ -417,8 +417,8 @@ bool chr::MDAModel::ParsePass( Pass &pass, std::stringstream &ss )
417417
418418 if ( token == " scroll" )
419419 {
420- pass. uvMod = Pass:: UVMod::SCROLL;
421- if ( !( ss >> pass. uvModScroll .x >> pass. uvModScroll .y ) )
420+ uvMod = UVMod::SCROLL;
421+ if ( !( ss >> uvModScroll.x >> uvModScroll.y ) )
422422 {
423423 Com_Printf ( " Expected 'x y' after 'scroll'!\n " );
424424 return false ;
@@ -437,9 +437,9 @@ bool chr::MDAModel::ParsePass( Pass &pass, std::stringstream &ss )
437437 return false ;
438438 }
439439
440- if ( token == " none" ) { pass. depth = Pass:: DepthFunc::NONE; }
441- else if ( token == " equal" ) { pass. depth = Pass:: DepthFunc::EQUAL; }
442- else if ( token == " less" ) { pass. depth = Pass:: DepthFunc::LESS; }
440+ if ( token == " none" ) { depth = DepthFunc::NONE; }
441+ else if ( token == " equal" ) { depth = DepthFunc::EQUAL; }
442+ else if ( token == " less" ) { depth = DepthFunc::LESS; }
443443 else
444444 {
445445 Com_Printf ( " Unknown depthfunc mode (%s)!\n " , token.c_str () );
@@ -453,8 +453,8 @@ bool chr::MDAModel::ParsePass( Pass &pass, std::stringstream &ss )
453453 return false ;
454454 }
455455
456- if ( token == " 1" ) { pass. depthWrite = true ; }
457- else if ( token == " 0" ) { pass. depthWrite = false ; }
456+ if ( token == " 1" ) { depthWrite = true ; }
457+ else if ( token == " 0" ) { depthWrite = false ; }
458458 else
459459 {
460460 Com_Printf ( " Unknown depthwrite mode (%s)!\n " , token.c_str () );
0 commit comments