From dc493450bf9f911df75e82bf7a6b975ec8aeb964 Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Fri, 25 Feb 2011 02:08:30 -0800 Subject: [PATCH] Break cel shading (it'll be fixed soon, I have to poke at RageDisplay stuff), add TODOs for myself, and comment out some 2D character stuff... 2d chars should be possible to implement in lua instead. --- src/DancingCharacters.cpp | 21 +++++++++++++++++---- src/Model.cpp | 23 +++++++++++------------ 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/DancingCharacters.cpp b/src/DancingCharacters.cpp index 82186994bc..e7ba3e8e0d 100644 --- a/src/DancingCharacters.cpp +++ b/src/DancingCharacters.cpp @@ -14,6 +14,15 @@ #define DC_X( choice ) THEME->GetMetricF("DancingCharacters",ssprintf("2DCharacterXP%d",choice+1)) #define DC_Y( choice ) THEME->GetMetricF("DancingCharacters",ssprintf("2DCharacterYP%d",choice+1)) +/* + * TODO: + * - Metrics/Lua for lighting and camera sweeping. + * - Ability to load secondary elements i.e. stages. + * - Remove support for 2D characters? There's no need for them (Lua can do it). + * - Cleanup! + * + * -- Colby + */ const float CAMERA_REST_DISTANCE = 32.f; const float CAMERA_REST_LOOK_AT_HEIGHT = -11.f; @@ -247,7 +256,8 @@ void DancingCharacters::Update( float fDelta ) m_fThisCameraStartBeat = (float) iCurBeat; m_fThisCameraEndBeat = float(iCurBeat + 8); } - + /* + // is there any of this still around? This block of code is _ugly_. -Colby // update any 2D stuff FOREACH_PlayerNumber( p ) { @@ -286,6 +296,7 @@ void DancingCharacters::Update( float fDelta ) } } } + */ } void DancingCharacters::Change2DAnimState( PlayerNumber pn, int iState ) @@ -326,6 +337,7 @@ void DancingCharacters::DrawPrimitives() bool bDanger = m_bDrawDangerLight; DISPLAY->SetLighting( true ); + RageColor ambient = bFailed ? RageColor(0.2f,0.1f,0.1f,1) : (bDanger ? RageColor(0.4f,0.1f,0.1f,1) : RageColor(0.4f,0.4f,0.4f,1)); RageColor diffuse = bFailed ? RageColor(0.4f,0.1f,0.1f,1) : (bDanger ? RageColor(0.8f,0.1f,0.1f,1) : RageColor(1,0.95f,0.925f,1)); RageColor specular = RageColor(0.8f,0.8f,0.8f,1); @@ -349,12 +361,12 @@ void DancingCharacters::DrawPrimitives() DISPLAY->SetLightOff( 0 ); DISPLAY->SetLighting( false ); - - DISPLAY->ClearZBuffer(); } - DISPLAY->CameraPopMatrix(); + + /* + // Ugly! -Colby // now draw any potential 2D stuff FOREACH_PlayerNumber( p ) { @@ -375,6 +387,7 @@ void DancingCharacters::DrawPrimitives() if(m_bgFail[p].IsLoaded() && m_i2DAnimState[p] == AS2D_FAIL) m_bgFail[p]->Draw(); } + */ } /* diff --git a/src/Model.cpp b/src/Model.cpp index 55a6de8da5..df8685f404 100644 --- a/src/Model.cpp +++ b/src/Model.cpp @@ -65,6 +65,7 @@ void Model::Load( const RString &sFile ) #define THROW RageException::Throw( "Parse error in \"%s\" at line %d: \"%s\".", sPath.c_str(), iLineNum, sLine.c_str() ) +// TODO: Move MS3D loading into its own class. - Colby void Model::LoadMilkshapeAscii( const RString &sPath ) { LoadPieces( sPath, sPath, sPath ); @@ -288,19 +289,17 @@ bool Model::EarlyAbortDraw() const void Model::DrawCelShaded() { // TODO: use shell shader for outline. - this->SetGlow(RageColor(0,0,0,1)); - this->SetDiffuseAlpha(0); - DISPLAY->SetPolygonMode( POLYGON_LINE ); - DISPLAY->SetLineWidth( 3 ); - this->SetZWrite( false ); - this->Draw(); - this->SetDiffuseAlpha(1); - this->SetGlow(RageColor(1,1,1,0)); - DISPLAY->SetPolygonMode( POLYGON_FILL ); this->SetZWrite( true ); - DISPLAY->SetCelShaded( true ); + + // First pass: outline/shell +// DISPLAY->SetCelShaded(1); this->Draw(); - DISPLAY->SetCelShaded( false ); + + // Second pass: normal shading +// DISPLAY->SetCelShaded(2); +// this->Draw(); + +// DISPLAY->SetCelShaded(0) } void Model::DrawPrimitives() @@ -375,7 +374,7 @@ void Model::DrawPrimitives() } // go - DrawMesh( i ); + DrawMesh(i); // Turn off environment mapping on tex unit 0. DISPLAY->SetSphereEnvironmentMapping( TextureUnit_1, false );