cleanup msMaterial
This commit is contained in:
@@ -179,7 +179,7 @@ void Model::LoadMaterialsFromMilkshapeAscii( CString sPath )
|
||||
THROW
|
||||
if (sscanf (sLine, "\"%[^\"]\"", szName) != 1)
|
||||
THROW
|
||||
strcpy( Material.szName, szName );
|
||||
Material.sName = szName;
|
||||
|
||||
// ambient
|
||||
if( f.GetLine( sLine ) <= 0 )
|
||||
@@ -235,11 +235,11 @@ void Model::LoadMaterialsFromMilkshapeAscii( CString sPath )
|
||||
THROW
|
||||
strcpy (szName, "");
|
||||
sscanf (sLine, "\"%[^\"]\"", szName);
|
||||
strcpy( Material.szDiffuseTexture, szName );
|
||||
CString sDiffuseTexture = szName;
|
||||
|
||||
if( strcmp(Material.szDiffuseTexture, "")!=0 )
|
||||
if( sDiffuseTexture != "" )
|
||||
{
|
||||
CString sTexturePath = sDir + Material.szDiffuseTexture;
|
||||
CString sTexturePath = sDir + sDiffuseTexture;
|
||||
FixSlashesInPlace( sTexturePath );
|
||||
CollapsePath( sTexturePath );
|
||||
if( IsAFile(sTexturePath) )
|
||||
@@ -256,11 +256,11 @@ void Model::LoadMaterialsFromMilkshapeAscii( CString sPath )
|
||||
THROW
|
||||
strcpy (szName, "");
|
||||
sscanf (sLine, "\"%[^\"]\"", szName);
|
||||
strcpy( Material.szAlphaTexture, szName );
|
||||
CString sAlphaTexture = szName;
|
||||
|
||||
if( strcmp(Material.szAlphaTexture, "")!=0 )
|
||||
if( sAlphaTexture != "" )
|
||||
{
|
||||
CString sTexturePath = sDir + Material.szAlphaTexture;
|
||||
CString sTexturePath = sDir + sAlphaTexture;
|
||||
FixSlashesInPlace( sTexturePath );
|
||||
CollapsePath( sTexturePath );
|
||||
if( IsAFile(sTexturePath) )
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#define MODEL_TYPES_H
|
||||
|
||||
#define MS_MAX_NAME 32
|
||||
#define MS_MAX_PATH 256
|
||||
|
||||
#ifndef byte
|
||||
typedef unsigned char byte;
|
||||
@@ -109,15 +108,13 @@ private:
|
||||
typedef struct msMaterial
|
||||
{
|
||||
int nFlags;
|
||||
char szName[MS_MAX_NAME];
|
||||
CString sName;
|
||||
RageColor Ambient;
|
||||
RageColor Diffuse;
|
||||
RageColor Specular;
|
||||
RageColor Emissive;
|
||||
float fShininess;
|
||||
float fTransparency;
|
||||
char szDiffuseTexture[MS_MAX_PATH];
|
||||
char szAlphaTexture[MS_MAX_PATH]; // not used in SM. Use alpha in diffuse texture instead
|
||||
int nName; // not used in SM. What is this for anyway?
|
||||
|
||||
AnimatedTexture diffuse;
|
||||
|
||||
Reference in New Issue
Block a user