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