split Model into ModelGeometry and materials+animations

single-instance Model geometry
This commit is contained in:
Chris Danford
2004-02-08 09:04:23 +00:00
parent 5bdae36979
commit 4106625ad3
10 changed files with 462 additions and 165 deletions
+2 -2
View File
@@ -185,7 +185,7 @@ RageFileDriverZip.cpp RageFileDriverZip.h
Rage = $(Helpers) $(PCRE)\ Rage = $(Helpers) $(PCRE)\
RageBitmapTexture.cpp RageBitmapTexture.h RageDisplay.cpp RageDisplay.h RageDisplay_OGL.cpp RageDisplay_OGL.h \ RageBitmapTexture.cpp RageBitmapTexture.h RageDisplay.cpp RageDisplay.h RageDisplay_OGL.cpp RageDisplay_OGL.h \
RageException.cpp RageException.h RageInput.cpp RageInput.h \ RageException.cpp RageException.h RageInput.cpp RageInput.h \
RageInputDevice.cpp RageInputDevice.h RageLog.cpp RageLog.h RageMath.cpp RageMath.h RageSound.cpp RageSound.h \ RageInputDevice.cpp RageInputDevice.h RageLog.cpp RageLog.h RageMath.cpp RageMath.h RageModelGeometry.cpp RageModelGeometry.h RageSound.cpp RageSound.h \
RageSoundManager.cpp RageSoundManager.h RageSoundReader.h RageSoundReader_FileReader.cpp RageSoundReader_FileReader.h \ RageSoundManager.cpp RageSoundManager.h RageSoundReader.h RageSoundReader_FileReader.cpp RageSoundReader_FileReader.h \
RageSoundReader_Preload.cpp RageSoundReader_Preload.h RageSoundReader_Resample.cpp RageSoundReader_Resample.h \ RageSoundReader_Preload.cpp RageSoundReader_Preload.h RageSoundReader_Resample.cpp RageSoundReader_Resample.h \
RageSoundReader_Resample_Fast.cpp RageSoundReader_Resample_Fast.h RageSoundReader_Resample_Good.cpp RageSoundReader_Resample_Good.h \ RageSoundReader_Resample_Fast.cpp RageSoundReader_Resample_Fast.h RageSoundReader_Resample_Good.cpp RageSoundReader_Resample_Good.h \
@@ -198,7 +198,7 @@ $(RageFile)
Actors = \ Actors = \
Actor.cpp Actor.h ActorCollision.h ActorCommands.cpp ActorCommands.h ActorFrame.cpp ActorFrame.h ActorScroller.cpp ActorScroller.h \ Actor.cpp Actor.h ActorCollision.h ActorCommands.cpp ActorCommands.h ActorFrame.cpp ActorFrame.h ActorScroller.cpp ActorScroller.h \
ActorUtil.cpp ActorUtil.h BitmapText.cpp BitmapText.h Milkshape.h Model.cpp Model.h ModelTypes.cpp ModelTypes.h \ ActorUtil.cpp ActorUtil.h BitmapText.cpp BitmapText.h Milkshape.h Model.cpp Model.h ModelManager.cpp ModelManager.h ModelTypes.cpp ModelTypes.h \
Quad.h Sprite.cpp Sprite.h Quad.h Sprite.cpp Sprite.h
GlobalSingletons = \ GlobalSingletons = \
+31 -147
View File
@@ -20,6 +20,7 @@
#include "RageLog.h" #include "RageLog.h"
#include "ActorUtil.h" #include "ActorUtil.h"
#include <errno.h> #include <errno.h>
#include "ModelManager.h"
const float FRAMES_PER_SECOND = 30; const float FRAMES_PER_SECOND = 30;
const CString DEFAULT_ANIMATION_NAME = "default"; const CString DEFAULT_ANIMATION_NAME = "default";
@@ -28,10 +29,12 @@ Model::Model ()
{ {
m_bTextureWrapping = true; m_bTextureWrapping = true;
SetUseZBuffer( true ); SetUseZBuffer( true );
m_pGeometry = NULL;
m_pCurAnimation = NULL; m_pCurAnimation = NULL;
m_bRevertToDefaultAnimation = false; m_bRevertToDefaultAnimation = false;
m_fDefaultAnimationRate = 1; m_fDefaultAnimationRate = 1;
m_fCurAnimationRate = 1; m_fCurAnimationRate = 1;
m_iRefCount = 1;
} }
Model::~Model () Model::~Model ()
@@ -41,8 +44,12 @@ Model::~Model ()
void Model::Clear () void Model::Clear ()
{ {
if( m_pGeometry )
{
MODELMAN->UnloadModel( m_pGeometry );
m_pGeometry = NULL;
}
m_vpBones.clear(); m_vpBones.clear();
m_Meshes.clear();
m_Materials.clear(); m_Materials.clear();
m_mapNameToAnimation.clear(); m_mapNameToAnimation.clear();
m_pCurAnimation = NULL; m_pCurAnimation = NULL;
@@ -63,10 +70,10 @@ bool Model::LoadMilkshapeAscii( CString sPath )
CString sLine; CString sLine;
int iLineNum = 0; int iLineNum = 0;
char szName[MS_MAX_NAME]; int i;
int nFlags, nIndex, i, j;
RageVec3ClearBounds( m_vMins, m_vMaxs ); ASSERT( m_pGeometry == NULL );
m_pGeometry = MODELMAN->LoadMilkshapeAscii( sPath );
while( f.GetLine( sLine ) > 0 ) while( f.GetLine( sLine ) > 0 )
{ {
@@ -87,136 +94,6 @@ bool Model::LoadMilkshapeAscii( CString sPath )
// m_pModel->nFrame = nFrame; // m_pModel->nFrame = nFrame;
} }
int nNumMeshes = 0;
if (sscanf (sLine, "Meshes: %d", &nNumMeshes) == 1)
{
m_Meshes.resize( nNumMeshes );
for (i = 0; i < nNumMeshes; i++)
{
msMesh& mesh = m_Meshes[i];
if( f.GetLine( sLine ) <= 0 )
THROW
// mesh: name, flags, material index
if (sscanf (sLine, "\"%[^\"]\" %d %d",szName, &nFlags, &nIndex) != 3)
THROW
strcpy( mesh.szName, szName );
// mesh.nFlags = nFlags;
mesh.nMaterialIndex = (byte)nIndex;
//
// vertices
//
if( f.GetLine( sLine ) <= 0 )
THROW
int nNumVertices = 0;
if (sscanf (sLine, "%d", &nNumVertices) != 1)
THROW
mesh.Vertices.resize( nNumVertices );
for (j = 0; j < nNumVertices; j++)
{
if( f.GetLine( sLine ) <= 0 )
THROW
RageVector3 Vertex;
RageVector2 uv;
if (sscanf (sLine, "%d %f %f %f %f %f %d",
&nFlags,
&Vertex[0], &Vertex[1], &Vertex[2],
&uv[0], &uv[1],
&nIndex
) != 7)
{
THROW
}
RageModelVertex& vertex = mesh.Vertices[j];
// vertex.nFlags = nFlags;
memcpy( vertex.p, Vertex, sizeof(vertex.p) );
memcpy( vertex.t, uv, sizeof(vertex.t) );
vertex.boneIndex = (byte)nIndex;
RageVec3AddToBounds( RageVector3(Vertex), m_vMins, m_vMaxs );
}
//
// normals
//
if( f.GetLine( sLine ) <= 0 )
THROW
int nNumNormals = 0;
if (sscanf (sLine, "%d", &nNumNormals) != 1)
THROW
vector<RageVector3> Normals;
Normals.resize( nNumNormals );
for (j = 0; j < nNumNormals; j++)
{
if( f.GetLine( sLine ) <= 0 )
THROW
RageVector3 Normal;
if (sscanf (sLine, "%f %f %f", &Normal[0], &Normal[1], &Normal[2]) != 3)
THROW
RageVec3Normalize( (RageVector3*)&Normal, (RageVector3*)&Normal );
Normals[j] = Normal;
}
//
// triangles
//
if( f.GetLine( sLine ) <= 0 )
THROW
int nNumTriangles = 0;
if (sscanf (sLine, "%d", &nNumTriangles) != 1)
THROW
mesh.Triangles.resize( nNumTriangles );
for (j = 0; j < nNumTriangles; j++)
{
if( f.GetLine( sLine ) <= 0 )
THROW
word nIndices[3];
word nNormalIndices[3];
if (sscanf (sLine, "%d %hd %hd %hd %hd %hd %hd %d",
&nFlags,
&nIndices[0], &nIndices[1], &nIndices[2],
&nNormalIndices[0], &nNormalIndices[1], &nNormalIndices[2],
&nIndex
) != 8)
{
THROW
}
// deflate the normals into vertices
for( int k=0; k<3; k++ )
{
RageModelVertex& vertex = mesh.Vertices[ nIndices[k] ];
RageVector3& normal = Normals[ nNormalIndices[k] ];
vertex.n = normal;
}
msTriangle& Triangle = mesh.Triangles[j];
// Triangle.nFlags = nFlags;
memcpy( &Triangle.nVertexIndices, nIndices, sizeof(Triangle.nVertexIndices) );
// Triangle.nSmoothingGroup = nIndex;
}
}
}
// //
// materials // materials
@@ -343,10 +220,10 @@ bool Model::LoadMilkshapeAscii( CString sPath )
bUseTempVertices = m_mapNameToAnimation[DEFAULT_ANIMATION_NAME].Bones.size() > 0; // if there are no bones, then there's no reason to use temp vertices bUseTempVertices = m_mapNameToAnimation[DEFAULT_ANIMATION_NAME].Bones.size() > 0; // if there are no bones, then there's no reason to use temp vertices
if( bUseTempVertices ) if( bUseTempVertices )
{ {
m_vTempVerticesByMesh.resize( m_Meshes.size() ); m_vTempVerticesByMesh.resize( m_pGeometry->m_Meshes.size() );
for (i = 0; i < (int)m_Meshes.size(); i++) for (i = 0; i < (int)m_pGeometry->m_Meshes.size(); i++)
{ {
msMesh& Mesh = m_Meshes[i]; msMesh& Mesh = m_pGeometry->m_Meshes[i];
m_vTempVerticesByMesh[i].resize( Mesh.Vertices.size() ); m_vTempVerticesByMesh[i].resize( Mesh.Vertices.size() );
} }
} }
@@ -496,8 +373,11 @@ bool Model::LoadMilkshapeAsciiBones( CString sAniName, CString sPath )
void Model::DrawPrimitives() void Model::DrawPrimitives()
{ {
if(m_Meshes.empty()) if( m_pGeometry == NULL ||
m_pGeometry->m_Meshes.empty() )
{
return; // bail early return; // bail early
}
/* Don't if we're fully transparent */ /* Don't if we're fully transparent */
if( m_pTempState->diffuse[0].a < 0.001f && m_pTempState->glow.a < 0.001f ) if( m_pTempState->diffuse[0].a < 0.001f && m_pTempState->glow.a < 0.001f )
@@ -512,9 +392,9 @@ void Model::DrawPrimitives()
// //
if( bUseTempVertices ) if( bUseTempVertices )
{ {
for (int i = 0; i < (int)m_Meshes.size(); i++) for (int i = 0; i < (int)m_pGeometry->m_Meshes.size(); i++)
{ {
msMesh *pMesh = &m_Meshes[i]; msMesh *pMesh = &m_pGeometry->m_Meshes[i];
RageModelVertexVector& TempVertices = m_vTempVerticesByMesh[i]; RageModelVertexVector& TempVertices = m_vTempVerticesByMesh[i];
for (int j = 0; j < (int)pMesh->Vertices.size(); j++) for (int j = 0; j < (int)pMesh->Vertices.size(); j++)
{ {
@@ -545,9 +425,9 @@ void Model::DrawPrimitives()
{ {
DISPLAY->SetTextureModeModulate(); DISPLAY->SetTextureModeModulate();
for (int i = 0; i < (int)m_Meshes.size(); i++) for (int i = 0; i < (int)m_pGeometry->m_Meshes.size(); i++)
{ {
msMesh *pMesh = &m_Meshes[i]; msMesh *pMesh = &m_pGeometry->m_Meshes[i];
RageModelVertexVector& TempVertices = bUseTempVertices ? m_vTempVerticesByMesh[i] : pMesh->Vertices; RageModelVertexVector& TempVertices = bUseTempVertices ? m_vTempVerticesByMesh[i] : pMesh->Vertices;
if( pMesh->nMaterialIndex != -1 ) // has a material if( pMesh->nMaterialIndex != -1 ) // has a material
@@ -615,9 +495,9 @@ void Model::DrawPrimitives()
{ {
DISPLAY->SetTextureModeGlow(); DISPLAY->SetTextureModeGlow();
for (int i = 0; i < (int)m_Meshes.size(); i++) for (int i = 0; i < (int)m_pGeometry->m_Meshes.size(); i++)
{ {
msMesh *pMesh = &m_Meshes[i]; msMesh *pMesh = &m_pGeometry->m_Meshes[i];
RageModelVertexVector& TempVertices = m_vTempVerticesByMesh[i]; RageModelVertexVector& TempVertices = m_vTempVerticesByMesh[i];
// apply material // apply material
@@ -719,9 +599,9 @@ void Model::PlayAnimation( CString sAniName, float fPlayRate )
} }
} }
for (i = 0; i < (int)m_Meshes.size(); i++) for (i = 0; i < (int)m_pGeometry->m_Meshes.size(); i++)
{ {
msMesh *pMesh = &m_Meshes[i]; msMesh *pMesh = &m_pGeometry->m_Meshes[i];
for (j = 0; j < (int)pMesh->Vertices.size(); j++) for (j = 0; j < (int)pMesh->Vertices.size(); j++)
{ {
RageModelVertex *pVertex = &pMesh->Vertices[j]; RageModelVertex *pVertex = &pMesh->Vertices[j];
@@ -752,8 +632,12 @@ void Model::SetFrame( float fNewFrame )
void void
Model::AdvanceFrame (float dt) Model::AdvanceFrame (float dt)
{ {
if( m_Meshes.empty() || !m_pCurAnimation ) if( m_pGeometry == NULL ||
m_pGeometry->m_Meshes.empty() ||
!m_pCurAnimation )
{
return; // bail early return; // bail early
}
m_fCurrFrame += FRAMES_PER_SECOND * dt * m_fCurAnimationRate; m_fCurrFrame += FRAMES_PER_SECOND * dt * m_fCurAnimationRate;
if (m_fCurrFrame >= (float)m_pCurAnimation->nTotalFrames) if (m_fCurrFrame >= (float)m_pCurAnimation->nTotalFrames)
+6 -2
View File
@@ -16,6 +16,7 @@
#include "ModelTypes.h" #include "ModelTypes.h"
#include <vector> #include <vector>
#include <map> #include <map>
#include "RageModelGeometry.h"
struct msModel; struct msModel;
@@ -53,13 +54,15 @@ public:
virtual void HandleCommand( const ParsedCommand &command ); virtual void HandleCommand( const ParsedCommand &command );
int m_iRefCount;
private: private:
vector<msMesh> m_Meshes; RageModelGeometry *m_pGeometry;
vector<msMaterial> m_Materials; vector<msMaterial> m_Materials;
map<CString,msAnimation> m_mapNameToAnimation; map<CString,msAnimation> m_mapNameToAnimation;
msAnimation* m_pCurAnimation; msAnimation* m_pCurAnimation;
RageVector3 m_vMins, m_vMaxs;
vector<myBone_t> m_vpBones; vector<myBone_t> m_vpBones;
// true if any vertex has a bone weight. // true if any vertex has a bone weight.
@@ -74,6 +77,7 @@ private:
CString m_sDefaultAnimation; CString m_sDefaultAnimation;
float m_fDefaultAnimationRate; float m_fDefaultAnimationRate;
float m_fCurAnimationRate; float m_fCurAnimationRate;
}; };
+82
View File
@@ -0,0 +1,82 @@
#include "global.h"
/*
-----------------------------------------------------------------------------
Class: ModelManager
Desc: See header.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "ModelManager.h"
#include "RageBitmapTexture.h"
#include "arch/MovieTexture/MovieTexture.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "RageException.h"
#include "RageDisplay.h"
ModelManager* MODELMAN = NULL;
ModelManager::ModelManager()
{
}
ModelManager::~ModelManager()
{
for( std::map<CString, RageModelGeometry*>::iterator i = m_mapFileToModel.begin();
i != m_mapFileToModel.end();
++i )
{
RageModelGeometry* pModel = i->second;
if( pModel->m_iRefCount )
LOG->Trace( "TEXTUREMAN LEAK: '%s', RefCount = %d.", i->first.c_str(), pModel->m_iRefCount );
SAFE_DELETE( pModel );
}
}
RageModelGeometry* ModelManager::LoadMilkshapeAscii( CString sFile )
{
std::map<CString, RageModelGeometry*>::iterator p = m_mapFileToModel.find(sFile);
if(p != m_mapFileToModel.end())
{
/* Found the texture. Just increase the refcount and return it. */
RageModelGeometry* pModel = p->second;
pModel->m_iRefCount++;
return pModel;
}
RageModelGeometry* pModel = new RageModelGeometry;
pModel->LoadMilkshapeAscii( sFile );
m_mapFileToModel[sFile] = pModel;
return pModel;
}
void ModelManager::UnloadModel( RageModelGeometry *m )
{
m->m_iRefCount--;
ASSERT( m->m_iRefCount >= 0 );
if( m->m_iRefCount )
return; /* Can't unload textures that are still referenced. */
for( std::map<CString, RageModelGeometry*>::iterator i = m_mapFileToModel.begin();
i != m_mapFileToModel.end();
i++ )
{
if( i->second == m )
{
m_mapFileToModel.erase( i ); // remove map entry
SAFE_DELETE( m ); // free the texture
return;
}
}
ASSERT(0); // we tried to delete a texture that wasn't loaded.
}
+35
View File
@@ -0,0 +1,35 @@
#ifndef ModelManager_H
#define ModelManager_H
/*
-----------------------------------------------------------------------------
Class: ModelManager
Desc: Interface for loading and releasing textures.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "Model.h"
#include <map>
class ModelManager
{
public:
ModelManager();
~ModelManager();
RageModelGeometry* LoadMilkshapeAscii( CString sFile );
void UnloadModel( RageModelGeometry *m );
// void ReloadAll();
protected:
std::map<CString, RageModelGeometry*> m_mapFileToModel;
};
extern ModelManager* MODELMAN; // global and accessable from anywhere in our program
#endif
+198
View File
@@ -0,0 +1,198 @@
#include "global.h"
/*
-----------------------------------------------------------------------------
Class: RageModelGeometry
Desc: Types defined in msLib.h.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "RageModelGeometry.h"
#include "RageUtil.h"
#include "RageFile.h"
#include "RageMath.h"
RageModelGeometry::RageModelGeometry ()
{
m_iRefCount = 1;
}
RageModelGeometry::~RageModelGeometry ()
{
}
#define THROW RageException::Throw( "Parse at line %d: '%s'", sLine.c_str() );
void RageModelGeometry::LoadMilkshapeAscii( CString sPath )
{
FixSlashesInPlace(sPath);
const CString sDir = Dirname( sPath );
RageFile f;
if( !f.Open( sPath ) )
RageException::Throw( "RageModelGeometry::LoadMilkshapeAscii Could not open \"%s\": %s", sPath.c_str(), f.GetError().c_str() );
CString sLine;
int iLineNum = 0;
char szName[MS_MAX_NAME];
int nFlags, nIndex, i, j;
RageVec3ClearBounds( m_vMins, m_vMaxs );
while( f.GetLine( sLine ) > 0 )
{
iLineNum++;
if (!strncmp (sLine, "//", 2))
continue;
int nFrame;
if (sscanf (sLine, "Frames: %d", &nFrame) == 1)
{
// ignore
// m_pRageModelGeometry->nTotalFrames = nFrame;
}
if (sscanf (sLine, "Frame: %d", &nFrame) == 1)
{
// ignore
// m_pRageModelGeometry->nFrame = nFrame;
}
int nNumMeshes = 0;
if (sscanf (sLine, "Meshes: %d", &nNumMeshes) == 1)
{
m_Meshes.resize( nNumMeshes );
for (i = 0; i < nNumMeshes; i++)
{
msMesh& mesh = m_Meshes[i];
if( f.GetLine( sLine ) <= 0 )
THROW
// mesh: name, flags, material index
if (sscanf (sLine, "\"%[^\"]\" %d %d",szName, &nFlags, &nIndex) != 3)
THROW
strcpy( mesh.szName, szName );
// mesh.nFlags = nFlags;
mesh.nMaterialIndex = (byte)nIndex;
//
// vertices
//
if( f.GetLine( sLine ) <= 0 )
THROW
int nNumVertices = 0;
if (sscanf (sLine, "%d", &nNumVertices) != 1)
THROW
mesh.Vertices.resize( nNumVertices );
for (j = 0; j < nNumVertices; j++)
{
if( f.GetLine( sLine ) <= 0 )
THROW
RageVector3 Vertex;
RageVector2 uv;
if (sscanf (sLine, "%d %f %f %f %f %f %d",
&nFlags,
&Vertex[0], &Vertex[1], &Vertex[2],
&uv[0], &uv[1],
&nIndex
) != 7)
{
THROW
}
RageModelVertex& vertex = mesh.Vertices[j];
// vertex.nFlags = nFlags;
memcpy( vertex.p, Vertex, sizeof(vertex.p) );
memcpy( vertex.t, uv, sizeof(vertex.t) );
vertex.boneIndex = (byte)nIndex;
RageVec3AddToBounds( RageVector3(Vertex), m_vMins, m_vMaxs );
}
//
// normals
//
if( f.GetLine( sLine ) <= 0 )
THROW
int nNumNormals = 0;
if (sscanf (sLine, "%d", &nNumNormals) != 1)
THROW
vector<RageVector3> Normals;
Normals.resize( nNumNormals );
for (j = 0; j < nNumNormals; j++)
{
if( f.GetLine( sLine ) <= 0 )
THROW
RageVector3 Normal;
if (sscanf (sLine, "%f %f %f", &Normal[0], &Normal[1], &Normal[2]) != 3)
THROW
RageVec3Normalize( (RageVector3*)&Normal, (RageVector3*)&Normal );
Normals[j] = Normal;
}
//
// triangles
//
if( f.GetLine( sLine ) <= 0 )
THROW
int nNumTriangles = 0;
if (sscanf (sLine, "%d", &nNumTriangles) != 1)
THROW
mesh.Triangles.resize( nNumTriangles );
for (j = 0; j < nNumTriangles; j++)
{
if( f.GetLine( sLine ) <= 0 )
THROW
word nIndices[3];
word nNormalIndices[3];
if (sscanf (sLine, "%d %hd %hd %hd %hd %hd %hd %d",
&nFlags,
&nIndices[0], &nIndices[1], &nIndices[2],
&nNormalIndices[0], &nNormalIndices[1], &nNormalIndices[2],
&nIndex
) != 8)
{
THROW
}
// deflate the normals into vertices
for( int k=0; k<3; k++ )
{
RageModelVertex& vertex = mesh.Vertices[ nIndices[k] ];
RageVector3& normal = Normals[ nNormalIndices[k] ];
vertex.n = normal;
}
msTriangle& Triangle = mesh.Triangles[j];
// Triangle.nFlags = nFlags;
memcpy( &Triangle.nVertexIndices, nIndices, sizeof(Triangle.nVertexIndices) );
// Triangle.nSmoothingGroup = nIndex;
}
}
}
}
f.Close();
}
+41
View File
@@ -0,0 +1,41 @@
#ifndef RageModelGeometry_H
#define RageModelGeometry_H
/*
-----------------------------------------------------------------------------
Class: RageModelGeometry
Desc: A 3D RageModelGeometry.
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
Chris Danford
-----------------------------------------------------------------------------
*/
#include "Actor.h"
#include "RageTypes.h"
#include "ModelTypes.h"
#include <vector>
#include <map>
struct msRageModelGeometry;
class RageModelGeometry
{
public:
RageModelGeometry ();
virtual ~RageModelGeometry ();
public:
void LoadMilkshapeAscii( CString sMilkshapeAsciiFile );
int m_iRefCount;
vector<msMesh> m_Meshes;
RageVector3 m_vMins, m_vMaxs;
};
#endif
+3
View File
@@ -55,6 +55,7 @@
#include "RageFileManager.h" #include "RageFileManager.h"
#include "Bookkeeper.h" #include "Bookkeeper.h"
#include "LightsManager.h" #include "LightsManager.h"
#include "ModelManager.h"
#if defined(_XBOX) #if defined(_XBOX)
@@ -951,6 +952,7 @@ int main(int argc, char* argv[])
MEMCARDMAN = new MemoryCardManager; MEMCARDMAN = new MemoryCardManager;
PROFILEMAN = new ProfileManager; // must load after SONGMAN PROFILEMAN = new ProfileManager; // must load after SONGMAN
UNLOCKSYS = new UnlockSystem; UNLOCKSYS = new UnlockSystem;
MODELMAN = new ModelManager;
delete loading_window; // destroy this before init'ing Display delete loading_window; // destroy this before init'ing Display
DISPLAY = CreateDisplay(); DISPLAY = CreateDisplay();
@@ -1027,6 +1029,7 @@ int main(int argc, char* argv[])
SAFE_DELETE( INPUTMAPPER ); SAFE_DELETE( INPUTMAPPER );
SAFE_DELETE( INPUTFILTER ); SAFE_DELETE( INPUTFILTER );
SAFE_DELETE( UNLOCKSYS ); SAFE_DELETE( UNLOCKSYS );
SAFE_DELETE( MODELMAN );
SAFE_DELETE( PROFILEMAN ); // PROFILEMAN needs the songs still loaded SAFE_DELETE( PROFILEMAN ); // PROFILEMAN needs the songs still loaded
SAFE_DELETE( MEMCARDMAN ); SAFE_DELETE( MEMCARDMAN );
SAFE_DELETE( SONGMAN ); SAFE_DELETE( SONGMAN );
+44 -6
View File
@@ -65,7 +65,7 @@ IntDir=.\../Debug6
TargetDir=\stepmania\stepmania\Program TargetDir=\stepmania\stepmania\Program
TargetName=StepMania-debug TargetName=StepMania-debug
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
# End Special Build Tool # End Special Build Tool
@@ -103,8 +103,8 @@ IntDir=.\../Debug_Xbox
TargetDir=\stepmania\stepmania TargetDir=\stepmania\stepmania
TargetName=default TargetName=default
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c \ PreLink_Cmds=disasm\verinc cl /Zl /nologo /c \
verstub.cpp /Fo$(IntDir)\ verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
# End Special Build Tool # End Special Build Tool
@@ -144,7 +144,7 @@ IntDir=.\../Release6
TargetDir=\stepmania\stepmania\Program TargetDir=\stepmania\stepmania\Program
TargetName=StepMania TargetName=StepMania
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi
# End Special Build Tool # End Special Build Tool
@@ -184,8 +184,8 @@ IntDir=.\../Release_Xbox
TargetDir=\stepmania\stepmania TargetDir=\stepmania\stepmania
TargetName=default TargetName=default
SOURCE="$(InputPath)" SOURCE="$(InputPath)"
PreLink_Cmds=disasm\verinc cl /Zl /nologo /c \ PreLink_Cmds=disasm\verinc cl /Zl /nologo /c \
verstub.cpp /Fo$(IntDir)\ verstub.cpp /Fo$(IntDir)\
PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi ia32.vdi
# End Special Build Tool # End Special Build Tool
@@ -629,6 +629,25 @@ SOURCE=.\RageMath.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\RageModelGeometry.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\RageModelGeometry.h
# End Source File
# Begin Source File
SOURCE=.\RageSound.cpp SOURCE=.\RageSound.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug" !IF "$(CFG)" == "StepMania - Win32 Debug"
@@ -2955,6 +2974,25 @@ SOURCE=.\Model.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\ModelManager.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug"
!ELSEIF "$(CFG)" == "StepMania - Xbox Debug"
!ELSEIF "$(CFG)" == "StepMania - Win32 Release"
!ELSEIF "$(CFG)" == "StepMania - Xbox Release"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\ModelManager.h
# End Source File
# Begin Source File
SOURCE=.\ModelTypes.cpp SOURCE=.\ModelTypes.cpp
!IF "$(CFG)" == "StepMania - Win32 Debug" !IF "$(CFG)" == "StepMania - Win32 Debug"
+20 -8
View File
@@ -43,7 +43,7 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 &quot;$(intdir)\verstub.obj&quot;" AdditionalOptions="/MACHINE:I386 &quot;$(intdir)\verstub.obj&quot;"
OutputFile="../Program/StepMania-debug.exe" OutputFile="../../itg/Program/StepMania-debug.exe"
LinkIncremental="2" LinkIncremental="2"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="" AdditionalLibraryDirectories=""
@@ -122,7 +122,7 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386 &quot;$(intdir)\verstub.obj&quot;" AdditionalOptions="/MACHINE:I386 &quot;$(intdir)\verstub.obj&quot;"
OutputFile=".\../Program/StepMania.exe" OutputFile=".\../../itg/Program/StepMania.exe"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="" AdditionalLibraryDirectories=""
@@ -1348,18 +1348,18 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<File <File
RelativePath="ScrollingList.h"> RelativePath="ScrollingList.h">
</File> </File>
<File
RelativePath="SongCreditDisplay.cpp">
</File>
<File
RelativePath="SongCreditDisplay.h">
</File>
<File <File
RelativePath="SnapDisplay.cpp"> RelativePath="SnapDisplay.cpp">
</File> </File>
<File <File
RelativePath="SnapDisplay.h"> RelativePath="SnapDisplay.h">
</File> </File>
<File
RelativePath="SongCreditDisplay.cpp">
</File>
<File
RelativePath="SongCreditDisplay.h">
</File>
<File <File
RelativePath=".\TextBanner.cpp"> RelativePath=".\TextBanner.cpp">
</File> </File>
@@ -1665,6 +1665,12 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<File <File
RelativePath="RageMath.h"> RelativePath="RageMath.h">
</File> </File>
<File
RelativePath="RageModelGeometry.cpp">
</File>
<File
RelativePath="RageModelGeometry.h">
</File>
<File <File
RelativePath="RageSound.cpp"> RelativePath="RageSound.cpp">
</File> </File>
@@ -1890,6 +1896,12 @@ cl /Zl /nologo /c verstub.cpp /Fo&quot;$(IntDir)&quot;\
<File <File
RelativePath="Model.h"> RelativePath="Model.h">
</File> </File>
<File
RelativePath="ModelManager.cpp">
</File>
<File
RelativePath="ModelManager.h">
</File>
<File <File
RelativePath="ModelTypes.cpp"> RelativePath="ModelTypes.cpp">
</File> </File>